MCPcopy Index your code
hub / github.com/arktypeio/arktype / defaultValueSerializer

Function defaultValueSerializer

ark/schema/shared/implement.ts:248–259  ·  view source on GitHub ↗
(v: unknown)

Source from the content-addressed store, hash-verified

246>
247
248export const defaultValueSerializer = (v: unknown): Json => {
249 if (typeof v === "string" || typeof v === "boolean" || v === null) return v
250
251 if (typeof v === "number") {
252 if (Number.isNaN(v)) return "NaN"
253 if (v === Number.POSITIVE_INFINITY) return "Infinity"
254 if (v === Number.NEGATIVE_INFINITY) return "-Infinity"
255 return v
256 }
257
258 return compileSerializedValue(v)
259}
260
261export type NodeKeyImplementation<
262 d extends BaseNodeDeclaration,

Callers 6

createNodeFunction · 0.90
proto.tsFile · 0.90
unit.tsFile · 0.90
sequence.tsFile · 0.90
getDefaultableMorphsFunction · 0.90
getDefaultableMorphFunction · 0.90

Calls 1

compileSerializedValueFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…