Liking cljdoc? Tell your friends :D

com.wsscode.pathom3.format.shape-descriptor

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.
raw docstring

ast->shape-descriptorclj/s

(ast->shape-descriptor ast)

Convert EQL AST to shape descriptor format.

Convert EQL AST to shape descriptor format.
sourceraw docstring

data->shape-descriptorclj/s

(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.
sourceraw docstring

differenceclj/s

(difference s1 s2)

Like set/difference, for shapes.

Like set/difference, for shapes.
sourceraw docstring

merge-shapesclj/s

(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.
sourceraw docstring

missingclj/s

(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.
sourceraw docstring

query->shape-descriptorclj/s

(query->shape-descriptor output)

Convert pathom output format into shape descriptor format.

Convert pathom output format into shape descriptor format.
sourceraw docstring

relax-empty-collectionsclj/s

(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.
sourceraw docstring

select-shapeclj/s

(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.
sourceraw docstring

select-shape-filteringclj/s

(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.
sourceraw docstring

shape-descriptor->astclj/s

(shape-descriptor->ast shape)

Convert pathom output format into shape descriptor format.

Convert pathom output format into shape descriptor format.
sourceraw docstring

shape-descriptor->ast-childrenclj/s

(shape-descriptor->ast-children shape)

Convert pathom output format into shape descriptor format.

Convert pathom output format into shape descriptor format.
sourceraw docstring

shape-descriptor->queryclj/s

(shape-descriptor->query shape)

Convert pathom output format into shape descriptor format.

Convert pathom output format into shape descriptor format.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close