Liking cljdoc? Tell your friends :D

still.serialize

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.
raw docstring

ensure-readable-ednclj/s

(ensure-readable-edn text data context-data)

Verify that text reads back as EDN equal to data.

Returns text unchanged. Throws ex-info when the text cannot be read back (e.g. it contains #object forms) or reads back as something different (e.g. a record, which prints as a plain map and so loses its identity). Either way the value needs a serialiser registered with still.serialize/register-serializer!

Verify that text reads back as EDN equal to data.

Returns text unchanged. Throws ex-info when the text cannot be read back
(e.g. it contains #object forms) or reads back as something different
(e.g. a record, which prints as a plain map and so loses its identity).
Either way the value needs a serialiser registered with
still.serialize/register-serializer!
sourceraw docstring

format-value-for-sourceclj/s

(format-value-for-source value)

Format a value as source text for insertion into snap! calls.

For strings containing newlines when :multiline-strings? is enabled, produces a multi-line string literal with actual newlines instead of \n escapes. Falls back to pretty-print for all other values.

Throws ex-info when the formatted text cannot be read back, since inserting it would corrupt the source file.

Format a value as source text for insertion into snap! calls.

For strings containing newlines when :multiline-strings? is enabled,
produces a multi-line string literal with actual newlines instead of \n escapes.
Falls back to pretty-print for all other values.

Throws ex-info when the formatted text cannot be read back, since inserting
it would corrupt the source file.
sourceraw docstring

pretty-printclj/s

(pretty-print value)

Pretty-print a value as EDN string for snapshot files.

Pretty-print a value as EDN string for snapshot files.
sourceraw docstring

register-serializer!clj/smacro

(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)}))
sourceraw docstring

Serializableclj/sprotocol

Protocol for custom snapshot serialisation.

Protocol for custom snapshot serialisation.

serializeclj/s

(serialize value)

Serialise a value for snapshot storage. Returns EDN-serialisable data.

Serialise a value for snapshot storage. Returns EDN-serialisable data.
sourceraw docstring

serialize-valueclj/s

(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.
sourceraw docstring

stable-value?clj/s

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close