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

Function isTooSimpleSequence

src/utils.ts:87–101  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

85}
86
87export function isTooSimpleSequence(code: string): boolean {
88 if (!code || code.length < 3) return false
89
90 let asc = true
91 let desc = true
92
93 for (let i = 1; i < code.length; i++) {
94 const prev = Number(code[i - 1])
95 const curr = Number(code[i])
96 if (curr !== (prev + 1) % 10) asc = false
97 if (curr !== (prev + 9) % 10) desc = false
98 }
99
100 return asc || desc
101}
102
103export function fromDigits(digits: string[]): string {
104 return digits.join('')

Callers 4

isCodeAllowedFunction · 0.90
memorabilityScoreFunction · 0.90
analyzeFunction · 0.90
isModeCompatibleFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected