@astral/validations 4.20.4 → 4.21.0
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/node/object/object.js
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
3
|
exports.object = void 0;
|
7
|
-
const
|
4
|
+
const utils_1 = require("@astral/utils");
|
8
5
|
const core_1 = require("../core");
|
9
6
|
const optional_1 = require("../optional");
|
10
7
|
const isEmptyErrors_1 = require("./isEmptyErrors");
|
@@ -36,7 +33,7 @@ const object = (schema) => (0, core_1.createGuard)((value, ctx, { typeErrorMessa
|
|
36
33
|
const context = (0, core_1.createContext)(ctx, value, {
|
37
34
|
lastSchemaValue: value,
|
38
35
|
});
|
39
|
-
if (!(0,
|
36
|
+
if (!(0, utils_1.isPlainObject)(value)) {
|
40
37
|
return context.createError(Object.assign(Object.assign({}, constants_1.OBJECT_TYPE_ERROR_INFO), { message: typeErrorMessage || constants_1.OBJECT_TYPE_ERROR_INFO.message }));
|
41
38
|
}
|
42
39
|
const generateErrorMap = () => {
|
@@ -8,12 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
exports.objectAsync = void 0;
|
16
|
-
const
|
13
|
+
const utils_1 = require("@astral/utils");
|
17
14
|
const core_1 = require("../../core");
|
18
15
|
const optional_1 = require("../../optional");
|
19
16
|
const isEmptyErrors_1 = require("../isEmptyErrors");
|
@@ -54,7 +51,7 @@ const objectAsync = (schema) => (0, core_1.createGuard)((value_1, ctx_1, _a) =>
|
|
54
51
|
const context = (0, core_1.createContext)(ctx, value, {
|
55
52
|
lastSchemaValue: value,
|
56
53
|
});
|
57
|
-
if (!(0,
|
54
|
+
if (!(0, utils_1.isPlainObject)(value)) {
|
58
55
|
return context.createError(Object.assign(Object.assign({}, constants_1.OBJECT_TYPE_ERROR_INFO), { message: typeErrorMessage || constants_1.OBJECT_TYPE_ERROR_INFO.message }));
|
59
56
|
}
|
60
57
|
const generateErrorMap = () => __awaiter(void 0, void 0, void 0, function* () {
|
package/object/object.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import isPlainObject from '
|
1
|
+
import { isPlainObject } from '@astral/utils';
|
2
2
|
import { callRule as callRecursiveRule, createContext, createErrorMap, createGuard, } from '../core';
|
3
3
|
import { optional } from '../optional';
|
4
4
|
import { isEmptyErrors } from './isEmptyErrors';
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import isPlainObject from '
|
10
|
+
import { isPlainObject } from '@astral/utils';
|
11
11
|
import { callAsyncRule as callAsyncRecursiveRule, createContext, createErrorMap, createGuard, } from '../../core';
|
12
12
|
import { optionalAsync } from '../../optional';
|
13
13
|
import { isEmptyErrors } from '../isEmptyErrors';
|
package/package.json
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "@astral/validations",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.21.0",
|
4
4
|
"browser": "./index.js",
|
5
5
|
"main": "./mode/index.js",
|
6
6
|
"dependencies": {
|
7
|
-
"
|
8
|
-
"utility-types": "^3.10.0"
|
9
|
-
"@astral/utils": "^1.1.0"
|
7
|
+
"@astral/utils": "^1.6.1",
|
8
|
+
"utility-types": "^3.10.0"
|
10
9
|
},
|
11
10
|
"author": "Astral.Soft",
|
12
11
|
"license": "MIT",
|