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

Function tokenArray

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

Source from the content-addressed store, hash-verified

79
80const tokenArray =
81 (maxItems: number, maxLen: number): Sanitize =>
82 (v) =>
83 Array.isArray(v) &&
84 v.length <= maxItems &&
85 v.every((s) => typeof s === 'string' && s.length > 0 && s.length <= maxLen && TOKEN_RE.test(s))
86 ? v
87 : undefined;
88
89const nonNegInt =
90 (max: number): Sanitize =>

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected