@hookform/resolvers
Version:
React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types, TypeBox, arktype, Typanion, Effect-TS and VineJS
9 lines (8 loc) • 377 B
TypeScript
import { ValidationError } from 'io-ts';
import { FieldError } from 'react-hook-form';
export type ErrorObject = Record<string, FieldError>;
export type FieldErrorWithPath = FieldError & {
path: string;
};
declare const errorsToRecord: (validateAllFieldCriteria: boolean) => (validationErrors: ReadonlyArray<ValidationError>) => ErrorObject;
export default errorsToRecord;