Function getRoot

  • Returns the root node, this is, will follow the tree up to the node with no parent and will return it.

    Note that this function will throw if the passed object is not a node.

    Type Parameters

    • TRoot extends object

      Root object type.

    Parameters

    • node: object

      Node to get the root from.

    Returns TRoot

    Root object.