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

Method checkValue

projects/JavaScript/proto/fbe.js:6027–6032  ·  view source on GitHub ↗

* Check the value range and its buffer offset bounds * @param {!Uint8Array} buffer Buffer * @param {!number} offset Offset * @param {!number} size Size * @param {!number} value Value * @param {!number} min Min value * @param {!number} max Max value

(buffer, offset, size, value, min, max)

Source from the content-addressed store, hash-verified

6025 * @param {!number} max Max value
6026 */
6027 static checkValue (buffer, offset, size, value, min, max) {
6028 this.checkOffset(buffer, offset, size)
6029 if ((value < min) || (value > max)) {
6030 throw new RangeError('Value is out of bounds!')
6031 }
6032 }
6033
6034 /**
6035 * Read UInt32 value from the model buffer

Callers 13

writeUInt32Method · 0.45
writeBoolMethod · 0.45
writeByteMethod · 0.45
writeInt8Method · 0.45
writeUInt8Method · 0.45
writeInt16Method · 0.45
writeUInt16Method · 0.45
writeInt32Method · 0.45
writeUInt32Method · 0.45
writeFloatMethod · 0.45
writeDoubleMethod · 0.45
writeUInt32Method · 0.45

Calls 1

checkOffsetMethod · 0.95

Tested by

no test coverage detected