MCPcopy Index your code
hub / github.com/nodejs/node / writeU_Int8

Function writeU_Int8

lib/internal/buffer.js:739–751  ·  view source on GitHub ↗
(buf, value, offset, min, max)

Source from the content-addressed store, hash-verified

737}
738
739function writeU_Int8(buf, value, offset, min, max) {
740 value = +value;
741 // `checkInt()` can not be used here because it checks two entries.
742 validateNumber(offset, 'offset');
743 if (value > max || value < min) {
744 throw new ERR_OUT_OF_RANGE('value', `>= ${min} and <= ${max}`, value);
745 }
746 if (buf[offset] === undefined)
747 boundsError(offset, buf.length - 1);
748
749 buf[offset] = value;
750 return offset + 1;
751}
752
753function writeUInt8(value, offset = 0) {
754 return writeU_Int8(this, value, offset, 0, 0xff);

Callers 6

writeUIntLEFunction · 0.85
writeUInt8Function · 0.85
writeUIntBEFunction · 0.85
writeIntLEFunction · 0.85
writeInt8Function · 0.85
writeIntBEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected