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

Method setProperties

external/.scrollLibs.js:17132–17143  ·  view source on GitHub ↗
(propMap)

Source from the content-addressed store, hash-verified

17130 return this.touchParticle(prop).setContent(value)
17131 }
17132 setProperties(propMap) {
17133 const props = Object.keys(propMap)
17134 const values = Object.values(propMap)
17135 // todo: is there a built in particle method to do this?
17136 props.forEach((prop, index) => {
17137 const value = values[index]
17138 if (!value) return true
17139 if (this.get(prop) === value) return true
17140 this.touchParticle(prop).setContent(value)
17141 })
17142 return this
17143 }
17144 // todo: throw error if line contains a \n
17145 appendLine(line) {
17146 return this._insertBlock(line)

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
touchParticleMethod · 0.95
forEachMethod · 0.80
setContentMethod · 0.80

Tested by

no test coverage detected