]> zoso.dev Git - buffer.git/commitdiff
Apply patches from #280 and #281 (#334)
authorDaniel Cousens <413395+dcousens@users.noreply.github.com>
Sat, 14 Oct 2023 01:40:22 +0000 (12:40 +1100)
committerGitHub <noreply@github.com>
Sat, 14 Oct 2023 01:40:22 +0000 (12:40 +1100)
Co-authored-by: Andreas Thomas <dev@chronark.com>
README.md
index.d.ts

index 95216531d60120cba3fb02df58d70400b2d29425..62b7d5d6c7edeebd30f5881ff06f6f3f2dbe60ab 100644 (file)
--- a/README.md
+++ b/README.md
@@ -376,8 +376,8 @@ Then, to run tests in Node.js, run:
 
 To test locally in a browser, you can run:
 
-    npm run test-browser-es5-local # For ES5 browsers that don't support ES6
-    npm run test-browser-es6-local # For ES6 compliant browsers
+    npm run test-browser-old-local # For ES5 browsers that don't support ES6
+    npm run test-browser-new-local # For ES6 compliant browsers
 
 This will print out a URL that you can then open in a browser to run the tests, using [airtap](https://www.npmjs.com/package/airtap).
 
index e461a2bdf35518aaaabb938384d985d0a594b28a..c276e4de5b88de1746cb4967eb2d6baae0b389d8 100644 (file)
@@ -17,45 +17,45 @@ export class Buffer extends Uint8Array {
     readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
     readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
     readUInt8(offset: number, noAssert?: boolean): number;
-    readUInt16LE(offset: number, noAssert?: boolean): number;
-    readUInt16BE(offset: number, noAssert?: boolean): number;
-    readUInt32LE(offset: number, noAssert?: boolean): number;
-    readUInt32BE(offset: number, noAssert?: boolean): number;
-    readBigUInt64LE(offset: number): BigInt;
-    readBigUInt64BE(offset: number): BigInt;
-    readInt8(offset: number, noAssert?: boolean): number;
-    readInt16LE(offset: number, noAssert?: boolean): number;
-    readInt16BE(offset: number, noAssert?: boolean): number;
-    readInt32LE(offset: number, noAssert?: boolean): number;
-    readInt32BE(offset: number, noAssert?: boolean): number;
-    readBigInt64LE(offset: number): BigInt;
-    readBigInt64BE(offset: number): BigInt;
-    readFloatLE(offset: number, noAssert?: boolean): number;
-    readFloatBE(offset: number, noAssert?: boolean): number;
-    readDoubleLE(offset: number, noAssert?: boolean): number;
-    readDoubleBE(offset: number, noAssert?: boolean): number;
+    readUInt16LE(offset?: number, noAssert?: boolean): number;
+    readUInt16BE(offset?: number, noAssert?: boolean): number;
+    readUInt32LE(offset?: number, noAssert?: boolean): number;
+    readUInt32BE(offset?: number, noAssert?: boolean): number;
+    readBigUInt64LE(offset?: number): BigInt;
+    readBigUInt64BE(offset?: number): BigInt;
+    readInt8(offset?: number, noAssert?: boolean): number;
+    readInt16LE(offset?: number, noAssert?: boolean): number;
+    readInt16BE(offset?: number, noAssert?: boolean): number;
+    readInt32LE(offset?: number, noAssert?: boolean): number;
+    readInt32BE(offset?: number, noAssert?: boolean): number;
+    readBigInt64LE(offset?: number): BigInt;
+    readBigInt64BE(offset?: number): BigInt;
+    readFloatLE(offset?: number, noAssert?: boolean): number;
+    readFloatBE(offset?: number, noAssert?: boolean): number;
+    readDoubleLE(offset?: number, noAssert?: boolean): number;
+    readDoubleBE(offset?: number, noAssert?: boolean): number;
     reverse(): this;
     swap16(): Buffer;
     swap32(): Buffer;
     swap64(): Buffer;
-    writeUInt8(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
-    writeBigUInt64LE(value: number, offset: number): BigInt;
-    writeBigUInt64BE(value: number, offset: number): BigInt;
-    writeInt8(value: number, offset: number, noAssert?: boolean): number;
-    writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
-    writeBigInt64LE(value: number, offset: number): BigInt;
-    writeBigInt64BE(value: number, offset: number): BigInt;
-    writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
-    writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
-    writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
-    writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+    writeUInt8(value: number, offset?: number, noAssert?: boolean): number;
+    writeUInt16LE(value: number, offset?: number, noAssert?: boolean): number;
+    writeUInt16BE(value: number, offset?: number, noAssert?: boolean): number;
+    writeUInt32LE(value: number, offset?: number, noAssert?: boolean): number;
+    writeUInt32BE(value: number, offset?: number, noAssert?: boolean): number;
+    writeBigUInt64LE(value: BigInt, offset?: number): number;
+    writeBigUInt64BE(value: BigInt, offset?: number): number;
+    writeInt8(value: number, offset?: number, noAssert?: boolean): number;
+    writeInt16LE(value: number, offset?: number, noAssert?: boolean): number;
+    writeInt16BE(value: number, offset?: number, noAssert?: boolean): number;
+    writeInt32LE(value: number, offset?: number, noAssert?: boolean): number;
+    writeInt32BE(value: number, offset?: number, noAssert?: boolean): number;
+    writeBigInt64LE(value: BigInt, offset?: number): number;
+    writeBigInt64BE(value: BigInt, offset?: number): number;
+    writeFloatLE(value: number, offset?: number, noAssert?: boolean): number;
+    writeFloatBE(value: number, offset?: number, noAssert?: boolean): number;
+    writeDoubleLE(value: number, offset?: number, noAssert?: boolean): number;
+    writeDoubleBE(value: number, offset?: number, noAssert?: boolean): number;
     fill(value: any, offset?: number, end?: number): this;
     indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
     lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;