Custom serialisation for snapshot values.
Provides a protocol-based system for custom type serialisation, with built-in handlers for common edge cases like timestamps, UUIDs, and unstable values.
Custom serialisation for snapshot values. Provides a protocol-based system for custom type serialisation, with built-in handlers for common edge cases like timestamps, UUIDs, and unstable values.
(pretty-print value)Pretty-print a value as EDN string for snapshot files.
Pretty-print a value as EDN string for snapshot files.
(register-serializer! the-type serializer-fn)Register a custom serialiser for a type.
The serialiser-fn should take a value and return EDN-serialisable data.
Example: (register-serializer! MyRecord (fn [r] {:type ::my-record :data (:data r)}))
Register a custom serialiser for a type.
The serialiser-fn should take a value and return EDN-serialisable data.
Example:
(register-serializer! MyRecord
(fn [r] {:type ::my-record :data (:data r)}))Protocol for custom snapshot serialisation.
Protocol for custom snapshot serialisation.
(serialize value)Serialise a value for snapshot storage. Returns EDN-serialisable data.
Serialise a value for snapshot storage. Returns EDN-serialisable data.
(serialize-value value)Serialise a value for snapshot storage.
Walks the entire data structure and applies custom serialisation where applicable. Returns EDN-serialisable data.
Serialise a value for snapshot storage. Walks the entire data structure and applies custom serialisation where applicable. Returns EDN-serialisable data.
(serialize-with-custom value)Serialise a value using custom serialisers if available.
Serialise a value using custom serialisers if available.
(stable-value? value)Check if a value is stable (deterministic) for snapshot testing.
Returns true if the value contains no timestamps, UUIDs, or other unstable data.
Check if a value is stable (deterministic) for snapshot testing. Returns true if the value contains no timestamps, UUIDs, or other unstable data.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |