diff --git a/.changeset/support-http-module.md b/.changeset/support-http-module.md deleted file mode 100644 index 078c4f5ef..000000000 --- a/.changeset/support-http-module.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -'@hono/typia-validator': minor ---- - -Enables handling of `number`, `boolean`, and `bigint` types in query parameters and headers. - -```diff -- 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(), -+ typia.http.createValidateQuery(), - 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[] } - //... - } - ) -``` \ No newline at end of file diff --git a/packages/typia-validator/CHANGELOG.md b/packages/typia-validator/CHANGELOG.md index b04b5ae36..e245ceb0a 100644 --- a/packages/typia-validator/CHANGELOG.md +++ b/packages/typia-validator/CHANGELOG.md @@ -1,5 +1,41 @@ # @hono/typia-validator +## 0.1.0 + +### Minor Changes + +- [#888](https://github.com/honojs/middleware/pull/888) [`c63470e4915a0680c624bf97d52487572185a2d5`](https://github.com/honojs/middleware/commit/c63470e4915a0680c624bf97d52487572185a2d5) Thanks [@miyaji255](https://github.com/miyaji255)! - Enables handling of `number`, `boolean`, and `bigint` types in query parameters and headers. + + ```diff + - 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(), + + typia.http.createValidateQuery(), + 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 diff --git a/packages/typia-validator/package.json b/packages/typia-validator/package.json index e1d68fcce..11d586bda 100644 --- a/packages/typia-validator/package.json +++ b/packages/typia-validator/package.json @@ -1,6 +1,6 @@ { "name": "@hono/typia-validator", - "version": "0.0.5", + "version": "0.1.0", "description": "Validator middleware using Typia", "main": "dist/cjs/index.js", "module": "dist/esm/index.js",