buffer: alias UInt ➡️ Uint in buffer methods · nodejs/node@9d07217 · GitHub
Skip to content

Commit 9d07217

Browse files
committed
buffer: alias UInt ➡️ Uint in buffer methods
It’s *so* hard to remember that it’s `UintXArray` but not `(write|read)UintX`. Let’s fix that by just providing aliases. 😊 PR-URL: #34729 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 987e0cb commit 9d07217

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

doc/api/buffer.md

Lines changed: 42 additions & 0 deletions

lib/internal/buffer.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,13 @@ function addBufferPrototypeMethods(proto) {
961961
proto.readUIntBE = readUIntBE;
962962
proto.readUInt32BE = readUInt32BE;
963963
proto.readUInt16BE = readUInt16BE;
964+
proto.readUintLE = readUIntLE;
965+
proto.readUint32LE = readUInt32LE;
966+
proto.readUint16LE = readUInt16LE;
967+
proto.readUint8 = readUInt8;
968+
proto.readUintBE = readUIntBE;
969+
proto.readUint32BE = readUInt32BE;
970+
proto.readUint16BE = readUInt16BE;
964971
proto.readIntLE = readIntLE;
965972
proto.readInt32LE = readInt32LE;
966973
proto.readInt16LE = readInt16LE;
@@ -976,6 +983,13 @@ function addBufferPrototypeMethods(proto) {
976983
proto.writeUIntBE = writeUIntBE;
977984
proto.writeUInt32BE = writeUInt32BE;
978985
proto.writeUInt16BE = writeUInt16BE;
986+
proto.writeUintLE = writeUIntLE;
987+
proto.writeUint32LE = writeUInt32LE;
988+
proto.writeUint16LE = writeUInt16LE;
989+
proto.writeUint8 = writeUInt8;
990+
proto.writeUintBE = writeUIntBE;
991+
proto.writeUint32BE = writeUInt32BE;
992+
proto.writeUint16BE = writeUInt16BE;
979993
proto.writeIntLE = writeIntLE;
980994
proto.writeInt32LE = writeInt32LE;
981995
proto.writeInt16LE = writeInt16LE;

test/parallel/test-buffer-writeuint.js

Lines changed: 9 additions & 0 deletions

0 commit comments

Comments
 (0)