Skip to content

Commit

Permalink
Merge pull request #61 from mintchkin/main
Browse files Browse the repository at this point in the history
Improve `getValidatedFormData` type inference
  • Loading branch information
AlemTuzlak authored Dec 13, 2023
2 parents 9d1c6ac + 218d87c commit 45e8bf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const isGet = (request: Pick<Request, "method">) =>
*/
export const getValidatedFormData = async <T extends FieldValues>(
request: Request,
resolver: Resolver,
resolver: Resolver<T>,
) => {
const data = isGet(request)
? getFormDataFromSearchParams(request)
Expand All @@ -124,7 +124,7 @@ export const getValidatedFormData = async <T extends FieldValues>(
*/
export const validateFormData = async <T extends FieldValues>(
data: any,
resolver: Resolver,
resolver: Resolver<T>,
) => {
const dataToValidate =
data instanceof FormData ? Object.fromEntries(data) : data;
Expand Down

0 comments on commit 45e8bf9

Please sign in to comment.