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

Method _toObjectTuple

external/.scrollLibs.js:15745–15754  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15743 return `${indent}<${tag}>${this._getXmlContent(indentCount)}</${tag}>${indentCount === -1 ? "" : "\n"}`
15744 }
15745 _toObjectTuple() {
15746 const content = this.content
15747 const length = this.length
15748 const hasSubparticlesNoContent = content === undefined && length
15749 const hasContentAndHasSubparticles = content !== undefined && length
15750 // If the particle has a content and a subparticle return it as a string, as
15751 // Javascript object values can't be both a leaf and a particle.
15752 const tupleValue = hasSubparticlesNoContent ? this.toObject() : hasContentAndHasSubparticles ? this.contentWithSubparticles : content
15753 return [this.cue, tupleValue]
15754 }
15755 _indexOfParticle(needleParticle) {
15756 let result = -1
15757 this.find((particle, index) => {

Callers 1

_toObjectMethod · 0.80

Calls 1

toObjectMethod · 0.95

Tested by

no test coverage detected