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

Method appendParticleAsync

external/.scrollLibs.js:15215–15228  ·  view source on GitHub ↗
(parentParticle, block)

Source from the content-addressed store, hash-verified

15213 return line.substr(0, firstBreak > -1 ? firstBreak : undefined)
15214 }
15215 async appendParticleAsync(parentParticle, block) {
15216 const index = parentParticle.length
15217 const parser = this._getMatchingParser(block, parentParticle, index)
15218 const { particleBreakSymbol } = parentParticle
15219 const lines = block.split(particleBreakSymbol)
15220 const subparticles = lines
15221 .slice(1)
15222 .map(line => line.substr(1))
15223 .join(particleBreakSymbol)
15224 const particle = new parser(undefined, lines[0], parentParticle, index)
15225 if (subparticles.length) await particle.appendFromStream(subparticles)
15226 await particle.wake()
15227 return particle
15228 }
15229 createParticle(parentParticle, block, index) {
15230 const rootParticle = parentParticle.root
15231 if (rootParticle.particleTransformers) {

Callers 1

_appendBlockAsyncMethod · 0.80

Calls 7

_getMatchingParserMethod · 0.95
splitMethod · 0.80
mapMethod · 0.80
sliceMethod · 0.80
appendFromStreamMethod · 0.80
wakeMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected