clear-router 2.6.3 → 2.6.5
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/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/decorators/setup.cjs +1 -1
- package/dist/decorators/setup.mjs +1 -1
- package/dist/express/index.cjs +1 -1
- package/dist/express/index.mjs +1 -1
- package/dist/fastify/index.cjs +1 -1
- package/dist/fastify/index.mjs +1 -1
- package/dist/h3/index.cjs +1 -1
- package/dist/h3/index.mjs +1 -1
- package/dist/hono/index.cjs +1 -1
- package/dist/hono/index.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/koa/index.cjs +1 -1
- package/dist/koa/index.mjs +1 -1
- package/dist/{router-DJvP-A5M.cjs → router-CB7Duy0X.cjs} +2 -2
- package/dist/{router-9HWz4Tlp.mjs → router-CTzjojnD.mjs} +2 -2
- package/package.json +1 -1
package/dist/core/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_bindings = require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/core/plugins.ts
|
|
6
6
|
function definePlugin(plugin) {
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_bindings = require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
require('./index.cjs');
|
|
5
5
|
require("reflect-metadata");
|
|
6
6
|
|
package/dist/express/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/express/router.ts
|
package/dist/express/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-CTzjojnD.mjs";
|
|
3
3
|
import { n as resolveResponseMeta, r as responseWasSent, t as isFetchResponse } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/express/router.ts
|
package/dist/fastify/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/fastify/router.ts
|
package/dist/fastify/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-CTzjojnD.mjs";
|
|
3
3
|
import { n as resolveResponseMeta, r as responseWasSent, t as isFetchResponse } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/fastify/router.ts
|
package/dist/h3/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
let h3 = require("h3");
|
|
6
6
|
|
package/dist/h3/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-CTzjojnD.mjs";
|
|
3
3
|
import { n as resolveResponseMeta } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
import { HTTPResponse, getQuery, getRouterParams, readBody } from "h3";
|
|
5
5
|
|
package/dist/hono/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/hono/router.ts
|
package/dist/hono/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -781,7 +781,7 @@ var CoreRouter = class {
|
|
|
781
781
|
if (typeof preController[action] === "function") {
|
|
782
782
|
const { method, path } = actions[action];
|
|
783
783
|
const actionMiddlewares = typeof options?.middlewares === "object" && !Array.isArray(options.middlewares) ? options.middlewares[action] : options?.middlewares;
|
|
784
|
-
const name = `${basePath}${path}`.replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
784
|
+
const name = `${basePath}${path}`.replace(/\/:[^/]+|\/\{[^}]+\}/g, "").replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
785
785
|
this.add(method, `${basePath}${path}`, [controller, action], Array.isArray(actionMiddlewares) ? actionMiddlewares : actionMiddlewares ? [actionMiddlewares] : void 0).name(name + "." + action.toLowerCase());
|
|
786
786
|
}
|
|
787
787
|
}
|
|
@@ -1017,7 +1017,7 @@ var CoreRouter = class {
|
|
|
1017
1017
|
tokens,
|
|
1018
1018
|
designTokens
|
|
1019
1019
|
});
|
|
1020
|
-
if (pluginArgs) return handlerFunction(...pluginArgs);
|
|
1020
|
+
if (pluginArgs?.length) return handlerFunction(...pluginArgs);
|
|
1021
1021
|
if (!metadata || !tokens.length) return handlerFunction(ctx, ctx.clearRequest);
|
|
1022
1022
|
const args = [];
|
|
1023
1023
|
for (const token of tokens) {
|
package/dist/index.mjs
CHANGED
|
@@ -780,7 +780,7 @@ var CoreRouter = class {
|
|
|
780
780
|
if (typeof preController[action] === "function") {
|
|
781
781
|
const { method, path } = actions[action];
|
|
782
782
|
const actionMiddlewares = typeof options?.middlewares === "object" && !Array.isArray(options.middlewares) ? options.middlewares[action] : options?.middlewares;
|
|
783
|
-
const name = `${basePath}${path}`.replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
783
|
+
const name = `${basePath}${path}`.replace(/\/:[^/]+|\/\{[^}]+\}/g, "").replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
784
784
|
this.add(method, `${basePath}${path}`, [controller, action], Array.isArray(actionMiddlewares) ? actionMiddlewares : actionMiddlewares ? [actionMiddlewares] : void 0).name(name + "." + action.toLowerCase());
|
|
785
785
|
}
|
|
786
786
|
}
|
|
@@ -1016,7 +1016,7 @@ var CoreRouter = class {
|
|
|
1016
1016
|
tokens,
|
|
1017
1017
|
designTokens
|
|
1018
1018
|
});
|
|
1019
|
-
if (pluginArgs) return handlerFunction(...pluginArgs);
|
|
1019
|
+
if (pluginArgs?.length) return handlerFunction(...pluginArgs);
|
|
1020
1020
|
if (!metadata || !tokens.length) return handlerFunction(ctx, ctx.clearRequest);
|
|
1021
1021
|
const args = [];
|
|
1022
1022
|
for (const token of tokens) {
|
package/dist/koa/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-CB7Duy0X.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/koa/router.ts
|
package/dist/koa/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-CTzjojnD.mjs";
|
|
3
3
|
import { n as resolveResponseMeta, t as isFetchResponse } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/koa/router.ts
|
|
@@ -554,7 +554,7 @@ var CoreRouter = class {
|
|
|
554
554
|
if (typeof preController[action] === "function") {
|
|
555
555
|
const { method, path } = actions[action];
|
|
556
556
|
const actionMiddlewares = typeof options?.middlewares === "object" && !Array.isArray(options.middlewares) ? options.middlewares[action] : options?.middlewares;
|
|
557
|
-
const name = `${basePath}${path}`.replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
557
|
+
const name = `${basePath}${path}`.replace(/\/:[^/]+|\/\{[^}]+\}/g, "").replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
558
558
|
this.add(method, `${basePath}${path}`, [controller, action], Array.isArray(actionMiddlewares) ? actionMiddlewares : actionMiddlewares ? [actionMiddlewares] : void 0).name(name + "." + action.toLowerCase());
|
|
559
559
|
}
|
|
560
560
|
}
|
|
@@ -790,7 +790,7 @@ var CoreRouter = class {
|
|
|
790
790
|
tokens,
|
|
791
791
|
designTokens
|
|
792
792
|
});
|
|
793
|
-
if (pluginArgs) return handlerFunction(...pluginArgs);
|
|
793
|
+
if (pluginArgs?.length) return handlerFunction(...pluginArgs);
|
|
794
794
|
if (!metadata || !tokens.length) return handlerFunction(ctx, ctx.clearRequest);
|
|
795
795
|
const args = [];
|
|
796
796
|
for (const token of tokens) {
|
|
@@ -554,7 +554,7 @@ var CoreRouter = class {
|
|
|
554
554
|
if (typeof preController[action] === "function") {
|
|
555
555
|
const { method, path } = actions[action];
|
|
556
556
|
const actionMiddlewares = typeof options?.middlewares === "object" && !Array.isArray(options.middlewares) ? options.middlewares[action] : options?.middlewares;
|
|
557
|
-
const name = `${basePath}${path}`.replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
557
|
+
const name = `${basePath}${path}`.replace(/\/:[^/]+|\/\{[^}]+\}/g, "").replace(/\{(\w+):[^}]+\}/g, "$1").replace(/\/|:|[{}]/g, ".").replace(/\.{2,}/g, ".").replace(/^\.|\.$/g, "");
|
|
558
558
|
this.add(method, `${basePath}${path}`, [controller, action], Array.isArray(actionMiddlewares) ? actionMiddlewares : actionMiddlewares ? [actionMiddlewares] : void 0).name(name + "." + action.toLowerCase());
|
|
559
559
|
}
|
|
560
560
|
}
|
|
@@ -790,7 +790,7 @@ var CoreRouter = class {
|
|
|
790
790
|
tokens,
|
|
791
791
|
designTokens
|
|
792
792
|
});
|
|
793
|
-
if (pluginArgs) return handlerFunction(...pluginArgs);
|
|
793
|
+
if (pluginArgs?.length) return handlerFunction(...pluginArgs);
|
|
794
794
|
if (!metadata || !tokens.length) return handlerFunction(ctx, ctx.clearRequest);
|
|
795
795
|
const args = [];
|
|
796
796
|
for (const token of tokens) {
|
package/package.json
CHANGED