Liking cljdoc? Tell your friends :D

nsorg.zip

Functions for working with zippers.

Functions for working with zippers.
raw docstring

ancestorsclj

(ancestors zloc)

Return seq of zipper nodes that are ancestors of the given zipper node.

Parameters: zloc - zipper node

Return seq of zipper nodes that are ancestors of the given zipper node.

Parameters:
  zloc - zipper node
sourceraw docstring

find-ns-formclj

(find-ns-form zloc)

Finds ns form in the subtree of given zipper node.

Parameters: zloc - zipper node

Finds ns form in the subtree of given zipper node.

Parameters:
  zloc - zipper node
sourceraw docstring

order-node-pairsclj

(order-node-pairs zlocs)

Order given zipper node pairs alphabetically by sexpr value of left element of the pair. If sexpr is sequential, use the sexpr value of the first item for sorting.

Parameters: zlocs - zipper node pairs to sort

Order given zipper node pairs alphabetically by sexpr value of left element of the pair. If sexpr is sequential,
use the sexpr value of the first item for sorting.

Parameters:
zlocs - zipper node pairs to sort
sourceraw docstring

order-nodesclj

(order-nodes zlocs)

Order given zipper nodes alphabetically by their sexpr value. If sexpr is sequential, use the sexpr value of the first item for sorting.

Parameters: zlocs - zipper nodes to sort

Order given zipper nodes alphabetically by their sexpr value. If sexpr is sequential, use the sexpr value of the
first item for sorting.

Parameters:
zlocs - zipper nodes to sort
sourceraw docstring

order-sexprclj

(order-sexpr zloc)
(order-sexpr zloc {:keys [exclude-first? map?] :as opts})

Order child zipper nodes of given collection zipper node.

Parameters: zloc - collection zipper node exclude-first? - exclude first element of collection from sorting (default: false) map? - collection is map and nodes should be ordered as pairs (default: false)

Order child zipper nodes of given collection zipper node.

Parameters:
  zloc           - collection zipper node
  exclude-first? - exclude first element of collection from sorting (default: false)
  map?           - collection is map and nodes should be ordered as pairs (default: false)
sourceraw docstring

organize-ns-formclj

(organize-ns-form ns-zloc rules)

Organize ns form by applying given rules. A single rule a map with two keys:

:predicate - function of zipper node decided if rule should be applied to this node :transform - modifies given zipper node

Parameters: ns-zloc - zipper node of ns form rules - collection of rules to apply

Organize ns form by applying given rules. A single rule a map with two keys:

  :predicate - function of zipper node decided if rule should be applied to this node
  :transform - modifies given zipper node

Parameters:
  ns-zloc - zipper node of ns form
  rules   - collection of rules to apply 
sourceraw docstring

remove-duplicates-from-sexprclj

(remove-duplicates-from-sexpr zloc)
(remove-duplicates-from-sexpr zloc {:keys [exclude-first? map?]})

Remove duplicates from child zipper nodes of given collection zipper node. Map entries are considered duplicates if they they have the same value (not key).

Parameters: zloc - collection zipper node exclude-first? - exclude first element of collection from duplicate removal (default: false) map? - collection is map and nodes should be treated as pairs (default: false)

Remove duplicates from child zipper nodes of given collection zipper node.
Map entries are considered duplicates if they they have the same value (not key).

Parameters:
  zloc           - collection zipper node
  exclude-first? - exclude first element of collection from duplicate removal (default: false)
  map?           - collection is map and nodes should be treated as pairs (default: false)
sourceraw docstring

right-nodesclj

(right-nodes zloc)

Return seq of zipper nodes that are right siblings of the given zipper node.

Parameters: zloc - zipper node

Return seq of zipper nodes that are right siblings of the given zipper node.

Parameters:
  zloc - zipper node
sourceraw docstring

sexprclj

(sexpr zloc)

Like `rewrite.clj.zip/sexpr but returns nil for nodes that are printable-only.

Like `rewrite.clj.zip/sexpr but returns nil for nodes that are printable-only.
sourceraw docstring

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

× close