Skip to content

Commit 4ac6926

Browse files
committed
feat(buffer): add some new function bindings.
- readBig(U)Int64(BE/LE) - subarray(ToEnd) NOTE: Buffer.slice is now deprecated (since node 16.x LTS) Refs. ======= - https://nodejs.org/docs/latest-v16.x/api/buffer.html#bufslicestart-end
1 parent c198733 commit 4ac6926

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Buffer.res

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,24 @@ external readUintBE: (t, ~offset: int, ~length: int) => float = "readUintBE"
272272
@send
273273
external readUintLE: (t, ~offset: int, ~length: int) => float = "readUintLE"
274274

275+
@send
276+
external readBigInt64BE: (t, ~offset: int) => bigint = "readBigInt64BE"
277+
278+
@send
279+
external readBigInt64LE: (t, ~offset: int) => bigint = "readBigInt64LE"
280+
281+
@send
282+
external readBigUint64BE: (t, ~offset: int) => bigint = "readBigUInt64BE"
283+
284+
@send
285+
external readBigUint64LE: (t, ~offset: int) => bigint = "readBigUInt64LE"
286+
275287
@send external slice: (t, ~start: int, ~end_: int) => t = "slice"
276288
@send external sliceToEnd: (t, ~start: int) => t = "slice"
277289

290+
@send external subarray: (t, ~start: int, ~end_: int) => t = "subarray"
291+
@send external subarrayToEnd: (t, ~start: int) => t = "subarray"
292+
278293
@send external swap16: t => t = "swap16"
279294
@send external swap32: t => t = "swap32"
280295
@send external swap64: t => t = "swap64"

0 commit comments

Comments
 (0)