@aeriajs/common 0.0.100 → 0.0.101
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/{checkForUndefined.d.ts → checkForEmptiness.d.ts} +1 -1
- package/dist/{checkForUndefined.js → checkForEmptiness.js} +3 -3
- package/dist/{checkForUndefined.mjs → checkForEmptiness.mjs} +1 -1
- package/dist/getMissingProperties.js +3 -3
- package/dist/getMissingProperties.mjs +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Property } from '@aeriajs/types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const checkForEmptiness: (property: Property, propName: string, what: Record<string, unknown>) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.checkForEmptiness = void 0;
|
|
4
|
+
const checkForEmptiness = (property, propName, what) => {
|
|
5
5
|
if (property.readOnly || property.isTimestamp) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
@@ -9,4 +9,4 @@ const checkForUndefined = (property, propName, what) => {
|
|
|
9
9
|
|| what[propName] === undefined
|
|
10
10
|
|| what[propName] === '';
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.checkForEmptiness = checkForEmptiness;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMissingProperties = void 0;
|
|
4
|
-
const
|
|
4
|
+
const checkForEmptiness_js_1 = require("./checkForEmptiness.js");
|
|
5
5
|
const evaluateCondition_js_1 = require("./evaluateCondition.js");
|
|
6
6
|
const getMissingProperties = (what, schema, required) => {
|
|
7
7
|
const missingProps = [];
|
|
8
8
|
if (Array.isArray(required)) {
|
|
9
9
|
for (const propName of required) {
|
|
10
|
-
const isMissing = (0,
|
|
10
|
+
const isMissing = (0, checkForEmptiness_js_1.checkForEmptiness)(schema.properties[propName], propName, what);
|
|
11
11
|
if (isMissing) {
|
|
12
12
|
missingProps.push(propName);
|
|
13
13
|
}
|
|
@@ -27,7 +27,7 @@ const getMissingProperties = (what, schema, required) => {
|
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const isMissing = (0,
|
|
30
|
+
const isMissing = (0, checkForEmptiness_js_1.checkForEmptiness)(schema.properties[propName], propName, what);
|
|
31
31
|
if (isMissing) {
|
|
32
32
|
missingProps.push(propName);
|
|
33
33
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import {
|
|
2
|
+
import { checkForEmptiness } from "./checkForEmptiness.mjs";
|
|
3
3
|
import { evaluateCondition } from "./evaluateCondition.mjs";
|
|
4
4
|
export const getMissingProperties = (what, schema, required) => {
|
|
5
5
|
const missingProps = [];
|
|
6
6
|
if (Array.isArray(required)) {
|
|
7
7
|
for (const propName of required) {
|
|
8
|
-
const isMissing =
|
|
8
|
+
const isMissing = checkForEmptiness(
|
|
9
9
|
schema.properties[propName],
|
|
10
10
|
propName,
|
|
11
11
|
what
|
|
@@ -28,7 +28,7 @@ export const getMissingProperties = (what, schema, required) => {
|
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const isMissing =
|
|
31
|
+
const isMissing = checkForEmptiness(
|
|
32
32
|
schema.properties[propName],
|
|
33
33
|
propName,
|
|
34
34
|
what
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./arraysIntersect.js"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./checkForEmptiness.js"), exports);
|
|
19
19
|
__exportStar(require("./deepClone.js"), exports);
|
|
20
20
|
__exportStar(require("./deepMerge.js"), exports);
|
|
21
21
|
__exportStar(require("./dynamicImport.js"), exports);
|
package/dist/index.mjs
CHANGED