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

Method fromShape

external/.scrollLibs.js:17779–17788  ·  view source on GitHub ↗
(shapeArr, rootParticle = new Particle())

Source from the content-addressed store, hash-verified

17777 return obj
17778 }
17779 static fromShape(shapeArr, rootParticle = new Particle()) {
17780 const part = shapeArr.shift()
17781 if (part !== undefined) {
17782 for (let index = 0; index < part; index++) {
17783 rootParticle.appendLine(index.toString())
17784 }
17785 }
17786 if (shapeArr.length) rootParticle.forEach(particle => Particle.fromShape(shapeArr.slice(0), particle))
17787 return rootParticle
17788 }
17789 static fromDataTable(table) {
17790 const header = table.shift()
17791 return new Particle(table.map(row => this._zipObject(header, row)))

Callers

nothing calls this directly

Calls 5

shiftMethod · 0.80
appendLineMethod · 0.80
forEachMethod · 0.80
sliceMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected