bson 6.6.0 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bson.bundle.js +9 -3
- package/lib/bson.bundle.js.map +1 -1
- package/lib/bson.cjs +9 -3
- package/lib/bson.cjs.map +1 -1
- package/lib/bson.mjs +9 -3
- package/lib/bson.mjs.map +1 -1
- package/lib/bson.rn.cjs +9 -3
- package/lib/bson.rn.cjs.map +1 -1
- package/package.json +1 -1
- package/src/utils/number_utils.ts +17 -8
package/package.json
CHANGED
|
@@ -79,14 +79,23 @@ export const NumberUtils: NumberUtils = {
|
|
|
79
79
|
|
|
80
80
|
/** Reads a little-endian 64-bit integer from source */
|
|
81
81
|
getBigInt64LE(source: Uint8Array, offset: number): bigint {
|
|
82
|
-
|
|
83
|
-
const hi =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
// eslint-disable-next-line no-restricted-globals
|
|
83
|
+
const hi = BigInt(
|
|
84
|
+
source[offset + 4] +
|
|
85
|
+
source[offset + 5] * 256 +
|
|
86
|
+
source[offset + 6] * 65536 +
|
|
87
|
+
(source[offset + 7] << 24)
|
|
88
|
+
); // Overflow
|
|
89
|
+
|
|
90
|
+
// eslint-disable-next-line no-restricted-globals
|
|
91
|
+
const lo = BigInt(
|
|
92
|
+
source[offset] +
|
|
93
|
+
source[offset + 1] * 256 +
|
|
94
|
+
source[offset + 2] * 65536 +
|
|
95
|
+
source[offset + 3] * 16777216
|
|
96
|
+
);
|
|
97
|
+
// eslint-disable-next-line no-restricted-globals
|
|
98
|
+
return (hi << BigInt(32)) + lo;
|
|
90
99
|
},
|
|
91
100
|
|
|
92
101
|
/** Reads a little-endian 64-bit float from source */
|