MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / getItem

Method getItem

projects/JavaScript/proto/fbe.js:2403–2412  ·  view source on GitHub ↗

* Array index operator * @this {!FieldModelArray} * @param {!number} index Array index * @returns {!FieldModel} Base field model value

(index)

Source from the content-addressed store, hash-verified

2401 * @returns {!FieldModel} Base field model value
2402 */
2403 getItem (index) {
2404 console.assert(((this._buffer.offset + this.fbeOffset + this.fbeSize) <= this._buffer.size), 'Model is broken!')
2405 if (index >= this._size) {
2406 throw new Error('Index is out of bounds!')
2407 }
2408
2409 this._model.fbeOffset = this.fbeOffset
2410 this._model.fbeShift(index * this._model.fbeSize)
2411 return this._model
2412 }
2413
2414 /**
2415 * Check if the array is valid

Callers 2

getMethod · 0.95
setMethod · 0.95

Calls 1

fbeShiftMethod · 0.45

Tested by

no test coverage detected