feat(typebox-validator): support Hono v3.1.0 (#65)
* feat(typebox-validator): support Hono v3.1.0 * add changesetpull/66/head
parent
481310aedb
commit
5723cc08c5
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/typebox-validator': minor
|
||||
---
|
||||
|
||||
feat: Support Hono v3.1.0
|
|
@ -28,11 +28,11 @@
|
|||
},
|
||||
"homepage": "https://github.com/honojs/middleware",
|
||||
"peerDependencies": {
|
||||
"hono": "3.*",
|
||||
"@sinclair/typebox": "^0.25.24"
|
||||
"@sinclair/typebox": "^0.25.24",
|
||||
"hono": "3.*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"hono": "^3.0.0",
|
||||
"@sinclair/typebox": "^0.25.24"
|
||||
"@sinclair/typebox": "^0.25.24",
|
||||
"hono": "^3.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,11 @@ export function tbValidator<
|
|||
target: Target,
|
||||
schema: T,
|
||||
hook?: Hook<Static<T>>
|
||||
): MiddlewareHandler<E, P, { [K in Target]: Static<T> }> {
|
||||
): MiddlewareHandler<
|
||||
E,
|
||||
P,
|
||||
{ in: { [K in Target]: Static<T> }; out: { [K in Target]: Static<T> } }
|
||||
> {
|
||||
// Compile the provided schema once rather than per validation. This could be optimized further using a shared schema
|
||||
// compilation pool similar to the Fastify implementation.
|
||||
const compiled = TypeCompiler.Compile(schema)
|
||||
|
|
|
@ -33,7 +33,7 @@ describe('Basic', () => {
|
|||
}
|
||||
}
|
||||
output: {
|
||||
success: boolean
|
||||
success: true
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5232,7 +5232,7 @@ hono@^3.0.2:
|
|||
resolved "https://registry.yarnpkg.com/hono/-/hono-3.0.2.tgz#807a1b0514c6563917d8c278e6da7101bdac1d19"
|
||||
integrity sha512-jhb0eCiUTOzbOXZyXQCOk1gf3MKjV4ZXY3PRT6lzma0XPsnnHuDOHYF7RCMHYe7jhl4Y0IAzrmWXneXhOMHypA==
|
||||
|
||||
hono@^3.1.0:
|
||||
hono@^3.0.3, hono@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/hono/-/hono-3.1.0.tgz#4b29bcaddc489015b99d0a89b68133ccf72b2cf1"
|
||||
integrity sha512-5hVyzp3mrAjxRwy6Uj7su0pIISGTKVX2tE4YiYO81V3w1KoYZEmz3g6X6P9nRLQmaABDWXmnL9GqEzBhTAPeog==
|
||||
|
|
Loading…
Reference in New Issue