MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isSingleCommand

Function isSingleCommand

src/utils/powershell/parser.ts:1594–1602  ·  view source on GitHub ↗
(parsed: ParsedPowerShellCommand)

Source from the content-addressed store, hash-verified

1592 */
1593// exported for testing
1594export function isSingleCommand(parsed: ParsedPowerShellCommand): boolean {
1595 const stmt = parsed.statements[0]
1596 return (
1597 parsed.statements.length === 1 &&
1598 stmt !== undefined &&
1599 stmt.commands.length === 1 &&
1600 (!stmt.nestedCommands || stmt.nestedCommands.length === 0)
1601 )
1602}
1603
1604/**
1605 * Check if a specific command has a given argument/flag (case-insensitive).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected