@aeriajs/common 0.0.130 → 0.0.131

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
@@ -14,5 +14,6 @@ export * from './http.js';
14
14
  export * from './isGranted.js';
15
15
  export * from './isReference.js';
16
16
  export * from './isRequired.js';
17
+ export * from './isValidCollection.js';
17
18
  export * from './pipe.js';
18
19
  export * from './serialize.js';
package/dist/index.js CHANGED
@@ -30,5 +30,6 @@ __exportStar(require("./http.js"), exports);
30
30
  __exportStar(require("./isGranted.js"), exports);
31
31
  __exportStar(require("./isReference.js"), exports);
32
32
  __exportStar(require("./isRequired.js"), exports);
33
+ __exportStar(require("./isValidCollection.js"), exports);
33
34
  __exportStar(require("./pipe.js"), exports);
34
35
  __exportStar(require("./serialize.js"), exports);
package/dist/index.mjs CHANGED
@@ -15,5 +15,6 @@ export * from "./http.mjs";
15
15
  export * from "./isGranted.mjs";
16
16
  export * from "./isReference.mjs";
17
17
  export * from "./isRequired.mjs";
18
+ export * from "./isValidCollection.mjs";
18
19
  export * from "./pipe.mjs";
19
20
  export * from "./serialize.mjs";
@@ -0,0 +1,3 @@
1
+ import type { Description, Collection } from '@aeriajs/types';
2
+ export declare const isValidDescription: (value: unknown) => value is Description;
3
+ export declare const isValidCollection: (value: unknown) => value is Collection;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidCollection = exports.isValidDescription = void 0;
4
+ const isValidDescription = (value) => {
5
+ return !!(value
6
+ && typeof value === 'object'
7
+ && '$id' in value
8
+ && 'properties' in value
9
+ && value.properties
10
+ && typeof value.$id === 'string'
11
+ && typeof value.properties === 'object');
12
+ };
13
+ exports.isValidDescription = isValidDescription;
14
+ const isValidCollection = (value) => {
15
+ return !!(value
16
+ && typeof value === 'object'
17
+ && 'description' in value
18
+ && (0, exports.isValidDescription)(value.description));
19
+ };
20
+ exports.isValidCollection = isValidCollection;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ export const isValidDescription = (value) => {
3
+ return !!(value && typeof value === "object" && "$id" in value && "properties" in value && value.properties && typeof value.$id === "string" && typeof value.properties === "object");
4
+ };
5
+ export const isValidCollection = (value) => {
6
+ return !!(value && typeof value === "object" && "description" in value && isValidDescription(value.description));
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/common",
3
- "version": "0.0.130",
3
+ "version": "0.0.131",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "bson": "^6.5.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@aeriajs/types": "^0.0.112",
34
+ "@aeriajs/types": "^0.0.113",
35
35
  "bson": "^6.5.0"
36
36
  },
37
37
  "scripts": {