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

Function jsLiteral

packages/plugins/mcp/src/sdk/codex-repl.ts:32–35  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

30 JSON.stringify(value).replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
31
32export const jsLiteral = (value: unknown): string =>
33 `JSON.parse(${JSON.stringify(JSON.stringify(value ?? null))
34 .replaceAll("\u2028", "\\u2028")
35 .replaceAll("\u2029", "\\u2029")})`;
36
37/**
38 * Wrap a program body so it runs in its own scope and reports one JSON value.

Callers 3

codex-repl.test.tsFile · 0.90
skyCallProgramFunction · 0.90
browserCallProgramFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected