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

Function interpolate

lib/compile/codegen/code.ts:139–143  ·  view source on GitHub ↗
(x?: string | string[] | number | boolean | null)

Source from the content-addressed store, hash-verified

137
138// TODO do not allow arrays here
139function interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string {
140 return typeof x == "number" || typeof x == "boolean" || x === null
141 ? x
142 : safeStringify(Array.isArray(x) ? x.join(",") : x)
143}
144
145export function stringify(x: unknown): Code {
146 return new _Code(safeStringify(x))

Callers 1

addCodeArgFunction · 0.85

Calls 1

safeStringifyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…