proletariat.json

Provides utilities for working with JSON including an implementation of a clojure.zip zipper geared towards JSON for walking and manipulating the tree.

json-array-element-coll?

(json-array-element-coll? node)

Tests whether node is a JSON array element and if so whether it is a collection type

json-array-element-leaf?

(json-array-element-leaf? node)

Tests whether node is a JSON array element and if so whether it is also a leaf node

json-array-element?

(json-array-element? node)

Tests whether node is a JSON array element which in itself could be an object, array, or scalar

json-array?

(json-array? node)

Tests whether node is an array-like data structure: ie: an unbounded, sequential list that allows duplicates.

json-branch?

(json-branch? node)

Tests whether node would qualify as a branch node in the context of a json-zipper

json-coll?

(json-coll? node)

Tests whether node is a json collection type: a map or an array

json-entry-array?

(json-entry-array? node)

Tests whether node is a map-entry and if so whether its value is an array type

json-entry-coll?

(json-entry-coll? node)

Tests whether node is a map-entry and if so whether its value is a collection type.

json-entry-leaf?

(json-entry-leaf? node)

Tests whether node is a map-entry and if so whether it’s a leaf node

json-entry-obj?

(json-entry-obj? node)

Tests whether node is a map-entry and if so whether its value is a map type

json-entry?

(json-entry? node)

Tests whether node is an entry in a JSON object. Just a wrapper for map-entry? for naming consistency

json-leaf?

(json-leaf? node)

Tests whether node would qualify as a leaf node in the context of a json-zipper

json-node

(json-node loc)

Works like clojure.zip/node except provides nil punning.

json-obj?

(json-obj? node)

Tests whether node is a json object data structure. Just a wrapper for map? for naming consistency

json-root-node?

(json-root-node? node)

Tests whether node is the JSON root node in the context of a json-zipper

json-zip

(json-zip m)

Returns a JSON zipper for a clojure data structure generated from JSON data (as from json/parse).

root?

(root? loc)

Returns true if the loc is at the root of the tree, otherwise false

walk-seq

(walk-seq loc)

Returns a Lazy Sequence of all locations returned from a depth-first walk of a zipper location