@sprucelabs/schema 31.1.1 → 31.1.3
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.
|
@@ -134,8 +134,8 @@ class StaticSchemaEntityImpl extends AbstractEntity_1.default {
|
|
|
134
134
|
: 'INVALID_PARAMETER',
|
|
135
135
|
name,
|
|
136
136
|
friendlyMessage: !this.values[name]
|
|
137
|
-
?
|
|
138
|
-
:
|
|
137
|
+
? `${field.label ? `'${field.label}'` : 'This'} is required!`
|
|
138
|
+
: `${field.label ? `'${field.label}'` : 'You'} must ${field.label ? 'have' : 'select'} at least ${field.minArrayLength} value${field.minArrayLength === 1 ? '' : 's'}. I found ${valueAsArray.length}!`,
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
else {
|
|
@@ -85,7 +85,7 @@ class StaticSchemaEntityImpl extends AbstractEntity {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
this.getNamedFields(options).forEach((namedField) => {
|
|
88
|
-
var _a, _b
|
|
88
|
+
var _a, _b;
|
|
89
89
|
const { name, field } = namedField;
|
|
90
90
|
let valueAsArray = normalizeValueToArray(this.values[name]);
|
|
91
91
|
if (field.isRequired &&
|
|
@@ -98,12 +98,12 @@ class StaticSchemaEntityImpl extends AbstractEntity {
|
|
|
98
98
|
: 'INVALID_PARAMETER',
|
|
99
99
|
name,
|
|
100
100
|
friendlyMessage: !this.values[name]
|
|
101
|
-
?
|
|
102
|
-
: `'${
|
|
101
|
+
? `${field.label ? `'${field.label}'` : 'This'} is required!`
|
|
102
|
+
: `${field.label ? `'${field.label}'` : 'You'} must ${field.label ? 'have' : 'select'} at least ${field.minArrayLength} value${field.minArrayLength === 1 ? '' : 's'}. I found ${valueAsArray.length}!`,
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
|
-
if ((!field.isArray || ((
|
|
106
|
+
if ((!field.isArray || ((_b = field.minArrayLength) !== null && _b !== void 0 ? _b : 0) > 0) &&
|
|
107
107
|
valueAsArray.length === 0) {
|
|
108
108
|
valueAsArray = [undefined];
|
|
109
109
|
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"!build/__tests__",
|
|
9
9
|
"esm"
|
|
10
10
|
],
|
|
11
|
-
"version": "31.1.
|
|
11
|
+
"version": "31.1.3",
|
|
12
12
|
"main": "./build/index.js",
|
|
13
13
|
"types": "./build/index.d.ts",
|
|
14
14
|
"module": "./build/esm/index.js",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@sprucelabs/error": "^6.0.
|
|
62
|
-
"@sprucelabs/test-utils": "^5.5.
|
|
61
|
+
"@sprucelabs/error": "^6.0.603",
|
|
62
|
+
"@sprucelabs/test-utils": "^5.5.51",
|
|
63
63
|
"email-validator": "^2.0.4",
|
|
64
64
|
"just-safe-get": "^4.2.0",
|
|
65
65
|
"just-safe-set": "^4.2.1"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@sprucelabs/jest-json-reporter": "^8.0.603",
|
|
70
70
|
"@sprucelabs/resolve-path-aliases": "^2.0.542",
|
|
71
71
|
"@sprucelabs/semantic-release": "^5.0.2",
|
|
72
|
-
"@sprucelabs/test": "^9.0.
|
|
72
|
+
"@sprucelabs/test": "^9.0.82",
|
|
73
73
|
"chokidar-cli": "^3.0.0",
|
|
74
74
|
"eslint": "^9.27.0",
|
|
75
75
|
"eslint-config-spruce": "^11.2.26",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"jest-circus": "^29.7.0",
|
|
78
78
|
"prettier": "^3.5.3",
|
|
79
79
|
"ts-node": "^10.9.2",
|
|
80
|
-
"tsc-watch": "^
|
|
80
|
+
"tsc-watch": "^7.0.0",
|
|
81
81
|
"tsconfig-paths": "^4.2.0",
|
|
82
82
|
"typescript": "^5.8.3"
|
|
83
83
|
},
|