| 324 | * Given a validator, returns a boolean indicating whether the field is required or not. |
| 325 | */ |
| 326 | export const isRequired = validate => { |
| 327 | if (validate && validate.isRequired) { |
| 328 | return true; |
| 329 | } |
| 330 | if (Array.isArray(validate)) { |
| 331 | return !!validate.find(it => it.isRequired); |
| 332 | } |
| 333 | return false; |
| 334 | }; |
no outgoing calls
no test coverage detected