MCPcopy Index your code
hub / github.com/TeaCoder52/patcode / getAllowedDigits

Function getAllowedDigits

src/utils.ts:8–13  ·  view source on GitHub ↗
(options?: GenerateOptions)

Source from the content-addressed store, hash-verified

6}
7
8export 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
15export function pickRandom<T>(array: T[], rng: () => number): T {
16 if (!array.length) throw new Error('Cannot pick from empty array')

Callers 4

patterns4.test.tsFile · 0.90
patterns6.test.tsFile · 0.90
generateBankingCodeFunction · 0.90
createCustomContextFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected