File: prevent-declaration-conflict.diff

package info (click to toggle)
node-smart-buffer 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: makefile: 5
file content (28 lines) | stat: -rw-r--r-- 807 bytes parent folder | download
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
Prevents naming conflict between import and interface
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -94,6 +94,7 @@
   return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
 }
 
+/*
 interface Buffer {
   readBigInt64BE(offset?: number): bigint;
   readBigInt64LE(offset?: number): bigint;
@@ -105,6 +106,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 +117,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));
   }
 }