@linktic/validator 1.1.1 → 1.1.2
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.cjs +8 -8
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -164,14 +164,14 @@ var FieldValidator = class {
|
|
|
164
164
|
}
|
|
165
165
|
arrayOf(itemType, message) {
|
|
166
166
|
if (this.shouldSkip()) return this;
|
|
167
|
-
if (!this.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
if (!Array.isArray(this.value)) {
|
|
168
|
+
this.addError(
|
|
169
|
+
"array",
|
|
170
|
+
ValidationMessages.array(this.fieldLabel)
|
|
171
|
+
);
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
if (this.value.length > 0) {
|
|
175
175
|
const typeLabels = {
|
|
176
176
|
string: "textos",
|
|
177
177
|
number: "n\xFAmeros",
|
package/dist/index.js
CHANGED
|
@@ -163,14 +163,14 @@ var FieldValidator = class {
|
|
|
163
163
|
}
|
|
164
164
|
arrayOf(itemType, message) {
|
|
165
165
|
if (this.shouldSkip()) return this;
|
|
166
|
-
if (!this.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
166
|
+
if (!Array.isArray(this.value)) {
|
|
167
|
+
this.addError(
|
|
168
|
+
"array",
|
|
169
|
+
ValidationMessages.array(this.fieldLabel)
|
|
170
|
+
);
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
if (this.value.length > 0) {
|
|
174
174
|
const typeLabels = {
|
|
175
175
|
string: "textos",
|
|
176
176
|
number: "n\xFAmeros",
|
package/package.json
CHANGED