wip: add helper & base

This commit is contained in:
元凛
2022-02-07 17:56:12 +08:00
parent 69e103e931
commit 18db22e255
14 changed files with 514 additions and 79 deletions

10
src/util/deal.ts Normal file
View 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;
}

View File

@@ -0,0 +1,5 @@
import { dealStringToArr } from 'actions-util';
export { dealStringToArr };
export * from './data';
export * from './deal';