Skip to content

@eightkk/vue-weave / core / serializeWeaveSnapshot

Function: serializeWeaveSnapshot() ​

serializeWeaveSnapshot(input, options?): string

Defined in: src/core/snapshot.ts:248

Convert input to the stored form, validate it and return the JSON text. Output is deterministic: key order is fixed for the document and kept for your own records, Sets are written sorted, and nothing reads the clock (set metadata.savedAt yourself). Throws WeaveSnapshotError for NaN or Infinity, functions and other non-JSON values without a codec, duplicate IDs, unknown references and every other violation parseWeaveSnapshot reports; nothing is silently dropped. Does not mutate input.

Parameters ​

input ​

WeaveSnapshotInput

options? ​

SerializeWeaveSnapshotOptions = {}

Returns ​

string

Released under the MIT License.