MCPcopy Create free account
hub / github.com/breck7/scroll / getAncestorByParser

Method getAncestorByParser

external/.scrollLibs.js:16736–16741  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

16734 return this.filter(subparticle => subparticle instanceof parser)
16735 }
16736 getAncestorByParser(parser) {
16737 if (this instanceof parser) return this
16738 if (this.isRoot()) return undefined
16739 const parent = this.parent
16740 return parent instanceof parser ? parent : parent.getAncestorByParser(parser)
16741 }
16742 getParticleByParser(parser) {
16743 return this.find(subparticle => subparticle instanceof parser)
16744 }

Callers

nothing calls this directly

Calls 1

isRootMethod · 0.95

Tested by

no test coverage detected