MCPcopy Create free account
hub / github.com/cloudflare/templates / jsonForScript

Function jsonForScript

internal-sites-template/src/html.ts:24–26  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

22 * a `</script>` sequence in the value from closing the script block.
23 */
24export function jsonForScript(value: unknown): string {
25 return JSON.stringify(value).replace(/</g, "\\u003c");
26}

Callers 1

renderShellFunction · 0.90

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected