Liking cljdoc? Tell your friends :D
All platforms.

com.vadelabs.toon.decode.value-builder

Reconstructs values from event streams.

Provides functions to build complete value trees from parse events, enabling reconstruction of the original data structure after streaming decode.

Reconstructs values from event streams.

Provides functions to build complete value trees from parse events,
enabling reconstruction of the original data structure after streaming decode.
raw docstring

events->valueclj/s

(events->value events)

Reconstruct value from event stream.

Takes a sequence of parse events (from decode-stream-sync or decode-stream) and reconstructs the original data structure.

Parameters:

  • events: Sequence or iterable of parse events

Returns: Reconstructed value (map, vector, or primitive)

Example: (let [events [{:type :start-object} {:type :key :key "name"} {:type :primitive :value "Alice"} {:type :key :key "age"} {:type :primitive :value 30} {:type :end-object}]] (events->value events)) ;=> {"name" "Alice", "age" 30}

Throws:

  • ex-info on malformed event streams (unmatched brackets, missing keys, etc.)
Reconstruct value from event stream.

Takes a sequence of parse events (from decode-stream-sync or decode-stream)
and reconstructs the original data structure.

Parameters:
  - events: Sequence or iterable of parse events

Returns:
  Reconstructed value (map, vector, or primitive)

Example:
  (let [events [{:type :start-object}
                {:type :key :key "name"}
                {:type :primitive :value "Alice"}
                {:type :key :key "age"}
                {:type :primitive :value 30}
                {:type :end-object}]]
    (events->value events))
  ;=> {"name" "Alice", "age" 30}

Throws:
  - ex-info on malformed event streams (unmatched brackets, missing keys, etc.)
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