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

Method findParticles

external/.scrollLibs.js:16156–16165  ·  view source on GitHub ↗
(cuePath)

Source from the content-addressed store, hash-verified

16154 return JSON.stringify(this.asGrid, null, 2)
16155 }
16156 findParticles(cuePath) {
16157 // todo: can easily speed this up
16158 const map = {}
16159 if (!Array.isArray(cuePath)) cuePath = [cuePath]
16160 cuePath.forEach(path => (map[path] = true))
16161 return this.topDownArray.filter(particle => {
16162 if (map[particle._getCuePath(this)]) return true
16163 return false
16164 })
16165 }
16166 evalTemplateString(str) {
16167 const that = this
16168 return str.replace(/{([^\}]+)}/g, (match, path) => that.get(path) || "")

Callers 3

getParticlesMethod · 0.95
renameAllMethod · 0.95
macroExpandMethod · 0.80

Calls 3

forEachMethod · 0.80
_getCuePathMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected