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

Function createCustomContext

src/index.ts:101–117  ·  view source on GitHub ↗
(
	options: GenerateOptions = {}
)

Source from the content-addressed store, hash-verified

99}
100
101export 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
119export default {
120 generateCode,

Callers

nothing calls this directly

Calls 5

getRngFunction · 0.90
getAllowedDigitsFunction · 0.90
pickDigitFunction · 0.90
pickTwoDifferentDigitsFunction · 0.90
pickThreeDifferentDigitsFunction · 0.90

Tested by

no test coverage detected