MCPcopy Create free account
hub / github.com/Effect-TS/effect / escapeJson

Function escapeJson

packages/effect/src/unstable/httpapi/internal/html.ts:6–10  ·  view source on GitHub ↗
(spec: unknown)

Source from the content-addressed store, hash-verified

4
5/** @internal */
6export function escapeJson(spec: unknown): string {
7 return JSON.stringify(spec)
8 .replace(ESCAPE_SCRIPT_DATA, "\\u003c")
9 .replace(ESCAPE_LINE_TERMS, (c) => c === "\u2028" ? "\\u2028" : "\\u2029")
10}
11
12/** @internal */
13export function escape(str: string): string {

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected