-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(zod): add ability to skip zod's parsing (#401)
* skip zod parsing * align coding style
- Loading branch information
Showing
5 changed files
with
80 additions
and
7 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
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 |
---|---|---|
|
@@ -13,6 +13,11 @@ Object { | |
"ref": undefined, | ||
"type": "invalid_type", | ||
}, | ||
"dateStr": Object { | ||
"message": "Required", | ||
"ref": undefined, | ||
"type": "invalid_type", | ||
}, | ||
"email": Object { | ||
"message": "Invalid email", | ||
"ref": Object { | ||
|
@@ -86,6 +91,11 @@ Object { | |
"ref": undefined, | ||
"type": "invalid_type", | ||
}, | ||
"dateStr": Object { | ||
"message": "Required", | ||
"ref": undefined, | ||
"type": "invalid_type", | ||
}, | ||
"email": Object { | ||
"message": "Invalid email", | ||
"ref": Object { | ||
|
@@ -169,6 +179,14 @@ Object { | |
"invalid_type": "Expected number, received string", | ||
}, | ||
}, | ||
"dateStr": Object { | ||
"message": "Required", | ||
"ref": undefined, | ||
"type": "invalid_type", | ||
"types": Object { | ||
"invalid_type": "Required", | ||
}, | ||
}, | ||
"email": Object { | ||
"message": "Invalid email", | ||
"ref": Object { | ||
|
@@ -284,6 +302,14 @@ Object { | |
"invalid_type": "Expected number, received string", | ||
}, | ||
}, | ||
"dateStr": Object { | ||
"message": "Required", | ||
"ref": undefined, | ||
"type": "invalid_type", | ||
"types": Object { | ||
"invalid_type": "Required", | ||
}, | ||
}, | ||
"email": Object { | ||
"message": "Invalid email", | ||
"ref": Object { | ||
|
@@ -375,3 +401,30 @@ Object { | |
"values": Object {}, | ||
} | ||
`; | ||
|
||
exports[`zodResolver should return parsed values from zodResolver with \`mode: sync\` when validation pass 1`] = ` | ||
Object { | ||
"errors": Object {}, | ||
"values": Object { | ||
"accessToken": "accessToken", | ||
"birthYear": 2000, | ||
"dateStr": 2020-01-01T00:00:00.000Z, | ||
"email": "[email protected]", | ||
"enabled": true, | ||
"like": Array [ | ||
Object { | ||
"id": 1, | ||
"name": "name", | ||
}, | ||
], | ||
"password": "Password123_", | ||
"repeatPassword": "Password123_", | ||
"tags": Array [ | ||
"tag1", | ||
"tag2", | ||
], | ||
"url": "https://react-hook-form.com/", | ||
"username": "Doe", | ||
}, | ||
} | ||
`; |
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