hadron-type-checker 7.5.9 → 7.5.11
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/type-checker.d.ts +2 -1
- package/dist/type-checker.d.ts.map +1 -1
- package/dist/type-checker.js +4 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/type-checker.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default, UUID_REGEX, uuidHexToString, reverseJavaUUIDBytes, reverseCSharpUUIDBytes, convertBinaryUUID, UUID_TYPES, isUUIDType, type UUIDType, type BSONTypeTag, getBsonType, type TypeCastMap, type TypeCastTypes, } from './type-checker';
|
|
1
|
+
export { default, UUID_REGEX, uuidHexToString, reverseJavaUUIDBytes, reverseCSharpUUIDBytes, convertBinaryUUID, UUID_TYPES, isUUIDType, type UUIDType, type BSONTypeTag, getBsonType, isBsonValue, type TypeCastMap, type TypeCastTypes, } from './type-checker';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,WAAW,EACX,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getBsonType = exports.isUUIDType = exports.UUID_TYPES = exports.convertBinaryUUID = exports.reverseCSharpUUIDBytes = exports.reverseJavaUUIDBytes = exports.uuidHexToString = exports.UUID_REGEX = exports.default = void 0;
|
|
6
|
+
exports.isBsonValue = exports.getBsonType = exports.isUUIDType = exports.UUID_TYPES = exports.convertBinaryUUID = exports.reverseCSharpUUIDBytes = exports.reverseJavaUUIDBytes = exports.uuidHexToString = exports.UUID_REGEX = exports.default = void 0;
|
|
7
7
|
var type_checker_1 = require("./type-checker");
|
|
8
8
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(type_checker_1).default; } });
|
|
9
9
|
Object.defineProperty(exports, "UUID_REGEX", { enumerable: true, get: function () { return type_checker_1.UUID_REGEX; } });
|
|
@@ -14,3 +14,4 @@ Object.defineProperty(exports, "convertBinaryUUID", { enumerable: true, get: fun
|
|
|
14
14
|
Object.defineProperty(exports, "UUID_TYPES", { enumerable: true, get: function () { return type_checker_1.UUID_TYPES; } });
|
|
15
15
|
Object.defineProperty(exports, "isUUIDType", { enumerable: true, get: function () { return type_checker_1.isUUIDType; } });
|
|
16
16
|
Object.defineProperty(exports, "getBsonType", { enumerable: true, get: function () { return type_checker_1.getBsonType; } });
|
|
17
|
+
Object.defineProperty(exports, "isBsonValue", { enumerable: true, get: function () { return type_checker_1.isBsonValue; } });
|
package/dist/type-checker.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ObjectId, MinKey, MaxKey, Long, Double, Int32, Decimal128, Binary, BSONRegExp, Code, BSONSymbol, Timestamp, bsonType, type BSONTypeTag } from 'bson';
|
|
1
|
+
import { ObjectId, MinKey, MaxKey, Long, Double, Int32, Decimal128, Binary, BSONRegExp, Code, BSONSymbol, Timestamp, bsonType, type BSONTypeTag, type BSONValue } from 'bson';
|
|
2
2
|
export { bsonType, type BSONTypeTag };
|
|
3
3
|
export declare function getBsonType(value: any): BSONTypeTag | undefined;
|
|
4
|
+
export declare function isBsonValue(value: unknown): value is BSONValue;
|
|
4
5
|
export type TypeCastMap = {
|
|
5
6
|
Array: unknown[];
|
|
6
7
|
Binary: Binary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-checker.d.ts","sourceRoot":"","sources":["../src/type-checker.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACN,UAAU,EACV,IAAI,EACJ,UAAU,EACV,SAAS,EAET,QAAQ,EACR,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"type-checker.d.ts","sourceRoot":"","sources":["../src/type-checker.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACN,UAAU,EACV,IAAI,EACJ,UAAU,EACV,SAAS,EAET,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,CAAC;AACtC,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,GAAG,SAAS,CAE/D;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,E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AK,MAAM,KAAG,MAUpD,CAAC;AA0EF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,YAAY,MAAM,KACjB,MA4BF,CAAC;AAoKF;;GAEG;AACH,cAAM,WAAW;IACf;;OAEG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EACzC,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,GACN,CAAC,SAAS,aAAa,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAW/C;;;;;OAKG;IACH,IAAI,CACF,MAAM,EAAE,OAAO,EACf,kBAAkB,CAAC,EACf,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GACrB,aAAa;IAoChB;;OAEG;IACH,aAAa,CAAC,oBAAoB,UAAQ,GAAG,aAAa,EAAE;CAM7D;;AAED,wBAAiC"}
|
package/dist/type-checker.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertBinaryUUID = exports.reverseCSharpUUIDBytes = exports.reverseJavaUUIDBytes = exports.uuidHexToString = exports.UUID_REGEX = exports.UUID_TYPES = exports.bsonType = void 0;
|
|
4
4
|
exports.getBsonType = getBsonType;
|
|
5
|
+
exports.isBsonValue = isBsonValue;
|
|
5
6
|
exports.isUUIDType = isUUIDType;
|
|
6
7
|
const lodash_1 = require("lodash");
|
|
7
8
|
const bson_1 = require("bson");
|
|
@@ -9,6 +10,9 @@ Object.defineProperty(exports, "bsonType", { enumerable: true, get: function ()
|
|
|
9
10
|
function getBsonType(value) {
|
|
10
11
|
return value?.[bson_1.bsonType];
|
|
11
12
|
}
|
|
13
|
+
function isBsonValue(value) {
|
|
14
|
+
return getBsonType(value) !== undefined;
|
|
15
|
+
}
|
|
12
16
|
/**
|
|
13
17
|
* The object string.
|
|
14
18
|
*/
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"email": "compass@mongodb.com"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/mongodb-js/compass",
|
|
13
|
-
"version": "7.5.
|
|
13
|
+
"version": "7.5.11",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "https://github.com/mongodb-js/compass.git"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"lodash": "^4.18.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@mongodb-js/eslint-config-compass": "^1.4.
|
|
53
|
+
"@mongodb-js/eslint-config-compass": "^1.4.28",
|
|
54
54
|
"@mongodb-js/mocha-config-compass": "^1.8.1",
|
|
55
55
|
"@mongodb-js/prettier-config-compass": "^1.2.9",
|
|
56
56
|
"@mongodb-js/tsconfig-compass": "^1.3.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"nyc": "^15.1.0",
|
|
63
63
|
"typescript": "^6.0.3"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ef7b44ec5ff794f83d167daa4146b0bdcab5e0a3"
|
|
66
66
|
}
|
package/src/index.ts
CHANGED
package/src/type-checker.ts
CHANGED
|
@@ -25,12 +25,16 @@ import {
|
|
|
25
25
|
UUID,
|
|
26
26
|
bsonType,
|
|
27
27
|
type BSONTypeTag,
|
|
28
|
+
type BSONValue,
|
|
28
29
|
} from 'bson';
|
|
29
30
|
|
|
30
31
|
export { bsonType, type BSONTypeTag };
|
|
31
32
|
export function getBsonType(value: any): BSONTypeTag | undefined {
|
|
32
33
|
return value?.[bsonType];
|
|
33
34
|
}
|
|
35
|
+
export function isBsonValue(value: unknown): value is BSONValue {
|
|
36
|
+
return getBsonType(value) !== undefined;
|
|
37
|
+
}
|
|
34
38
|
|
|
35
39
|
export type TypeCastMap = {
|
|
36
40
|
Array: unknown[];
|