MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getAllRedirections

Function getAllRedirections

source code/utils/powershell/parser.ts:1509–1529  ·  view source on GitHub ↗
(
  parsed: ParsedPowerShellCommand,
)

Source from the content-addressed store, hash-verified

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

Callers 1

getFileRedirectionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected