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