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

Function getVariablesByScope

src/utils/powershell/parser.ts:1533–1539  ·  view source on GitHub ↗
(
  parsed: ParsedPowerShellCommand,
  scope: string,
)

Source from the content-addressed store, hash-verified

1531 * Variable paths in PowerShell can have scopes like "env:PATH", "global:x".
1532 */
1533export function getVariablesByScope(
1534 parsed: ParsedPowerShellCommand,
1535 scope: string,
1536): ParsedVariable[] {
1537 const prefix = scope.toLowerCase() + ':'
1538 return parsed.variables.filter(v => v.path.toLowerCase().startsWith(prefix))
1539}
1540
1541/**
1542 * Check if any command in the parsed result matches a given name (case-insensitive).

Callers 1

checkEnvVarManipulationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected