hono-takibi 0.9.21 → 0.9.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,18 @@ import { methodPath } from '../utils/index.js';
6
6
  * @returns An array of route mappings, each with route name, handler name, and path.
7
7
  */
8
8
  export function getRouteMaps(openapi) {
9
+ const isHttpMethod = (v) => {
10
+ for (const m of ['get', 'put', 'post', 'delete', 'patch', 'options', 'head', 'trace']) {
11
+ if (m === v)
12
+ return true;
13
+ }
14
+ return false;
15
+ };
9
16
  const paths = openapi.paths;
10
17
  const routeMappings = Object.entries(paths).flatMap(([path, pathItem]) => {
11
18
  return Object.entries(pathItem).flatMap(([method]) => {
19
+ if (!isHttpMethod(method))
20
+ return [];
12
21
  return {
13
22
  routeName: `${methodPath(method, path)}Route`,
14
23
  handlerName: `${methodPath(method, path)}RouteHandler`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hono-takibi",
3
3
  "description": "Hono Takibi is a CLI tool that generates Hono routes from OpenAPI specifications.",
4
- "version": "0.9.21",
4
+ "version": "0.9.22",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "keywords": [