Skip to content

Commit 2ab33c5

Browse files
addaleaxrichardlau
authored andcommitted
buffer: also alias BigUInt methods
These were overlooked in 5864fca because of the extra `Big` in the name. :) Refs: #34729 PR-URL: #34960 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 9aba579 commit 2ab33c5

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

doc/api/buffer.md

+16
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,10 @@ values.
13791379
added:
13801380
- v12.0.0
13811381
- v10.20.0
1382+
changes:
1383+
- version: REPLACEME
1384+
pr-url: https://github.com/nodejs/node/pull/34960
1385+
description: This function is also available as `buf.readBigUint64BE()`.
13821386
-->
13831387

13841388
* `offset` {integer} Number of bytes to skip before starting to read. Must
@@ -1400,6 +1404,10 @@ console.log(buf.readBigUInt64BE(0));
14001404
added:
14011405
- v12.0.0
14021406
- v10.20.0
1407+
changes:
1408+
- version: REPLACEME
1409+
pr-url: https://github.com/nodejs/node/pull/34960
1410+
description: This function is also available as `buf.readBigUint64LE()`.
14031411
-->
14041412

14051413
* `offset` {integer} Number of bytes to skip before starting to read. Must
@@ -2304,6 +2312,10 @@ console.log(buf);
23042312
added:
23052313
- v12.0.0
23062314
- v10.20.0
2315+
changes:
2316+
- version: REPLACEME
2317+
pr-url: https://github.com/nodejs/node/pull/34960
2318+
description: This function is also available as `buf.writeBigUint64BE()`.
23072319
-->
23082320

23092321
* `value` {bigint} Number to be written to `buf`.
@@ -2327,6 +2339,10 @@ console.log(buf);
23272339
added:
23282340
- v12.0.0
23292341
- v10.20.0
2342+
changes:
2343+
- version: REPLACEME
2344+
pr-url: https://github.com/nodejs/node/pull/34960
2345+
description: This function is also available as `buf.writeBigUint64LE()`.
23302346
-->
23312347

23322348
* `value` {bigint} Number to be written to `buf`.

lib/internal/buffer.js

+4
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,14 @@ class FastBuffer extends Uint8Array {}
951951
function addBufferPrototypeMethods(proto) {
952952
proto.readBigUInt64LE = readBigUInt64LE,
953953
proto.readBigUInt64BE = readBigUInt64BE,
954+
proto.readBigUint64LE = readBigUInt64LE,
955+
proto.readBigUint64BE = readBigUInt64BE,
954956
proto.readBigInt64LE = readBigInt64LE,
955957
proto.readBigInt64BE = readBigInt64BE,
956958
proto.writeBigUInt64LE = writeBigUInt64LE,
957959
proto.writeBigUInt64BE = writeBigUInt64BE,
960+
proto.writeBigUint64LE = writeBigUInt64LE,
961+
proto.writeBigUint64BE = writeBigUInt64BE,
958962
proto.writeBigInt64LE = writeBigInt64LE,
959963
proto.writeBigInt64BE = writeBigInt64BE,
960964

test/parallel/test-buffer-writeuint.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ const assert = require('assert');
222222
}
223223

224224
for (const fn of [
225-
'UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', 'UIntLE', 'UIntBE'
225+
'UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', 'UIntLE', 'UIntBE',
226+
'BigUInt64LE', 'BigUInt64BE',
226227
]) {
227228
const p = Buffer.prototype;
228229
const lowerFn = fn.replace(/UInt/, 'Uint');

0 commit comments

Comments
 (0)