-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version to v0.31.0-rc.0 and update readme and changelog
- Loading branch information
1 parent
3573e82
commit 95c0246
Showing
7 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,22 +27,22 @@ First you create a schema that describes a structured data set. A schema can be | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
import { email, minLength, object, type Output, parse, string } from 'valibot'; // 1.54 kB | ||
import * as v from 'valibot'; // 1.12 kB | ||
|
||
// Create login schema with email and password | ||
const LoginSchema = object({ | ||
email: string([email()]), | ||
password: string([minLength(8)]), | ||
const LoginSchema = v.object({ | ||
email: v.pipe(v.string(), v.email()), | ||
password: v.pipe(v.string(), v.minLength(8)), | ||
}); | ||
|
||
// Infer output TypeScript type of login schema | ||
type LoginData = Output<typeof LoginSchema>; // { email: string; password: string } | ||
type LoginData = v.InferOutput<typeof LoginSchema>; // { email: string; password: string } | ||
|
||
// Throws error for `email` and `password` | ||
parse(LoginSchema, { email: '', password: '' }); | ||
v.parse(LoginSchema, { email: '', password: '' }); | ||
|
||
// Returns data as { email: string; password: string } | ||
parse(LoginSchema, { email: '[email protected]', password: '12345678' }); | ||
v.parse(LoginSchema, { email: '[email protected]', password: '12345678' }); | ||
``` | ||
|
||
Apart from `parse` I also offer a non-exception-based API with `safeParse` and a type guard function with `is`. You can read more about it [here](https://valibot.dev/guides/parse-data/). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,22 +27,22 @@ First you create a schema that describes a structured data set. A schema can be | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
import { email, minLength, object, type Output, parse, string } from 'valibot'; // 1.54 kB | ||
import * as v from 'valibot'; // 1.12 kB | ||
|
||
// Create login schema with email and password | ||
const LoginSchema = object({ | ||
email: string([email()]), | ||
password: string([minLength(8)]), | ||
const LoginSchema = v.object({ | ||
email: v.pipe(v.string(), v.email()), | ||
password: v.pipe(v.string(), v.minLength(8)), | ||
}); | ||
|
||
// Infer output TypeScript type of login schema | ||
type LoginData = Output<typeof LoginSchema>; // { email: string; password: string } | ||
type LoginData = v.InferOutput<typeof LoginSchema>; // { email: string; password: string } | ||
|
||
// Throws error for `email` and `password` | ||
parse(LoginSchema, { email: '', password: '' }); | ||
v.parse(LoginSchema, { email: '', password: '' }); | ||
|
||
// Returns data as { email: string; password: string } | ||
parse(LoginSchema, { email: '[email protected]', password: '12345678' }); | ||
v.parse(LoginSchema, { email: '[email protected]', password: '12345678' }); | ||
``` | ||
|
||
Apart from `parse` I also offer a non-exception-based API with `safeParse` and a type guard function with `is`. You can read more about it [here](https://valibot.dev/guides/parse-data/). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "@valibot/valibot", | ||
"version": "0.30.0", | ||
"version": "0.31.0-rc.0", | ||
"exports": "./src/index.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters