@ts-kizuna/express 1.55.0 → 1.56.0

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.
package/dist/index.cjs CHANGED
@@ -96,7 +96,8 @@ function mountExpress(api, app, options) {
96
96
  });
97
97
  };
98
98
  const mountLane = (routes, router) => {
99
- for (const { routeKey, route } of adapter.eachRoute(routes, router)) mountRoute(routeKey, route, routes, router);
99
+ const declaredRoutes = [...adapter.eachRoute(routes, router)].sort((left, right) => Number(right.route.method === "HEAD") - Number(left.route.method === "HEAD"));
100
+ for (const { routeKey, route } of declaredRoutes) mountRoute(routeKey, route, routes, router);
100
101
  };
101
102
  mountLane(api.routes, api[_ts_kizuna_core_adapter.ROUTER_META]);
102
103
  mountLane((0, _ts_kizuna_core_adapter.pluginRoutesOf)(api), (0, _ts_kizuna_core_adapter.pluginRouterOf)(api));
package/dist/index.mjs CHANGED
@@ -95,7 +95,8 @@ function mountExpress(api, app, options) {
95
95
  });
96
96
  };
97
97
  const mountLane = (routes, router) => {
98
- for (const { routeKey, route } of adapter.eachRoute(routes, router)) mountRoute(routeKey, route, routes, router);
98
+ const declaredRoutes = [...adapter.eachRoute(routes, router)].sort((left, right) => Number(right.route.method === "HEAD") - Number(left.route.method === "HEAD"));
99
+ for (const { routeKey, route } of declaredRoutes) mountRoute(routeKey, route, routes, router);
99
100
  };
100
101
  mountLane(api.routes, api[ROUTER_META]);
101
102
  mountLane(pluginRoutesOf(api), pluginRouterOf(api));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-kizuna/express",
3
- "version": "1.55.0",
3
+ "version": "1.56.0",
4
4
  "description": "Express adapter for ts-kizuna",
5
5
  "keywords": [
6
6
  "ts-kizuna",
@@ -57,7 +57,7 @@
57
57
  "peerDependencies": {
58
58
  "express": "^5.0.0",
59
59
  "zod": "^4.0.0",
60
- "@ts-kizuna/core": "1.55.0"
60
+ "@ts-kizuna/core": "1.56.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/express": "^5.0.0",
@@ -65,7 +65,7 @@
65
65
  "tsdown": "^0.21.0",
66
66
  "typescript": "^6.0.3",
67
67
  "zod": "^4.0.0",
68
- "@ts-kizuna/core": "1.55.0"
68
+ "@ts-kizuna/core": "1.56.0"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "tsdown src/index.ts --format esm,cjs --dts --clean --external @ts-kizuna/core --external express --external zod",