MCPcopy
hub / github.com/coder/mux / assertShellEnvName

Function assertShellEnvName

src/node/runtime/shellEnv.ts:5–9  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

3const SHELL_ENV_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
4
5export function assertShellEnvName(key: string): void {
6 if (!SHELL_ENV_NAME_PATTERN.test(key)) {
7 throw new Error(`Invalid shell environment variable name: ${key}`);
8 }
9}
10
11export function buildShellExport(
12 key: string,

Callers 1

buildShellExportFunction · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected