1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
Description: Prevents naming conflict between import and interface
Forwarded: no
Author: Israel Galadima <izzygaladima@gmail.com>
Last-Update: 2026-02-26
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -1,5 +1,4 @@
import { SmartBuffer } from './smartbuffer';
-import { Buffer } from 'buffer';
/**
* Error strings
@@ -94,6 +93,7 @@
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
}
+/*
interface Buffer {
readBigInt64BE(offset?: number): bigint;
readBigInt64LE(offset?: number): bigint;
@@ -105,6 +105,7 @@
writeBigUInt64BE(value: bigint, offset?: number): number;
writeBigUInt64LE(value: bigint, offset?: number): number;
}
+*/
/**
* Throws if Node.js version is too low to support bigint
@@ -115,7 +116,7 @@
}
if (typeof Buffer.prototype[bufferMethod] === 'undefined') {
- throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`);
+ throw new Error(`Platform does not support Buffer.prototype.${String(bufferMethod)}.`);
}
}
|