ixfx
    Preparing search index...

    Functions

    breadthFirst

    Iterates over the children of root, breadth-first

    childrenLength

    Returns the number of children of tree. Under the hood is just [ ...tree.children() ].length

    couldAddChild

    Returns true if prospectiveChild can be legally added to parent. False is returned if:

    • parent and prospectiveChild are equal
    • parent already contains prospectiveChild
    • prospectiveChild has parent as its own child
    depthFirst

    Iterates over children of root, depth-first.

    find

    Applies predicate to root and all its child nodes, returning the node where predicate yields true. Use findByValue to find a node by its value

    findAnyChildByValue

    Descends parent, breadth-first, looking for a particular value. Returns undefined if not found.

    findAnyParentByValue

    Returns any parent of child that has value possibleParentValue. Returns undefined if not found.

    findByValue

    Applies predicate to root and all its child nodes, returning the node value for predicate yields true. Use find to filter by nodes rather than values

    findChildByValue

    Searches breadth-first for possibleValue under and including parent. maxDepth sets he maximum level to which the tree is searched.

    findParentByValue

    Returns any parent of child that has value possibleParentValue. Returns undefined if not found.

    followValue

    Search through children in a path-like manner.

    hasAnyChild

    Returns true if possibleChild is contained within parent tree. That is, it is any sub-child.

    hasAnyChildValue

    Returns true if parent has any child with value possibleChildValue. It explores at children at any depth from parent.

    hasAnyParent

    Returns true if child is parented at any level (grand-parented etc) by possibleParent

    hasAnyParentValue

    Returns true if child is parented at any level (grand-parented etc) by a parent with value possibleParentValue

    hasChild

    Returns true if possibleChild is contained within maxDepth children of parent node. By default only looks at immediate children (maxDepth = 0).

    hasChildValue

    Returns true if parent has any child with value possibleChildValue. It explores at children up to maxDepth from parent. By default only looks at immediate children (maxDepth = 0).

    hasParent

    Returns true if child exists within possibleParent. By default it only looks at the immediate parent (maxDepth: 0). Use Number.MAX_SAFE_INTEGER for searching recursively upwards (or hasAnyParent)

    hasParentValue

    Checks if a child node has a parent with a certain value Note: by default only checks immediate parent. Set maxDepth to a large value to recurse

    parents

    Iterates over parents of node, starting with immediate parent

    siblings

    Iterates over siblings of node.

    toString
    toStringDeep