@sprucelabs/schema 30.0.9 → 30.0.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.
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import AbstractEntity from '../AbstractEntity.js';
|
|
2
|
-
import DynamicSchemaEntityImplementation from '../DynamicSchemaEntityImplementation.js';
|
|
3
2
|
import SpruceError from '../errors/SpruceError.js';
|
|
4
3
|
import SchemaRegistry from '../singletons/SchemaRegistry.js';
|
|
5
|
-
import StaticSchemaEntity from '../StaticSchemaEntityImpl.js';
|
|
6
4
|
import { TemplateRenderAs, } from '../types/template.types.js';
|
|
7
5
|
import isIdWithVersion from '../utilities/isIdWithVersion.js';
|
|
8
6
|
import normalizeSchemaToIdWithVersion from '../utilities/normalizeSchemaToIdWithVersion.js';
|
|
@@ -255,9 +253,10 @@ class SchemaField extends AbstractField {
|
|
|
255
253
|
return errors;
|
|
256
254
|
}
|
|
257
255
|
Schema(schema, value) {
|
|
258
|
-
|
|
259
|
-
?
|
|
260
|
-
:
|
|
256
|
+
const Class = schema.dynamicFieldSignature
|
|
257
|
+
? require('../DynamicSchemaEntityImplementation.js').default
|
|
258
|
+
: require('../StaticSchemaEntityImpl.js').default;
|
|
259
|
+
return new Class(schema, value);
|
|
261
260
|
}
|
|
262
261
|
toValueType(value, options) {
|
|
263
262
|
const errors = this.validate(value, options);
|
|
@@ -4,10 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const AbstractEntity_1 = __importDefault(require("../AbstractEntity"));
|
|
7
|
-
const DynamicSchemaEntityImplementation_1 = __importDefault(require("../DynamicSchemaEntityImplementation"));
|
|
8
7
|
const SpruceError_1 = __importDefault(require("../errors/SpruceError"));
|
|
9
8
|
const SchemaRegistry_1 = __importDefault(require("../singletons/SchemaRegistry"));
|
|
10
|
-
const StaticSchemaEntityImpl_1 = __importDefault(require("../StaticSchemaEntityImpl"));
|
|
11
9
|
const template_types_1 = require("../types/template.types");
|
|
12
10
|
const isIdWithVersion_1 = __importDefault(require("../utilities/isIdWithVersion"));
|
|
13
11
|
const normalizeSchemaToIdWithVersion_1 = __importDefault(require("../utilities/normalizeSchemaToIdWithVersion"));
|
|
@@ -260,9 +258,10 @@ class SchemaField extends AbstractField_1.default {
|
|
|
260
258
|
return errors;
|
|
261
259
|
}
|
|
262
260
|
Schema(schema, value) {
|
|
263
|
-
|
|
264
|
-
?
|
|
265
|
-
:
|
|
261
|
+
const Class = schema.dynamicFieldSignature
|
|
262
|
+
? require('../DynamicSchemaEntityImplementation').default
|
|
263
|
+
: require('../StaticSchemaEntityImpl').default;
|
|
264
|
+
return new Class(schema, value);
|
|
266
265
|
}
|
|
267
266
|
toValueType(value, options) {
|
|
268
267
|
const errors = this.validate(value, options);
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"!build/__tests__",
|
|
9
9
|
"esm"
|
|
10
10
|
],
|
|
11
|
-
"version": "30.0.
|
|
11
|
+
"version": "30.0.11",
|
|
12
12
|
"main": "./build/index.js",
|
|
13
13
|
"types": "./build/index.d.ts",
|
|
14
14
|
"module": "./build/esm/index.js",
|
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@sprucelabs/error": "^6.0.
|
|
66
|
-
"@sprucelabs/test-utils": "^5.0.
|
|
65
|
+
"@sprucelabs/error": "^6.0.7",
|
|
66
|
+
"@sprucelabs/test-utils": "^5.0.8",
|
|
67
67
|
"email-validator": "^2.0.4",
|
|
68
68
|
"just-safe-get": "^4.2.0",
|
|
69
69
|
"just-safe-set": "^4.2.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@sprucelabs/esm-postbuild": "^6.0.
|
|
73
|
-
"@sprucelabs/jest-json-reporter": "^8.0.
|
|
74
|
-
"@sprucelabs/resolve-path-aliases": "^2.0.
|
|
72
|
+
"@sprucelabs/esm-postbuild": "^6.0.8",
|
|
73
|
+
"@sprucelabs/jest-json-reporter": "^8.0.6",
|
|
74
|
+
"@sprucelabs/resolve-path-aliases": "^2.0.10",
|
|
75
75
|
"@sprucelabs/semantic-release": "^5.0.1",
|
|
76
76
|
"@sprucelabs/test": "^9.0.6",
|
|
77
77
|
"chokidar-cli": "^3.0.0",
|