clear-router 2.5.2 → 2.5.3

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/h3/index.cjs CHANGED
@@ -22,8 +22,7 @@ var Router = class Router extends require_router.CoreRouter {
22
22
  });
23
23
  if (!meta) return void 0;
24
24
  if (meta.isNativeResponse) return meta.body;
25
- if (meta.contentType?.startsWith("application/json")) return Response.json(meta.body, { status: meta.status });
26
- return new Response(meta.isEmpty ? null : meta.body, {
25
+ return new h3.HTTPResponse(meta.contentType?.startsWith("application/json") ? JSON.stringify(meta.body) : meta.isEmpty ? null : meta.body, {
27
26
  status: meta.status,
28
27
  headers: meta.contentType ? { "Content-Type": meta.contentType } : void 0
29
28
  });
package/dist/h3/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as CoreRouter } from "../router-BReOXz-F.mjs";
2
2
  import { n as resolveResponseMeta } from "../responses-HOePPAl8.mjs";
3
- import { getQuery, getRouterParams, readBody } from "h3";
3
+ import { HTTPResponse, getQuery, getRouterParams, readBody } from "h3";
4
4
 
5
5
  //#region src/h3/router.ts
6
6
  /**
@@ -21,8 +21,7 @@ var Router = class Router extends CoreRouter {
21
21
  });
22
22
  if (!meta) return void 0;
23
23
  if (meta.isNativeResponse) return meta.body;
24
- if (meta.contentType?.startsWith("application/json")) return Response.json(meta.body, { status: meta.status });
25
- return new Response(meta.isEmpty ? null : meta.body, {
24
+ return new HTTPResponse(meta.contentType?.startsWith("application/json") ? JSON.stringify(meta.body) : meta.isEmpty ? null : meta.body, {
26
25
  status: meta.status,
27
26
  headers: meta.contentType ? { "Content-Type": meta.contentType } : void 0
28
27
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clear-router",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "Laravel-style routing for Node.js with support for Express, H3, Fastify, Hono, and Koa, including CommonJS, ESM, and TypeScript support.",
5
5
  "keywords": [
6
6
  "h3",