@aeriajs/common 0.0.34 → 0.0.35

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 CHANGED
@@ -13,6 +13,7 @@ export * from './getMissingProperties.js';
13
13
  export * from './getReferenceProperty.js';
14
14
  export * from './getValueFromPath.js';
15
15
  export * from './http.js';
16
+ export * from './isObjectId.js';
16
17
  export * from './isReference.js';
17
18
  export * from './isRequired.js';
18
19
  export * from './pipe.js';
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ __exportStar(require("./getMissingProperties.js"), exports);
29
29
  __exportStar(require("./getReferenceProperty.js"), exports);
30
30
  __exportStar(require("./getValueFromPath.js"), exports);
31
31
  __exportStar(require("./http.js"), exports);
32
+ __exportStar(require("./isObjectId.js"), exports);
32
33
  __exportStar(require("./isReference.js"), exports);
33
34
  __exportStar(require("./isRequired.js"), exports);
34
35
  __exportStar(require("./pipe.js"), exports);
package/dist/index.mjs CHANGED
@@ -14,6 +14,7 @@ export * from "./getMissingProperties.mjs";
14
14
  export * from "./getReferenceProperty.mjs";
15
15
  export * from "./getValueFromPath.mjs";
16
16
  export * from "./http.mjs";
17
+ export * from "./isObjectId.mjs";
17
18
  export * from "./isReference.mjs";
18
19
  export * from "./isRequired.mjs";
19
20
  export * from "./pipe.mjs";
@@ -0,0 +1 @@
1
+ export declare const isObjectId: (value: any) => value is ObjectId;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isObjectId = void 0;
4
+ const isObjectId = (value) => {
5
+ // we use this comparation instead of `value instanceof ObjectId` because
6
+ // the latter is prone to errors when `mongodb` dependency is duplicated
7
+ // -- when ./node_modules/mongodb and ../node_modules/mongodb are both
8
+ // present and the bundler doesn't handle this correctly
9
+ return value._bsontype === 'ObjectId';
10
+ };
11
+ exports.isObjectId = isObjectId;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ export const isObjectId = (value) => {
3
+ return value._bsontype === "ObjectId";
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/common",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,11 +27,11 @@
27
27
  }
28
28
  },
29
29
  "devDependencies": {
30
- "@aeriajs/types": "^0.0.31",
30
+ "@aeriajs/types": "^0.0.32",
31
31
  "bson": "^6.5.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@aeriajs/types": "^0.0.31",
34
+ "@aeriajs/types": "^0.0.32",
35
35
  "bson": "^6.5.0"
36
36
  },
37
37
  "scripts": {