feat(zod-validator): bump up Hono v3.1.0 (#63)

* feat(zod-validator): bump up Hono v3.1.0

* add changeset
pull/64/head
Yusuke Wada 2023-03-17 17:02:15 +09:00 committed by GitHub
parent 1e482e48d0
commit 3c9dca1c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 8 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/zod-validator': minor
---
feat: Support Hono v3.1.0

View File

@ -32,7 +32,7 @@
"zod": "^3.19.1"
},
"devDependencies": {
"hono": "^3.0.0",
"hono": "^3.1.0",
"zod": "3.19.1"
}
}
}

View File

@ -18,7 +18,11 @@ export const zValidator = <
target: Target,
schema: T,
hook?: Hook<z.infer<T>>
): MiddlewareHandler<E, P, { [K in Target]: z.infer<T> }> =>
): MiddlewareHandler<
E,
P,
{ in: { [K in Target]: z.input<T> }; out: { [K in Target]: z.output<T> } }
> =>
validator(target, (value, c) => {
const result = schema.safeParse(value)

View File

@ -33,7 +33,7 @@ describe('Basic', () => {
}
}
output: {
success: boolean
success: true
message: string
}
}

View File

@ -5232,10 +5232,10 @@ hono@^3.0.2:
resolved "https://registry.yarnpkg.com/hono/-/hono-3.0.2.tgz#807a1b0514c6563917d8c278e6da7101bdac1d19"
integrity sha512-jhb0eCiUTOzbOXZyXQCOk1gf3MKjV4ZXY3PRT6lzma0XPsnnHuDOHYF7RCMHYe7jhl4Y0IAzrmWXneXhOMHypA==
hono@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/hono/-/hono-3.0.3.tgz#26b62bece753941dd3d290d03ff3338f71535017"
integrity sha512-6Lb/TPH7Me1GAjFR7k/duzTcHS5y+rxFyL6Ky0kYQQlu92l99t53CFMVcdNUpHeStarPOs4Uzl413zIvxaI15A==
hono@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/hono/-/hono-3.1.0.tgz#4b29bcaddc489015b99d0a89b68133ccf72b2cf1"
integrity sha512-5hVyzp3mrAjxRwy6Uj7su0pIISGTKVX2tE4YiYO81V3w1KoYZEmz3g6X6P9nRLQmaABDWXmnL9GqEzBhTAPeog==
hosted-git-info@^2.1.4:
version "2.8.9"