MCPcopy Index your code
hub / github.com/TanStack/ai / assertNoLeadingDash

Function assertNoLeadingDash

packages/ai-sandbox/src/git-exec.ts:29–35  ·  view source on GitHub ↗

Reject values that could be parsed as a git flag when used as a positional.

(value: string, name: string)

Source from the content-addressed store, hash-verified

27
28/** Reject values that could be parsed as a git flag when used as a positional. */
29function assertNoLeadingDash(value: string, name: string): void {
30 if (value.startsWith('-')) {
31 throw new Error(
32 `git-exec: ${name} "${value}" must not begin with "-" (argument-injection guard).`,
33 )
34 }
35}
36
37// Credential helper that prints creds read from the child ENV. Single-quoted at
38// the call site so the outer shell passes it literally; git expands the vars in

Callers 2

atFunction · 0.85
createExecBackedGitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected