Skip to content

stripBeforeSeparator

Generated reference page for the stripBeforeSeparator function export.

Signatures

ts
function stripBeforeSeparator(argv: readonly string[], token: string): readonly string[];
ParameterTypeDescription
argvreadonly string[]Raw argument strings.
tokenstringExact flag token to strip (e.g. --json).

Members

Members

stripBeforeSeparator

Remove every occurrence of token that appears before the -- end-of-options separator, leaving post-separator literals untouched.

The strip counterpart to includesBeforeSeparator: root-level flags (--json) are stripped before dispatch/parse so the command schema never sees them, but a literal after -- (-- --json) must reach the command unchanged.

ts
(argv: readonly string[], token: string): readonly string[];

See Also

Released under the MIT License.