MCPcopy Index your code
hub / github.com/cameri/nostream / parsePackJsonOutput

Function parsePackJsonOutput

test/unit/cli/cli.integration.spec.ts:91–97  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

89}
90
91const parsePackJsonOutput = <T>(output: string): T => {
92 const start = output.search(/^\s*[\[{]/m)
93 if (start === -1) {
94 throw new Error(`No JSON payload found in pack output: ${output}`)
95 }
96 return JSON.parse(output.slice(start).trim()) as T
97}
98
99const runCommand = (command: string, args: string[]): Promise<CliResult> => {
100 return new Promise((resolve, reject) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected