Shape descriptor is a format to describe data. This format optimizes for fast detection of value present given a shape and a value path.
This namespace contains functions to operate on maps in the shape descriptor format.
Shape descriptor is a format to describe data. This format optimizes for fast detection of value present given a shape and a value path. This namespace contains functions to operate on maps in the shape descriptor format.
(ast->shape-descriptor ast)
Convert EQL AST to shape descriptor format.
Convert EQL AST to shape descriptor format.
(data->shape-descriptor data)
Helper function to transform a map into an shape descriptor.
Edges of shape descriptor are always an empty map. If a value of the map is a sequence. This will combine the keys present in all items on the final shape description.
WARN: this idea of merging is still under test, this may change in the future.
Helper function to transform a map into an shape descriptor. Edges of shape descriptor are always an empty map. If a value of the map is a sequence. This will combine the keys present in all items on the final shape description. WARN: this idea of merging is still under test, this may change in the future.
(difference s1 s2)
Like set/difference, for shapes.
Like set/difference, for shapes.
(merge-shapes a)
(merge-shapes a b)
Deep merge of shapes, it takes in account that values are always maps.
Deep merge of shapes, it takes in account that values are always maps.
(missing available required)
(missing available required data)
Given some available and required shapes, returns which items are missing from available in the required. Returns nil when nothing is missing.
Given some available and required shapes, returns which items are missing from available in the required. Returns nil when nothing is missing.
(query->shape-descriptor output)
Convert pathom output format into shape descriptor format.
Convert pathom output format into shape descriptor format.
(relax-empty-collections required data)
This helper will remove nested requirements when data is an empty collection. This allows for nested inputs with empty collections to still be valid in shape.
This helper will remove nested requirements when data is an empty collection. This allows for nested inputs with empty collections to still be valid in shape.
(select-shape data shape)
Select the parts of data covered by shape. This is similar to select-keys, but for nested shapes.
Select the parts of data covered by shape. This is similar to select-keys, but for nested shapes.
(select-shape-filtering data shape)
(select-shape-filtering data shape required-shape)
Like select-shape, but in case of collections, if some item doesn't have all the required keys, its removed from the collection.
Like select-shape, but in case of collections, if some item doesn't have all the required keys, its removed from the collection.
(shape-descriptor->ast shape)
Convert pathom output format into shape descriptor format.
Convert pathom output format into shape descriptor format.
(shape-descriptor->ast-children shape)
Convert pathom output format into shape descriptor format.
Convert pathom output format into shape descriptor format.
(shape-descriptor->query shape)
Convert pathom output format into shape descriptor format.
Convert pathom output format into shape descriptor format.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close