Object (map) encoding for TOON format.
Handles encoding of maps with:
Object (map) encoding for TOON format. Handles encoding of maps with: - Simple key-value pairs - Nested objects with indentation - Arrays as values - Key collapsing for nested single-key objects
(key-value-pair k v options depth writer)(key-value-pair k v options depth writer siblings)Encodes a single key-value pair by dispatching to appropriate encoder.
Supports key collapsing for nested single-key objects when enabled.
Dispatches based on value type:
Parameters:
Returns: Updated LineWriter
Encodes a single key-value pair by dispatching to appropriate encoder. Supports key collapsing for nested single-key objects when enabled. Dispatches based on value type: - Primitives → primitive-pair - Empty arrays → empty-array-pair - Primitive arrays → primitive-array-pair - Complex arrays → complex-array-pair - Objects → object-pair (or collapsed key path) Parameters: - k: String key - v: Any value (primitive, array, or object) - options: Encoding options map - depth: Current indentation depth - writer: LineWriter instance - siblings: Optional vector of sibling keys (for collapsing collision detection) Returns: Updated LineWriter
(object obj options depth writer)Encodes a map to TOON format.
Collects all keys first to enable collapsing collision detection.
Parameters:
Returns: Updated LineWriter.
Encodes a map to TOON format. Collects all keys first to enable collapsing collision detection. Parameters: - obj: Map to encode - options: Encoding options map with :delimiter and :key-collapsing - depth: Current indentation depth - writer: LineWriter instance Returns: Updated LineWriter.
(value v {:keys [delimiter] :as options} depth writer)Encodes any value to TOON format.
Dispatch function that routes to appropriate encoder:
Parameters:
Returns: Updated LineWriter.
Encodes any value to TOON format. Dispatch function that routes to appropriate encoder: - Primitives → primitive encoder - Arrays → array encoder - Objects → object encoder Parameters: - v: Any value to encode - options: Encoding options map - depth: Current indentation depth - writer: LineWriter instance Returns: Updated LineWriter.
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 |