IsRoot returns whether the given node is the root node in its tree.
(n Node)
| 116 | |
| 117 | // IsRoot returns whether the given node is the root node in its tree. |
| 118 | func IsRoot(n Node) bool { |
| 119 | return n.AsTree().Parent == nil |
| 120 | } |
| 121 | |
| 122 | // Root returns the root node of the given node's tree. |
| 123 | func Root(n Node) Node { |
no test coverage detected