This is a collection of functions for working with asynchronous trees.
For example, Tree
exposes a method isTreelike
that tests whether a given object is a tree or can be coerced to one. You can invoke this method via Tree.isTreelike
:
$ ori Tree.isTreelike 5
false
$ ori Tree.isTreelike { name: "Alice" }
true
Commands by name #
Add next/previous fields to the tree’s values
Apply key/values from source to target
Caches values from the tree
Remove all values from the tree
Concatenate text and/or trees of text
Return a deep tree with a single constant value
Map the keys and values of a deep tree
Return a deeply-merged tree
Reverse order of keys at all levels of the tree
The first n values from the deep tree
The in-order leaf values of the tree
Only the defined values of the tree
The tree’s [key, value] pairs
Filter the source tree
The first value in the tree
Apply fn to each (value, key)
Create a tree from an object
A tree defined by a value function
A tree whose keys can include glob wildcard patterns
A new tree with values grouped by the function
True if key exists in tree
Tree.indent
Tagged template literal for normalizing indentation
The tree’s interior nodes
True if object is an async mutable tree
True if object is an async tree
True if object is traversable
True if object can be coerced to a tree
Render the object in JSON format
The keys of the tree
The tree’s size (number of keys)
Create a new tree by mapping keys and/or values
Map values and reduce them
Return the source tree with only the keys in the mask
Matches simple patterns or regular expressions
Return a new tree merging the given trees
Group the tree’s values into fixed-size sets
The parent of the given tree node
Slash-separated paths for the tree’s values
Render the tree as a plain JavaScript object
A tree whose keys are regular expression strings
Remove the value for the key from tree
Reverse the order of the tree’s keys
The root node of the given tree
Applies the source tree to the target
Shuffle the keys of the tree
A new tree with its keys sorted
The first n values in the tree
Return the value at the path of keys
Return the value at the path of keys or throw
Traverse a slash-separated path
The tree’s values