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

Method bitsRequired

external/.scrollLibs.js:18181–18187  ·  view source on GitHub ↗

* Returns the total information bits required to represent this particle and all its subparticles. * This is calculated as the sum of: * 1. Information bits of all atoms in this particle * 2. Information bits of all subparticles (recursive)

()

Source from the content-addressed store, hash-verified

18179 * 2. Information bits of all subparticles (recursive)
18180 */
18181 get bitsRequired() {
18182 // Get information bits for all atoms in this particle
18183 const atomBits = this.parsedAtoms.map(atom => atom.bitsRequired).reduce((sum, bits) => sum + bits, 0)
18184 // Recursively get information bits from all subparticles
18185 const subparticleBits = this.map(child => child.bitsRequired).reduce((sum, bits) => sum + bits, 0)
18186 return atomBits + subparticleBits
18187 }
18188 getSubparticleInstancesOfParserId(parserId) {
18189 return this.particleIndex[parserId] || []
18190 }

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected