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

Function buildParseScript

source code/utils/powershell/parser.ts:689–699  ·  view source on GitHub ↗

* Build the full PowerShell script that parses a command. * The user command is Base64-encoded (UTF-8) and embedded in a variable * to prevent injection attacks.

(command: string)

Source from the content-addressed store, hash-verified

687 * to prevent injection attacks.
688 */
689function buildParseScript(command: string): string {
690 const encoded =
691 typeof Buffer !== 'undefined'
692 ? Buffer.from(command, 'utf8').toString('base64')
693 : btoa(
694 new TextEncoder()
695 .encode(command)
696 .reduce((s, b) => s + String.fromCharCode(b), ''),
697 )
698 return `$EncodedCommand = '${encoded}'\n${PARSE_SCRIPT_BODY}`
699}
700
701/**
702 * Ensure a value is an array. PowerShell 5.1's ConvertTo-Json may unwrap

Callers 1

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected