MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / transformRawOutput

Function transformRawOutput

src/utils/powershell/parser.ts:1106–1126  ·  view source on GitHub ↗

Transform the complete raw PS output into ParsedPowerShellCommand

(raw: RawParsedOutput)

Source from the content-addressed store, hash-verified

1104
1105/** Transform the complete raw PS output into ParsedPowerShellCommand */
1106function transformRawOutput(raw: RawParsedOutput): ParsedPowerShellCommand {
1107 const result: ParsedPowerShellCommand = {
1108 valid: raw.valid,
1109 errors: ensureArray(raw.errors),
1110 statements: ensureArray(raw.statements).map(transformStatement),
1111 variables: ensureArray(raw.variables),
1112 hasStopParsing: raw.hasStopParsing,
1113 originalCommand: raw.originalCommand,
1114 }
1115 const tl = ensureArray(raw.typeLiterals)
1116 if (tl.length > 0) {
1117 result.typeLiterals = tl
1118 }
1119 if (raw.hasUsingStatements) {
1120 result.hasUsingStatements = true
1121 }
1122 if (raw.hasScriptRequirements) {
1123 result.hasScriptRequirements = true
1124 }
1125 return result
1126}
1127
1128/**
1129 * Parse a PowerShell command using the native AST parser.

Callers 1

Calls 1

ensureArrayFunction · 0.85

Tested by

no test coverage detected