Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
*/
24
export
function
jsonForScript(value: unknown): string {
25
return
JSON.stringify(value).replace(/</g,
"\\u003c"
);
26
}
Callers
1
renderShell
Function · 0.90
Calls
1
replace
Method · 0.65
Tested by
no test coverage detected