@taserjs/router 0.1.10 → 0.1.11
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/LICENSE +1 -1
- package/dist/cjs/middleware/hono-mw.cjs +1 -1
- package/dist/cjs/middleware/hono-mw.cjs.map +1 -1
- package/dist/cjs/middleware/hono-mw.d.cts +1 -1
- package/dist/esm/middleware/hono-mw.d.ts +1 -1
- package/dist/esm/middleware/hono-mw.js +1 -1
- package/dist/esm/middleware/hono-mw.js.map +1 -1
- package/package.json +3 -3
- package/src/middleware/hono-mw.ts +1 -1
package/LICENSE
CHANGED
|
@@ -2,7 +2,7 @@ let _taserjs_router_core = require("@taserjs/router-core");
|
|
|
2
2
|
//#region src/middleware/hono-mw.ts
|
|
3
3
|
/**
|
|
4
4
|
* Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`
|
|
5
|
-
* into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
5
|
+
* into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hono-mw.cjs","names":[],"sources":["../../../src/middleware/hono-mw.ts"],"sourcesContent":["import { createTaserCompatHandler } from \"@taserjs/router-core\";\nimport type { MiddlewareHandler } from \"hono\";\n\nimport type { NextFn } from \"../types/units.js\";\n\n/**\n * Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`\n * into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.\n *\n * @example\n * ```ts\n * import { honoMw } from \"@taserjs/router\";\n * import { cors } from \"hono/cors\";\n *\n * const app = t.get(\"/hello\").use(honoMw(cors()));\n * // or\n * const customCors = middleware(honoMw(cors()));\n * ```\n */\nexport function honoMw<TState extends Record<string, unknown> = {}>(\n middleware: MiddlewareHandler,\n): (ctx: unknown, next: NextFn<TState>) => Promise<Response> {\n return createTaserCompatHandler(middleware) as (\n ctx: unknown,\n next: NextFn<TState>,\n ) => Promise<Response>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,OACd,YAC2D;CAC3D,QAAA,GAAA,qBAAA,yBAAA,CAAgC,UAAU;AAI5C"}
|
|
1
|
+
{"version":3,"file":"hono-mw.cjs","names":[],"sources":["../../../src/middleware/hono-mw.ts"],"sourcesContent":["import { createTaserCompatHandler } from \"@taserjs/router-core\";\nimport type { MiddlewareHandler } from \"hono\";\n\nimport type { NextFn } from \"../types/units.js\";\n\n/**\n * Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`\n * into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.\n *\n * @example\n * ```ts\n * import { honoMw } from \"@taserjs/router\";\n * import { cors } from \"hono/cors\";\n *\n * const app = t.get(\"/hello\").use(honoMw(cors()));\n * // or\n * const customCors = middleware(honoMw(cors()));\n * ```\n */\nexport function honoMw<TState extends Record<string, unknown> = {}>(\n middleware: MiddlewareHandler,\n): (ctx: unknown, next: NextFn<TState>) => Promise<Response> {\n return createTaserCompatHandler(middleware) as (\n ctx: unknown,\n next: NextFn<TState>,\n ) => Promise<Response>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,OACd,YAC2D;CAC3D,QAAA,GAAA,qBAAA,yBAAA,CAAgC,UAAU;AAI5C"}
|
|
@@ -2,7 +2,7 @@ import { MiddlewareHandler } from 'hono';
|
|
|
2
2
|
import { NextFn } from '../types/units.js';
|
|
3
3
|
/**
|
|
4
4
|
* Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`
|
|
5
|
-
* into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
5
|
+
* into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -2,7 +2,7 @@ import { MiddlewareHandler } from 'hono';
|
|
|
2
2
|
import { NextFn } from '../types/units.js';
|
|
3
3
|
/**
|
|
4
4
|
* Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`
|
|
5
|
-
* into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
5
|
+
* into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -2,7 +2,7 @@ import { createTaserCompatHandler } from "@taserjs/router-core";
|
|
|
2
2
|
//#region src/middleware/hono-mw.ts
|
|
3
3
|
/**
|
|
4
4
|
* Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`
|
|
5
|
-
* into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
5
|
+
* into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hono-mw.js","names":[],"sources":["../../../src/middleware/hono-mw.ts"],"sourcesContent":["import { createTaserCompatHandler } from \"@taserjs/router-core\";\nimport type { MiddlewareHandler } from \"hono\";\n\nimport type { NextFn } from \"../types/units.js\";\n\n/**\n * Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`\n * into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.\n *\n * @example\n * ```ts\n * import { honoMw } from \"@taserjs/router\";\n * import { cors } from \"hono/cors\";\n *\n * const app = t.get(\"/hello\").use(honoMw(cors()));\n * // or\n * const customCors = middleware(honoMw(cors()));\n * ```\n */\nexport function honoMw<TState extends Record<string, unknown> = {}>(\n middleware: MiddlewareHandler,\n): (ctx: unknown, next: NextFn<TState>) => Promise<Response> {\n return createTaserCompatHandler(middleware) as (\n ctx: unknown,\n next: NextFn<TState>,\n ) => Promise<Response>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,OACd,YAC2D;CAC3D,OAAO,yBAAyB,UAAU;AAI5C"}
|
|
1
|
+
{"version":3,"file":"hono-mw.js","names":[],"sources":["../../../src/middleware/hono-mw.ts"],"sourcesContent":["import { createTaserCompatHandler } from \"@taserjs/router-core\";\nimport type { MiddlewareHandler } from \"hono\";\n\nimport type { NextFn } from \"../types/units.js\";\n\n/**\n * Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`\n * into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.\n *\n * @example\n * ```ts\n * import { honoMw } from \"@taserjs/router\";\n * import { cors } from \"hono/cors\";\n *\n * const app = t.get(\"/hello\").use(honoMw(cors()));\n * // or\n * const customCors = middleware(honoMw(cors()));\n * ```\n */\nexport function honoMw<TState extends Record<string, unknown> = {}>(\n middleware: MiddlewareHandler,\n): (ctx: unknown, next: NextFn<TState>) => Promise<Response> {\n return createTaserCompatHandler(middleware) as (\n ctx: unknown,\n next: NextFn<TState>,\n ) => Promise<Response>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,OACd,YAC2D;CAC3D,OAAO,yBAAyB,UAAU;AAI5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taserjs/router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Type-safe Node.js router with runtime validation and middleware",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": {
|
|
@@ -147,8 +147,8 @@
|
|
|
147
147
|
"dependencies": {
|
|
148
148
|
"@standard-schema/spec": "^1.1.0",
|
|
149
149
|
"hono": "^4.10.3",
|
|
150
|
-
"@taserjs/router-
|
|
151
|
-
"@taserjs/router-
|
|
150
|
+
"@taserjs/router-utils": "0.1.11",
|
|
151
|
+
"@taserjs/router-core": "0.1.11"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
154
|
"@tanstack/vite-config": "^0.6.0",
|
|
@@ -5,7 +5,7 @@ import type { NextFn } from "../types/units.js";
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Adapts a standard Web / Hono-compatible middleware function `(c, next) => ...`
|
|
8
|
-
* into a Taser-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
8
|
+
* into a Taser.js-compatible middleware handler function `(ctx, next) => Promise<Response>`.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|