Socket
Socket
Sign inDemoInstall

@hookform/resolvers

Package Overview
Dependencies
Maintainers
3
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hookform/resolvers - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

io-ts/dist/arrayToPath.d.ts

22

package.json
{
"name": "@hookform/resolvers",
"amdName": "hookformResolvers",
"version": "2.2.0",
"version": "2.3.0",
"description": "React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator and etc.",

@@ -54,2 +54,8 @@ "main": "dist/resolvers.js",

},
"./io-ts": {
"browser": "./io-ts/dist/io-ts.module.js",
"umd": "./io-ts/dist/io-ts.umd.js",
"import": "./io-ts/dist/io-ts.mjs",
"require": "./io-ts/dist/io-ts.js"
},
"./package.json": "./package.json",

@@ -77,3 +83,6 @@ "./": "./"

"class-validator/src",
"class-validator/dist"
"class-validator/dist",
"io-ts/package.json",
"io-ts/src",
"io-ts/dist"
],

@@ -91,2 +100,3 @@ "publishConfig": {

"build:superstruct": "microbundle --cwd superstruct --globals '@hookform/resolvers=hookformResolvers'",
"build:io-ts": "microbundle --cwd io-ts --globals '@hookform/resolvers=hookformResolvers'",
"build:vest": "microbundle --cwd vest --globals '@hookform/resolvers=hookformResolvers'",

@@ -113,3 +123,4 @@ "build:class-validator": "microbundle --cwd class-validator --globals '@hookform/resolvers=hookformResolvers'",

"vest",
"class-validator"
"class-validator",
"io-ts"
],

@@ -140,3 +151,6 @@ "repository": {

"eslint-plugin-prettier": "^3.3.1",
"fp-ts": "^2.7.0",
"husky": "^4.3.8",
"io-ts": "^2.0.0",
"io-ts-types": "^0.5.16",
"jest": "^26.6.3",

@@ -146,2 +160,4 @@ "joi": "^17.3.0",

"microbundle": "^0.13.0",
"monocle-ts": "^2.3.9",
"newtype-ts": "^0.3.4",
"npm-run-all": "^4.1.5",

@@ -148,0 +164,0 @@ "prettier": "^2.2.1",

<div align="center">
<p align="center">
<a href="https://react-hook-form.com" title="React Hook Form - Simple React forms validation">
<img src="https://raw.githubusercontent.com/bluebill1049/react-hook-form/master/docs/logo.png" alt="React Hook Form Logo - React hook custom hook for form validation" width="300px" />
<img src="https://raw.githubusercontent.com/bluebill1049/react-hook-form/master/docs/logo.png" alt="React Hook Form Logo - React hook custom hook for form validation" />
</a>

@@ -19,6 +19,2 @@ </p>

## Goal
We are moving away from native support for Yup validation. We are now supporting other schema validation after React Hook Form v6.
## Install

@@ -252,3 +248,2 @@

```tsx
import 'reflect-metadata';
import React from 'react';

@@ -298,2 +293,38 @@ import { useForm } from 'react-hook-form';

### [io-ts](https://github.com/gcanti/io-ts)
Validate your data with powerful decoders.
[![npm](https://img.shields.io/bundlephobia/minzip/io-ts?style=for-the-badge)](https://bundlephobia.com/result?p=io-ts)
```typescript jsx
import React from 'react';
import { useForm } from 'react-hook-form';
import { ioTsResolver } from '@hookform/resolvers/io-ts';
import t from 'io-ts';
// you don't have to use io-ts-types but it's very useful
import tt from 'io-ts-types';
const schema = t.type({
username: t.string,
age: tt.NumberFromString,
});
const App = () => {
const { register, handleSubmit } = useForm({
resolver: ioTsResolver(schema),
});
return (
<form onSubmit={handleSubmit((d) => console.log(d))}>
<input name="username" ref={register} />
<input name="age" type="number" ref={register} />
<input type="submit" />
</form>
);
};
export default App;
```
## Backers

@@ -300,0 +331,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc