( validator: ValidateFunction | undefined, data: any )
| 39 | }; |
| 40 | |
| 41 | export const validate = ( |
| 42 | validator: ValidateFunction | undefined, |
| 43 | data: any |
| 44 | ): ErrorObject[] => { |
| 45 | if (validator === undefined) { |
| 46 | return []; |
| 47 | } |
| 48 | const valid = validator(data); |
| 49 | if (valid) { |
| 50 | return []; |
| 51 | } |
| 52 | return validator.errors; |
| 53 | }; |
no outgoing calls
no test coverage detected
searching dependent graphs…