Skip to content

commandSegments

commandSegments(command): string[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/shell/denylist.ts:33

Split a raw command into the segments a shell would run, normalized and case preserved.

Substitution bodies are segments in their own right: echo $(npm publish) runs npm publish, so a deny entry for npm publish must see it. Splitting on $(, ` and ) yields the body as its own segment (and leaves harmless empty fragments, which are dropped).

Case is preserved because the matcher folds it per list and per matcher — a regexp entry is compiled exactly as the user wrote it, and folding here would decide that for it.

string

string[]