root property

INode get root

Getter to get the root node. If the current node is not a root, then the getter will traverse up the path to get the root.

Implementation

INode get root => isRoot ? this : this.parent!.root;