(options?: GenerateOptions)
| 6 | } |
| 7 | |
| 8 | export function getAllowedDigits(options?: GenerateOptions): string[] { |
| 9 | if (options?.allowedDigits && options.allowedDigits.length > 0) { |
| 10 | return options.allowedDigits.slice() |
| 11 | } |
| 12 | return ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] |
| 13 | } |
| 14 | |
| 15 | export function pickRandom<T>(array: T[], rng: () => number): T { |
| 16 | if (!array.length) throw new Error('Cannot pick from empty array') |
no outgoing calls
no test coverage detected