MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getAllRedirections

Function getAllRedirections

src/utils/powershell/parser.ts:1507–1527  ·  view source on GitHub ↗
(
  parsed: ParsedPowerShellCommand,
)

Source from the content-addressed store, hash-verified

1505 */
1506// exported for testing
1507export function getAllRedirections(
1508 parsed: ParsedPowerShellCommand,
1509): ParsedRedirection[] {
1510 const redirections: ParsedRedirection[] = []
1511 for (const statement of parsed.statements) {
1512 for (const redir of statement.redirections) {
1513 redirections.push(redir)
1514 }
1515 // Include redirections from nested commands (e.g., from && / || chains)
1516 if (statement.nestedCommands) {
1517 for (const cmd of statement.nestedCommands) {
1518 if (cmd.redirections) {
1519 for (const redir of cmd.redirections) {
1520 redirections.push(redir)
1521 }
1522 }
1523 }
1524 }
1525 }
1526 return redirections
1527}
1528
1529/**
1530 * Get all variables, optionally filtered by scope (e.g., 'env').

Callers 1

getFileRedirectionsFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected