Liking cljdoc? Tell your friends :D

com.vadelabs.toon.decode.events

Event types and utilities for streaming TOON decode.

Events are simple maps with a :type key. Prefer using maps directly:

{:type :start-object} {:type :end-object} {:type :start-array :length 3} {:type :end-array} {:type :key :key "field-name"} {:type :key :key "field-name" :was-quoted true} {:type :primitive :value <value>}

This enables memory-efficient processing of large TOON documents.

Event types and utilities for streaming TOON decode.

Events are simple maps with a :type key. Prefer using maps directly:

  {:type :start-object}
  {:type :end-object}
  {:type :start-array :length 3}
  {:type :end-array}
  {:type :key :key "field-name"}
  {:type :key :key "field-name" :was-quoted true}
  {:type :primitive :value <value>}

This enables memory-efficient processing of large TOON documents.
raw docstring

end-arrayclj/s

(end-array)

Create end-array event. Prefer: {:type :end-array}

Create end-array event.
Prefer: {:type :end-array}
sourceraw docstring

end-array?clj/s

(end-array? event)

Returns true if event is end-array.

Returns true if event is end-array.
sourceraw docstring

end-objectclj/s

(end-object)

Create end-object event. Prefer: {:type :end-object}

Create end-object event.
Prefer: {:type :end-object}
sourceraw docstring

end-object?clj/s

(end-object? event)

Returns true if event is end-object.

Returns true if event is end-object.
sourceraw docstring

event-keyclj/s

(event-key event)

Extract key from key event.

Extract key from key event.
sourceraw docstring

key-eventclj/s

(key-event k)
(key-event k was-quoted)

Create key event. Prefer: {:type :key :key k} or {:type :key :key k :was-quoted true}

Note: :was-quoted is only included when true (matches TypeScript API).

Create key event.
Prefer: {:type :key :key k} or {:type :key :key k :was-quoted true}

Note: :was-quoted is only included when true (matches TypeScript API).
sourceraw docstring

key-event?clj/s

(key-event? event)

Returns true if event is a key event.

Returns true if event is a key event.
sourceraw docstring

lengthclj/s

(length event)

Extract length from start-array event. Returns nil for non-array events.

Extract length from start-array event.
Returns nil for non-array events.
sourceraw docstring

primitiveclj/s

(primitive value)

Create primitive event. Prefer: {:type :primitive :value v}

Create primitive event.
Prefer: {:type :primitive :value v}
sourceraw docstring

primitive?clj/s

(primitive? event)

Returns true if event is a primitive value.

Returns true if event is a primitive value.
sourceraw docstring

start-arrayclj/s

(start-array length)

Create start-array event with length. Prefer: {:type :start-array :length n}

Create start-array event with length.
Prefer: {:type :start-array :length n}
sourceraw docstring

start-array?clj/s

(start-array? event)

Returns true if event is start-array.

Returns true if event is start-array.
sourceraw docstring

start-objectclj/s

(start-object)

Create start-object event. Prefer: {:type :start-object}

Create start-object event.
Prefer: {:type :start-object}
sourceraw docstring

start-object?clj/s

(start-object? event)

Returns true if event is start-object.

Returns true if event is start-object.
sourceraw docstring

valueclj/s

(value event)

Extract value from primitive event.

Extract value from primitive event.
sourceraw docstring

was-quotedclj/s

(was-quoted event)

Returns true if key was quoted in original TOON source. Returns false/nil for non-key events or unquoted keys.

Returns true if key was quoted in original TOON source.
Returns false/nil for non-key events or unquoted keys.
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