tree: namespace

Work with trees

Commands by name

tree:
addNextPrevious(tree)
Add next/previous fields to the tree’s values
tree:
assign(target, source)
Apply key/values from source to target
tree:
cache(tree, [cache], [filter])
Caches values from the tree
tree:
clear(tree)
Remove all values from the tree
tree:
concat(…objs)
Concatenate text and/or trees of text
tree:
copy(source, target)
Copy the source tree to the target
tree:
deepMap(tree, options)
Map the keys and values of a deep tree
tree:
deepMerge(…trees)
Return a deeply-merged tree
tree:
deepReverse(tree)
Reverse order of keys at all levels of the tree
tree:
deepTake(tree, n)
The first n values from the deep tree
tree:
deepValues(tree)
The in-order leaf values of the tree
tree:
defineds(tree)
Only the defined values of the tree
tree:
entries(tree)
The tree’s [key, value] pairs
tree:
first(tree)
The first value in the tree
tree:
forEach(tree, fn)
Apply fn to each (value, key)
tree:
from(object, options)
Create a tree from an object
tree:
fromFn(fn, [keys])
A tree defined by a value function
tree:
globs(patterns)
A tree whose keys can include wildcard patterns
tree:
group(tree, fn)
A new tree with values grouped by the function
tree:
has(tree, key)
True if key exists in tree
tree:
inners(tree)
The tree’s interior nodes
tree:
isAsyncMutableTree(object)
True if object is an async mutable tree
tree:
isAsyncTree(object)
True if object is an async tree
tree:
isTraversable(object)
True if object is traversable
tree:
isTreelike(object)
True if object can be coerced to a tree
tree:
keys(tree)
The keys of the tree
tree:
length(tree)
The tree’s size (number of keys)
tree:
map(tree, options)
Create a new tree by mapping keys and/or values
tree:
mapReduce(tree, valueFn, reduceFn)
Map values and reduce them
tree:
match(pattern, fn, [keys])
Matches simple patterns or regular expressions
tree:
merge(…trees)
Return a new tree merging the given trees
tree:
paginate(tree, [n])
Group the tree’s values into fixed-size sets
tree:
parent(tree)
The parent of the given tree node
tree:
paths(tree)
Slash-separated paths for the tree’s values
tree:
plain(tree)
Render the tree as a plain JavaScript object
tree:
remove(tree, key)
Remove the value for the key from tree
tree:
reverse(tree)
Reverse the order of the tree’s keys
tree:
root(tree)
The root node of the given tree
tree:
setDeep(target, source)
Applies the source tree to the target
tree:
shuffle(tree)
Shuffle the keys of the tree
tree:
sort(tree, options)
A new tree with its keys sorted
tree:
take(tree, n)
The first n values in the tree
tree:
traverse(tree, …keys)
Return the value at the path of keys
tree:
traverseOrThrow(tree, …keys)
Return the value at the path of keys or throw
tree:
traversePath(tree, path)
Traverse a slash-separated path
tree:
values(tree)
The tree’s values