Get the depth of the zipper, where a zipper focused on the root node gets a depth of 0.
0
Underlying tree type.
Zipper to be queried.
Integer depth of the zipper.
import {Zipper, from, of} from 'effect-tree'const tree = from(1, of(2), of(3))const zipper = Zipper.fromTree(tree)expect(Zipper.getDepth(zipper)).toBe(0)const moved = Zipper.head(zipper)expect(Zipper.getDepth(moved)).toBe(1) Copy
import {Zipper, from, of} from 'effect-tree'const tree = from(1, of(2), of(3))const zipper = Zipper.fromTree(tree)expect(Zipper.getDepth(zipper)).toBe(0)const moved = Zipper.head(zipper)expect(Zipper.getDepth(moved)).toBe(1)
Get the depth of the zipper, where a zipper focused on the root node gets a depth of
0.