bson 6.9.0 → 6.9.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 +2 -2
- package/src/utils/number_utils.ts +17 -8
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"vendor"
|
|
15
15
|
],
|
|
16
16
|
"types": "bson.d.ts",
|
|
17
|
-
"version": "6.9.
|
|
17
|
+
"version": "6.9.1",
|
|
18
18
|
"author": {
|
|
19
19
|
"name": "The MongoDB NodeJS Team",
|
|
20
20
|
"email": "dbx-node@mongodb.com"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"build:bundle": "rollup -c rollup.config.mjs",
|
|
113
113
|
"build": "npm run build:dts && npm run build:bundle",
|
|
114
114
|
"check:lint": "ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --ext '.js,.ts' --max-warnings=0 src test && npm run build:dts && npm run check:tsd",
|
|
115
|
-
"format": "eslint --ext '.js,.ts' src test --fix",
|
|
115
|
+
"format": "ESLINT_USE_FLAT_CONFIG=false eslint --ext '.js,.ts' src test --fix",
|
|
116
116
|
"check:coverage": "nyc --check-coverage npm run check:node",
|
|
117
117
|
"prepare": "node etc/prepare.js",
|
|
118
118
|
"release": "standard-version -i HISTORY.md"
|
|
@@ -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 */
|