MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / tokenArray

Function tokenArray

telemetry-worker/src/index.ts:71–77  ·  view source on GitHub ↗
(maxItems: number, maxLen: number)

Source from the content-addressed store, hash-verified

69
70const tokenArray =
71 (maxItems: number, maxLen: number): Sanitize =>
72 (v) =>
73 Array.isArray(v) &&
74 v.length <= maxItems &&
75 v.every((s) => typeof s === 'string' && s.length > 0 && s.length <= maxLen && TOKEN_RE.test(s))
76 ? v
77 : undefined;
78
79const nonNegInt =
80 (max: number): Sanitize =>

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected