MCPcopy Create free account
hub / github.com/codeaashu/claude-code / validateUnicodeWhitespace

Function validateUnicodeWhitespace

src/tools/BashTool/bashSecurity.ts:1902–1917  ·  view source on GitHub ↗
(
  context: ValidationContext,
)

Source from the content-addressed store, hash-verified

1900 /[\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/
1901
1902function validateUnicodeWhitespace(
1903 context: ValidationContext,
1904): PermissionResult {
1905 const { originalCommand } = context
1906 if (UNICODE_WS_RE.test(originalCommand)) {
1907 logEvent('tengu_bash_security_check_triggered', {
1908 checkId: BASH_SECURITY_CHECK_IDS.UNICODE_WHITESPACE,
1909 })
1910 return {
1911 behavior: 'ask',
1912 message:
1913 'Command contains Unicode whitespace characters that could cause parsing inconsistencies',
1914 }
1915 }
1916 return { behavior: 'passthrough', message: 'No Unicode whitespace' }
1917}
1918
1919function validateMidWordHash(context: ValidationContext): PermissionResult {
1920 const { unquotedKeepQuoteChars } = context

Callers

nothing calls this directly

Calls 1

logEventFunction · 0.85

Tested by

no test coverage detected