0.1.8 • Published 5 years ago
@cranq/fn-tree v0.1.8
fn-tree
Functional tree manipulation tools
Utilities
pathEquals(a, b)
: Tells whether two paths are equal.pathToString(path)
: Converts array representation of path to string.stringToPath(string)
: Converts string representation of path to array.
Tree querying / manipulation
appendNode(tree, path, values, concat)
: Appends the specified node to the node in the tree on the specified path.appendNodeI(tree, path, values, concat)
: Appends the specified node to the node in the tree on the specified path immutably.deleteNode(tree, path)
: Deletes node from the specified path in the tree.deleteNodeI(tree, path)
: Deletes node from the specified path in the tree immutably.deletePath(tree, path)
: Deletes nodes on the specified path in the tree, up to (including) the first node with siblings.getNode(tree, path)
: Retrieves the node from the specified path in the tree.setNode(tree, path, value)
: Sets the specified node in the tree on the specified path.setNodeI(tree, path, value)
: Sets specified node in the tree on the specified path immutably.