MCPcopy
hub / github.com/marmelab/react-admin / isRequired

Function isRequired

packages/ra-core/src/form/validation/validate.ts:326–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324 * Given a validator, returns a boolean indicating whether the field is required or not.
325 */
326export 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};

Callers 6

ArrayInputFunction · 0.90
BooleanInputFunction · 0.90
TextInputFunction · 0.90
AutocompleteInputFunction · 0.90
ArrayInputFunction · 0.90
useInputFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected