(
options: GenerateOptions = {}
)
| 99 | } |
| 100 | |
| 101 | export function createCustomContext( |
| 102 | options: GenerateOptions = {} |
| 103 | ): CustomStrategyContext { |
| 104 | const length: CodeLength = options.length === 4 ? 4 : 6 |
| 105 | const rng = getRng(options) |
| 106 | const digits = getAllowedDigits(options) |
| 107 | |
| 108 | return { |
| 109 | length, |
| 110 | pickDigit: () => pickDigit(digits, rng), |
| 111 | pickTwoDifferentDigits: () => pickTwoDifferentDigits(digits, rng), |
| 112 | pickThreeDifferentDigits: () => pickThreeDifferentDigits(digits, rng), |
| 113 | fromDigits, |
| 114 | isTooSimple: isTooSimpleSequence, |
| 115 | isAllSame, |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | export default { |
| 120 | generateCode, |
nothing calls this directly
no test coverage detected