MCPcopy
hub / github.com/ajv-validator/ajv / safeStringify

Function safeStringify

lib/compile/codegen/code.ts:149–153  ·  view source on GitHub ↗
(x: unknown)

Source from the content-addressed store, hash-verified

147}
148
149export function safeStringify(x: unknown): string {
150 return JSON.stringify(x)
151 .replace(/\u2028/g, "\\u2028")
152 .replace(/\u2029/g, "\\u2029")
153}
154
155export function getProperty(key: Code | string | number): Code {
156 return typeof key == "string" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`

Callers 3

strFunction · 0.85
interpolateFunction · 0.85
stringifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…