2.4 KiB
2.4 KiB
@hono/typia-validator
0.1.0
Minor Changes
-
#888
c63470e4915a0680c624bf97d52487572185a2d5
Thanks @miyaji255! - Enables handling ofnumber
,boolean
, andbigint
types in query parameters and headers.- import { typiaValidator } from '@hono/typia-validator'; + import { typiaValidator } from '@hono/typia-validator/http'; import { Hono } from 'hono'; import typia, { type tags } from 'typia'; interface Schema { - pages: `${number}`[]; + pages: (number & tags.Type<'uint32'>)[]; } const app = new Hono() .get( '/books', typiaValidator( - typia.createValidate<Schema>(), + typia.http.createValidateQuery<Schema>(), async (result, c) => { if (!result.success) return c.text('Invalid query parameters', 400); - return { pages: result.data.pages.map(Number) }; } ), async c => { const { pages } = c.req.valid('query'); // { pages: number[] } //... } )
0.0.5
Patch Changes
- #570
66366075d4f268ad0190a30f1c77ca433cacf0b3
Thanks @ryoppippi! - PeerDependency of Typia is updated from v5 to v6
0.0.4
Patch Changes
- #488
1cc5e0a5b07a14723c5d21ceea33ad9caef33025
Thanks @Frog-kt! - Fixed a part of deprecated response json method in hono since v4.