Returns a deep, plain (un-proxied) copy of a JSON-compatible value.
THE way to clone, structuredClone, postMessage, store in IndexedDB, or freeze a value obtained
from a generated <Field>Object JSONType accessor. Those accessors return a live Proxy; a Proxy
cannot be structured-cloned (DataCloneError), and a clone of it made any other way may still
hold live references back into the entity.
Works identically on ordinary, non-proxied values, so callers never have to know which they hold.
The result has JSON semantics — it is equal to JSON.parse(JSON.stringify(value)): undefined
members and functions are dropped, Dates become ISO strings. Primitives, null and undefined
are returned as they are.
Returns a deep, plain (un-proxied) copy of a JSON-compatible value.
THE way to clone,
structuredClone,postMessage, store in IndexedDB, or freeze a value obtained from a generated<Field>ObjectJSONType accessor. Those accessors return a liveProxy; a Proxy cannot be structured-cloned (DataCloneError), and a clone of it made any other way may still hold live references back into the entity.Works identically on ordinary, non-proxied values, so callers never have to know which they hold. The result has JSON semantics — it is equal to
JSON.parse(JSON.stringify(value)):undefinedmembers and functions are dropped,Dates become ISO strings. Primitives,nullandundefinedare returned as they are.