MCPcopy Create free account
hub / github.com/SplootCode/splootcode / greaterThan

Method greaterThan

packages/editor/src/context/selection.ts:949–965  ·  view source on GitHub ↗
(other: NodeCursor)

Source from the content-addressed store, hash-verified

947 }
948
949 greaterThan(other: NodeCursor): boolean {
950 const thisChain = this.getChainToRoot()
951 const otherChain = other.getChainToRoot()
952 let i = 0
953 while (i < thisChain.length && i < otherChain.length) {
954 if (thisChain[i] > otherChain[i]) {
955 return true
956 } else if (thisChain[i] < otherChain[i]) {
957 return false
958 }
959 i++
960 }
961 if (thisChain.length > otherChain.length) {
962 return thisChain[otherChain.length] >= 0
963 }
964 return false
965 }
966}

Callers 2

constructorMethod · 0.80

Calls 1

getChainToRootMethod · 0.95

Tested by

no test coverage detected