hadron-type-checker 7.2.2 → 7.2.3
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/.prettierrc.json +1 -0
- package/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/type-checker.js +7 -4
package/.prettierrc.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"@mongodb-js/prettier-config-compass"
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"email": "compass@mongodb.com"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://github.com/mongodb-js/compass",
|
|
10
|
-
"version": "7.2.
|
|
10
|
+
"version": "7.2.3",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "https://github.com/mongodb-js/compass.git"
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"test-ci": "npm run test"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"bson": "^6.
|
|
30
|
+
"bson": "^6.8.0",
|
|
31
31
|
"lodash": "^4.17.21"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"@mongodb-js/eslint-config-compass": "^1.1.7",
|
|
34
35
|
"chai": "^4.2.0",
|
|
35
36
|
"depcheck": "^1.4.1",
|
|
36
37
|
"eslint": "^7.25.0",
|
|
37
|
-
"eslint-config-mongodb-js": "^5.0.3",
|
|
38
38
|
"mocha": "^10.2.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b35fb1b3fc1c73d009c0d2601fe1c3a4f699de29"
|
|
41
41
|
}
|
package/src/type-checker.js
CHANGED
|
@@ -24,7 +24,6 @@ const {
|
|
|
24
24
|
Code,
|
|
25
25
|
BSONSymbol,
|
|
26
26
|
Timestamp,
|
|
27
|
-
Map
|
|
28
27
|
} = require('bson');
|
|
29
28
|
/**
|
|
30
29
|
* The object string.
|
|
@@ -177,7 +176,9 @@ const toInt64 = (object) => {
|
|
|
177
176
|
|
|
178
177
|
return Long.fromString(object);
|
|
179
178
|
}
|
|
180
|
-
throw new Error(
|
|
179
|
+
throw new Error(
|
|
180
|
+
`Value ${object.toString()} is outside the valid Int64 range`
|
|
181
|
+
);
|
|
181
182
|
};
|
|
182
183
|
|
|
183
184
|
const toDouble = (object) => {
|
|
@@ -209,7 +210,9 @@ const toObjectID = (object) => {
|
|
|
209
210
|
};
|
|
210
211
|
|
|
211
212
|
const toBinary = (object) => {
|
|
212
|
-
const buffer = ArrayBuffer.isView(object)
|
|
213
|
+
const buffer = ArrayBuffer.isView(object)
|
|
214
|
+
? Buffer.from(object)
|
|
215
|
+
: Buffer.from(toString(object), 'utf8');
|
|
213
216
|
return new Binary(buffer, Binary.SUBTYPE_DEFAULT);
|
|
214
217
|
};
|
|
215
218
|
|
|
@@ -252,7 +255,7 @@ const CASTERS = {
|
|
|
252
255
|
String: toString,
|
|
253
256
|
BSONSymbol: toSymbol,
|
|
254
257
|
Timestamp: toTimestamp,
|
|
255
|
-
Undefined: toUndefined
|
|
258
|
+
Undefined: toUndefined,
|
|
256
259
|
};
|
|
257
260
|
|
|
258
261
|
/**
|