resolvers

📋 Validation resolvers: Yup, Zod, AJV, Joi, Superstruct, Vest, class-validator, io-ts, typanion, Ajv, TypeBox, Valibot and nope.

MIT License

Downloads
14.5M
Stars
1.6K
Committers
51

Bot releases are visible (Hide)

resolvers - v3.3.4 Latest Release

Published by github-actions[bot] 10 months ago

3.3.4 (2024-01-04)

Bug Fixes

  • error handling for array errors with root error (1bfc6ab)
resolvers - v3.3.3

Published by github-actions[bot] 10 months ago

3.3.3 (2023-12-26)

Bug Fixes

resolvers - v3.3.2

Published by github-actions[bot] about 1 year ago

3.3.2 (2023-10-11)

Bug Fixes

resolvers - v3.3.1

Published by github-actions[bot] about 1 year ago

3.3.1 (2023-08-28)

Bug Fixes

resolvers - v3.3.0

Published by github-actions[bot] about 1 year ago

3.3.0 (2023-08-22)

Bug Fixes

Features

  • add support for root errors for field array (#621) (5f1a622)
  • pass field names and a context as arguments to a Vest suite (#584) (3519701)
  • valibot: add more tests, support of criteriaMode and reduce size (#620) (a9d319d)
resolvers - v3.2.0

Published by github-actions[bot] about 1 year ago

3.2.0 (2023-08-06)

Features

resolvers - v3.1.1

Published by github-actions[bot] over 1 year ago

3.1.1 (2023-06-12)

BREAKING CHANGES

Bug Fixes

You don't need to explicitly provide the type when using the useForm function because it automatically infers the types from the Yup schema.

Before

const schema = Yup.shape({ name: string });

const { register } = useForm<{name: string}>({ resolver: yupResolver(schema) });

After

const schema = Yup.shape({ name: string });

const { register } = useForm({ resolver: yupResolver(schema) });
resolvers - v3.1.0

Published by github-actions[bot] over 1 year ago

3.1.0 (2023-04-15)

Features

resolvers - v3.0.1

Published by github-actions[bot] over 1 year ago

3.0.1 (2023-04-05)

Bug Fixes

resolvers - v3.0.0

Published by github-actions[bot] over 1 year ago

3.0.0 (2023-03-20)

BREAKING CHANGES

  • Yup resolver require Yup v1
  • rename rawValues option to raw
  • classValidationResolver: schema options now includes validator and transformer options
  • Please note that ajv and ajv-errors need to be installed separately, as they are not bundled with resolvers

Before:

schemaOptions?: ValidatorOptions,

After:

schemaOptions?: {
    validator?: ValidatorOptions;
    transformer?: ClassTransformOptions;
  }

Bug Fixes

Features

  • add option to keep raw values (f22d57c)
  • classValidationResolver: add transform and validator options (#524) (2749bd9)
  • yupResolver: add support Yup v1 (#520) (f3da212)
  • typeboxResolver: add TypeBox resolver (#526) (6a31c92)
import { useForm } from 'react-hook-form';
import { typeboxResolver } from '@hookform/resolvers/typebox';
import { Type } from '@sinclair/typebox';

const schema = Type.Object({
  username: Type.String({ minLength: 1 }),
  password: Type.String({ minLength: 1 }),
});

const App = () => {
  const { register, handleSubmit } = useForm({
    resolver: typeboxResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('username')} />
      <input type="password" {...register('password')} />
      <input type="submit" />
    </form>
  );
};

Performance Improvements

resolvers - v2.9.11

Published by github-actions[bot] over 1 year ago

2.9.11 (2023-02-08)

Bug Fixes

resolvers - v2.9.10

Published by github-actions[bot] almost 2 years ago

2.9.10 (2022-10-20)

Bug Fixes

  • ajv: undefined props validate structure error (#457) (0f39c20)
resolvers - v2.9.9

Published by github-actions[bot] about 2 years ago

2.9.9 (2022-10-14)

Bug Fixes

resolvers - v2.9.8

Published by github-actions[bot] about 2 years ago

2.9.8 (2022-09-11)

Bug Fixes

resolvers - v2.9.7

Published by github-actions[bot] about 2 years ago

2.9.7 (2022-07-26)

Bug Fixes

  • #396 remove unnecessary 'browser' exports to fix Jest integration (#435) (99703e6)
resolvers - v2.9.6

Published by github-actions[bot] over 2 years ago

2.9.6 (2022-07-15)

Bug Fixes

  • yup: yup wrong import statement assuming default export (#427) (928afae)
resolvers - v2.9.5

Published by github-actions[bot] over 2 years ago

2.9.5 (2022-07-08)

Bug Fixes

  • renamed private packages to avoid ambiguity with existing official packages. (#424) (18ae921)
resolvers - v2.9.4

Published by github-actions[bot] over 2 years ago

2.9.4 (2022-07-07)

Bug Fixes

resolvers - v2.9.3

Published by github-actions[bot] over 2 years ago

2.9.3 (2022-06-24)

Breaking Change

  • compile error with UnpackNestedValue

BREAKING CHANGE: This change will update package dependency with react-hook-form to 7.33.0 above (52a6e07)

resolvers - v2.9.2

Published by github-actions[bot] over 2 years ago

2.9.2 (2022-06-23)

Bug Fixes

  • exchange fp-ts/Either over fp-ts/lib/Either (#419) (7951951)
Package Rankings
Top 1.0% on Npmjs.org
Badges
Extracted from project README
npm downloads npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm
Related Projects