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

Method _getParticlesByGlobPath

external/.scrollLibs.js:16235–16249  ·  view source on GitHub ↗
(globPath)

Source from the content-addressed store, hash-verified

16233 return this._getParticlesByGlobPath(query)
16234 }
16235 _getParticlesByGlobPath(globPath) {
16236 const edgeSymbol = this.edgeSymbol
16237 if (!globPath.includes(edgeSymbol)) {
16238 if (globPath === "*") return this.getSubparticles()
16239 return this.filter(particle => particle.cue === globPath)
16240 }
16241 const parts = globPath.split(edgeSymbol)
16242 const current = parts.shift()
16243 const rest = parts.join(edgeSymbol)
16244 const matchingParticles = current === "*" ? this.getSubparticles() : this.filter(subparticle => subparticle.cue === current)
16245 return [].concat.apply(
16246 [],
16247 matchingParticles.map(particle => particle._getParticlesByGlobPath(rest))
16248 )
16249 }
16250 _getParticleByPath(cuePath) {
16251 const edgeSymbol = this.edgeSymbol
16252 if (!cuePath.includes(edgeSymbol)) {

Callers 1

Calls 6

getSubparticlesMethod · 0.95
filterMethod · 0.95
splitMethod · 0.80
shiftMethod · 0.80
mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected