@sourceregistry/node-webserver 1.6.6 → 1.7.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/README.md +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +15 -12
- package/dist/index.es.js.map +1 -1
- package/dist/types/router.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -351,7 +351,7 @@ var H = [
|
|
|
351
351
|
static set(e, t) {
|
|
352
352
|
this.cache.set(e, t);
|
|
353
353
|
}
|
|
354
|
-
}, W = class {
|
|
354
|
+
}, W = class e {
|
|
355
355
|
constructor() {
|
|
356
356
|
this._routes = [], this._wsRoutes = [], this._nestedRouters = [], this._middlewares = [], this._preHandlers = [], this._postHandlers = [], this.routesSorted = !1, this.wsRoutesSorted = !1;
|
|
357
357
|
}
|
|
@@ -395,18 +395,21 @@ var H = [
|
|
|
395
395
|
}
|
|
396
396
|
}, n);
|
|
397
397
|
}
|
|
398
|
-
use(
|
|
399
|
-
let
|
|
400
|
-
Array.isArray(
|
|
401
|
-
|
|
398
|
+
use(t, n, ...r) {
|
|
399
|
+
let i = "/", a, o = r;
|
|
400
|
+
if (Array.isArray(t)) {
|
|
401
|
+
let [n, r, ...s] = t;
|
|
402
|
+
n instanceof e ? (a = n, o = s) : (i = n, a = r, o = s);
|
|
403
|
+
} else t instanceof e ? (a = t, o = n ? [n, ...r] : r) : (i = t, a = n);
|
|
404
|
+
let s = this.normalizePrefix(i), { regex: c, paramNames: l, isCatchAll: u, priority: d } = this.createPrefixRegex(s);
|
|
402
405
|
return this._nestedRouters.push({
|
|
403
|
-
prefix:
|
|
404
|
-
router:
|
|
405
|
-
regex:
|
|
406
|
-
paramNames:
|
|
407
|
-
isCatchAll:
|
|
408
|
-
priority:
|
|
409
|
-
middlewares:
|
|
406
|
+
prefix: s,
|
|
407
|
+
router: a,
|
|
408
|
+
regex: c,
|
|
409
|
+
paramNames: l,
|
|
410
|
+
isCatchAll: u,
|
|
411
|
+
priority: d,
|
|
412
|
+
middlewares: o
|
|
410
413
|
}), this;
|
|
411
414
|
}
|
|
412
415
|
useMiddleware(...e) {
|