MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / recoverExecutionBody

Function recoverExecutionBody

packages/kernel/core/src/code-recovery.ts:142–152  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

140};
141
142export const recoverExecutionBody = (code: string): string => {
143 const source = extractCandidateSource(code);
144 if (!source) return "";
145
146 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: Babel parser throws for malformed candidate code, then recovery falls back to heuristics
147 try {
148 return renderParsedBody(source);
149 } catch {
150 return renderHeuristicBody(source);
151 }
152};

Callers 5

executeWithWorkerdFunction · 0.85
buildExecutionSourceFunction · 0.85
executeInDenoFunction · 0.85
startDynamicWorkerFunction · 0.85

Calls 3

extractCandidateSourceFunction · 0.85
renderParsedBodyFunction · 0.85
renderHeuristicBodyFunction · 0.85

Tested by

no test coverage detected