MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / findControlCharacter

Function findControlCharacter

src/utils/validation.ts:10–18  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

8 * Control characters: 0x00-0x1f and 0x7f (DEL).
9 */
10export function findControlCharacter(value: string): { position: number; hex: string } | null {
11 for (let i = 0; i < value.length; i++) {
12 const code = value.charCodeAt(i);
13 if ((code >= 0x00 && code <= 0x1f) || code === 0x7f) {
14 return { position: i, hex: `0x${code.toString(16).padStart(2, "0")}` };
15 }
16 }
17 return null;
18}
19
20/**
21 * Check whether a string contains any control characters.

Callers 5

validation.test.tsFile · 0.85
hasControlCharactersFunction · 0.85
validateGitUrlFunction · 0.85
validateRefFunction · 0.85
fetchSkillFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…