MCPcopy
hub / github.com/final-form/final-form / runRecordLevelValidation

Function runRecordLevelValidation

src/FinalForm.ts:316–331  ·  view source on GitHub ↗
(
    setErrors: (errors: AnyObject, isAsync: boolean) => void,
  )

Source from the content-addressed store, hash-verified

314 : {};
315
316 const runRecordLevelValidation = (
317 setErrors: (errors: AnyObject, isAsync: boolean) => void,
318 ): Promise<any>[] => {
319 const promises = [];
320 if (validate) {
321 const errorsOrPromise = validate({ ...state.formState.values }); // clone to avoid writing
322 if (isPromise(errorsOrPromise)) {
323 promises.push(
324 errorsOrPromise.then((errors: any) => setErrors(errors, true)),
325 );
326 } else {
327 setErrors(errorsOrPromise, false);
328 }
329 }
330 return promises;
331 };
332
333 const getValidators = (field: InternalFieldState) => {
334 if (!field || !field.validators) {

Callers 1

runValidationFunction · 0.85

Calls 1

validateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…