MCPcopy
hub / github.com/audreyt/ethercalc / extractCommand

Function extractCommand

packages/client-multi/src/Foldr.ts:318–324  ·  view source on GitHub ↗

* The legacy code read `res.body.command[1]` — body.command is an array * shaped `[status, commandString]`. Pull the string out defensively.

(res: FoldrPushResponse | null)

Source from the content-addressed store, hash-verified

316 * shaped `[status, commandString]`. Pull the string out defensively.
317 */
318function extractCommand(res: FoldrPushResponse | null): string | undefined {
319 if (!res) return undefined;
320 const cmd = res.command;
321 if (Array.isArray(cmd) && typeof cmd[1] === 'string') return cmd[1];
322 if (typeof cmd === 'string') return cmd;
323 return undefined;
324}

Callers 1

pushMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected