Skip to content

Commit

Permalink
Upgrade and migrate Valibot to v0.31.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller committed Jun 3, 2024
1 parent 767184d commit 67d778c
Show file tree
Hide file tree
Showing 11 changed files with 4,782 additions and 3,978 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,15 @@ The modular and type safe schema library for validating structural data
```typescript jsx
import { useForm } from 'react-hook-form';
import { valibotResolver } from '@hookform/resolvers/valibot';
import { object, string, minLength, endsWith } from 'valibot';
import * as v from 'valibot';

const schema = object({
username: string('username is required', [
minLength(3, 'Needs to be at least 3 characters'),
endsWith('cool', 'Needs to end with `cool`'),
]),
password: string('password is required'),
const schema = v.object({
username: v.pipe(
v.string('username is required'),
v.minLength(3, 'Needs to be at least 3 characters'),
v.endsWith('cool', 'Needs to end with `cool`'),
),
password: v.string('password is required'),
});

const App = () => {
Expand All @@ -581,7 +582,7 @@ const App = () => {

A powerful TypeScript framework that provides a fully-fledged functional effect system with a rich standard library.

[![npm](https://img.shields.io/bundlephobia/minzip/valibot?style=for-the-badge)](https://bundlephobia.com/result?p=effect)
[![npm](https://img.shields.io/bundlephobia/minzip/@effect/schema?style=for-the-badge)](https://bundlephobia.com/result?p=effect)

```typescript jsx
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"superstruct": "^1.0.3",
"typanion": "^3.14.0",
"typescript": "^5.1.6",
"valibot": "^0.24.1",
"valibot": "0.31.0-rc.11",
"vest": "^4.6.11",
"vite": "^4.4.9",
"vite-tsconfig-paths": "^4.2.0",
Expand Down
Loading

0 comments on commit 67d778c

Please sign in to comment.