MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / getZLevelTop

Function getZLevelTop

packages/core/src/document/node/node.ts:769–782  ·  view source on GitHub ↗
(child: Node, zLevel: number)

Source from the content-addressed store, hash-verified

767 * get the top node of the same zLevel
768 */
769export const getZLevelTop = (child: Node, zLevel: number): Node | null => {
770 let l = child.zLevel
771 if (l < zLevel || zLevel < 0) {
772 return null
773 }
774 if (l === zLevel) {
775 return child
776 }
777 let r: any = child
778 while (r && l-- > zLevel) {
779 r = r.parent
780 }
781 return r
782}
783
784/**
785 * check if node1 contains node2

Callers 3

getZLevelTopMethod · 0.85
containsFunction · 0.85
comparePositionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected