mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-20 02:35:58 +08:00
wip: add helper & base
This commit is contained in:
10
src/util/deal.ts
Normal file
10
src/util/deal.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import sampleSize from 'lodash/sampleSize';
|
||||
import { dealStringToArr } from 'actions-util';
|
||||
|
||||
export const dealRandomAssignees = (assignees: string, randomTo: string | void): string[] => {
|
||||
let arr = dealStringToArr(assignees);
|
||||
if (randomTo && Number(randomTo) > 0 && Number(randomTo) < arr.length) {
|
||||
arr = sampleSize(arr, Number(randomTo));
|
||||
}
|
||||
return arr;
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
import { dealStringToArr } from 'actions-util';
|
||||
export { dealStringToArr };
|
||||
|
||||
export * from './data';
|
||||
export * from './deal';
|
||||
|
Reference in New Issue
Block a user