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

Function transformRawOutput

source code/utils/powershell/parser.ts:1108–1128  ·  view source on GitHub ↗

Transform the complete raw PS output into ParsedPowerShellCommand

(raw: RawParsedOutput)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

ensureArrayFunction · 0.85

Tested by

no test coverage detected