Extra zipper helpers.
Extra zipper helpers.
(enter-meta loc)
If the given loc
is a meta node, navigate down to the value to which it is attached,
else return the loc
.
If the given `loc` is a meta node, navigate down to the value to which it is attached, else return the `loc`.
(exit-meta loc)
If the given loc
's parent is a meta node, return the first ancestor whose parent is not,
else return the loc
.
If the given `loc`'s parent is a meta node, return the first ancestor whose parent is not, else return the `loc`.
(ignore-loc? loc)
Should the version at the current position be ignored?
Returns true if any ancestor has the ^:depot/ignore
metadata.
Should the version at the current position be ignored? Returns true if any ancestor has the `^:depot/ignore` metadata.
(left loc)
Like [[rewrite-clj.zip/left], but also skip over uneval nodes
Like [[rewrite-clj.zip/left], but also skip over uneval nodes
(lib-loc-seq loc)
A sequence of zippers each pointing at a library name.
A sequence of zippers each pointing at a library name.
(lib-seq loc)
A sequence of all libraries in the given zipper over deps.edn, returning a seq of [name, coordinate-map] pairs.
A sequence of all libraries in the given zipper over deps.edn, returning a seq of [name, coordinate-map] pairs.
(loc->lib loc)
Given a zipper pointing at a library name, return a pair of [name coordinate-map]
Given a zipper pointing at a library name, return a pair of [name coordinate-map]
(map-keys f zloc)
Like [[rewrite-clj.zip/map-keys]], but account for uneval nodes.
Like [[rewrite-clj.zip/map-keys]], but account for uneval nodes.
(map-vals f loc & args)
Like [[rewrite-clj.zip/map-vals]], but account for uneval nodes, and can take extra args.
Like [[rewrite-clj.zip/map-vals]], but account for uneval nodes, and can take extra args.
(mapped-libs loc f)
Find every unignored dep in a :deps
or :extra-deps
or :override-deps
map, at
the top level and in aliases, and return a map of artifact to output of
(f artifact coords). f must be free of side-effects.
loc
points at the top level map.
Find every unignored dep in a `:deps` or `:extra-deps` or `:override-deps` map, at the top level and in aliases, and return a map of artifact to output of (f artifact coords). f must be free of side-effects. `loc` points at the top level map.
(next-lib loc)
Find the next loc, depth first, that is a library name.
Find the next loc, depth first, that is a library name.
(right loc)
Like [[rewrite-clj.zip/right]], but also skip over uneval nodes
Like [[rewrite-clj.zip/right]], but also skip over uneval nodes
(transform-libs loc f & args)
Transform all coordinate maps in the given zipper over deps.edn. The function f takes a loc pointing at the library name, and returns a new loc.
Transform all coordinate maps in the given zipper over deps.edn. The function f takes a loc pointing at the library name, and returns a new loc.
(zassoc loc k v)
Like [[clojure.core/assoc]], but for a zipper over a map.
New keys will be added at the end, preserving indentation.
Like [[clojure.core/assoc]], but for a zipper over a map. New keys will be added at the end, preserving indentation.
(zget loc key)
Like [[clojure.core/get]], but for a zipper over a map.
Takes and returns a zipper (loc).
Like [[clojure.core/get]], but for a zipper over a map. Takes and returns a zipper (loc).
(znext loc)
Like [[rewrite-clj.zip/next]], but also skip over uneval nodes
Like [[rewrite-clj.zip/next]], but also skip over uneval nodes
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close