@coxy/react-validator 2.0.5 → 2.0.6
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/validator-field.js
CHANGED
|
@@ -14,7 +14,7 @@ class ValidationFieldWrapper extends react_1.Component {
|
|
|
14
14
|
}
|
|
15
15
|
validate() {
|
|
16
16
|
const props = this.props;
|
|
17
|
-
const customError = props.customErrors.find((item) => item.id === props.id);
|
|
17
|
+
const customError = (props.customErrors || []).find((item) => item.id === props.id);
|
|
18
18
|
if (customError) {
|
|
19
19
|
return customError;
|
|
20
20
|
}
|
package/package.json
CHANGED
package/src/validator-field.tsx
CHANGED
|
@@ -31,7 +31,7 @@ class ValidationFieldWrapper extends Component<Props> {
|
|
|
31
31
|
|
|
32
32
|
validate(): Validity {
|
|
33
33
|
const props = this.props
|
|
34
|
-
const customError = props.customErrors.find((item) => item.id === props.id)
|
|
34
|
+
const customError = (props.customErrors || []).find((item) => item.id === props.id)
|
|
35
35
|
if (customError) {
|
|
36
36
|
return customError
|
|
37
37
|
}
|