MCPcopy Create free account
hub / github.com/cameri/nostream / safeJsonForScript

Function safeJsonForScript

src/utils/html.ts:22–22  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

20 * is valid JSON and prevents the browser from treating the character as markup.
21 */
22export const safeJsonForScript = (value: unknown): string => JSON.stringify(value).replace(/</g, '\\u003C')

Callers 3

html.spec.tsFile · 0.90
handleRequestMethod · 0.90
handleRequestMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected