(content, circularCheckArray)
| 16545 | return this |
| 16546 | } |
| 16547 | _setSubparticles(content, circularCheckArray) { |
| 16548 | this._clearSubparticles() |
| 16549 | // todo: is this correct? seems like `new Particle("").length` should be 1, not 0. |
| 16550 | if (!content) return this |
| 16551 | // set from string |
| 16552 | if (typeof content === "string") { |
| 16553 | this._appendSubparticlesFromString(content) |
| 16554 | return this |
| 16555 | } |
| 16556 | // set from particle |
| 16557 | if (content instanceof Particle) { |
| 16558 | content.forEach(particle => this._insertBlock(particle.toString())) |
| 16559 | return this |
| 16560 | } |
| 16561 | // If we set from object, create an array of inserted objects to avoid circular loops |
| 16562 | if (!circularCheckArray) circularCheckArray = [content] |
| 16563 | return this._setFromObject(content, circularCheckArray) |
| 16564 | } |
| 16565 | _setFromObject(content, circularCheckArray) { |
| 16566 | for (let cue in content) { |
| 16567 | if (!content.hasOwnProperty(cue)) continue |
no test coverage detected