* Validates an object. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The val
(rule, value, callback, source, options)
| 75445 | */ |
| 75446 | |
| 75447 | function object(rule, value, callback, source, options) { |
| 75448 | var errors = []; |
| 75449 | var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); |
| 75450 | |
| 75451 | if (validate) { |
| 75452 | if (isEmptyValue(value) && !rule.required) { |
| 75453 | return callback(); |
| 75454 | } |
| 75455 | |
| 75456 | rules.required(rule, value, source, errors, options); |
| 75457 | |
| 75458 | if (value !== undefined) { |
| 75459 | rules.type(rule, value, source, errors, options); |
| 75460 | } |
| 75461 | } |
| 75462 | |
| 75463 | callback(errors); |
| 75464 | } |
| 75465 | |
| 75466 | var ENUM$1 = 'enum'; |
| 75467 | /** |
nothing calls this directly
no test coverage detected
searching dependent graphs…