| 951 | } |
| 952 | |
| 953 | _validateCustomValidator (schema, value, path) { |
| 954 | const errors = [] |
| 955 | /* Internal validators using the custom validator format */ |
| 956 | errors.push(...ipValidator.call(this, schema, value, path, this.translate)) |
| 957 | |
| 958 | const validate = validator => { |
| 959 | errors.push(...validator.call(this, schema, value, path)) |
| 960 | } |
| 961 | /* Custom type validation (global) */ |
| 962 | this.defaults.custom_validators.forEach(validate) |
| 963 | /* Custom type validation (instance specific) */ |
| 964 | if (this.options.custom_validators) { |
| 965 | this.options.custom_validators.forEach(validate) |
| 966 | } |
| 967 | return errors |
| 968 | } |
| 969 | |
| 970 | _removeDuplicateErrors (errors) { |
| 971 | return errors.reduce((err, obj) => { |