@kevisual/router 0.0.6-alpha-3 → 0.0.6-alpha-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.
@@ -320,10 +320,10 @@ declare class QueryRouterServer extends QueryRouter {
320
320
  use(path: string, fn: (ctx: any) => any, opts?: RouteOpts): void;
321
321
  addRoute(route: Route): void;
322
322
  Route: typeof Route;
323
- route(opts: RouteOpts): Route;
324
- route(path: string, key?: string): Route;
325
- route(path: string, opts?: RouteOpts): Route;
326
- route(path: string, key?: string, opts?: RouteOpts): Route;
323
+ route(opts: RouteOpts): Route<Required<RouteContext>>;
324
+ route(path: string, key?: string): Route<Required<RouteContext>>;
325
+ route(path: string, opts?: RouteOpts): Route<Required<RouteContext>>;
326
+ route(path: string, key?: string, opts?: RouteOpts): Route<Required<RouteContext>>;
327
327
  /**
328
328
  * 等于queryRoute,但是调用了handle
329
329
  * @param param0
@@ -5649,7 +5649,7 @@ class QueryRouter {
5649
5649
  const has = this.routes.find((r) => r.path === route.path && r.key === route.key);
5650
5650
  if (has) {
5651
5651
  // remove the old route
5652
- this.routes = this.routes.filter((r) => r.path === route.path && r.key === route.key);
5652
+ this.routes = this.routes.filter((r) => r.id !== has.id);
5653
5653
  }
5654
5654
  this.routes.push(route);
5655
5655
  }
package/dist/router.d.ts CHANGED
@@ -325,10 +325,10 @@ declare class QueryRouterServer extends QueryRouter {
325
325
  use(path: string, fn: (ctx: any) => any, opts?: RouteOpts): void;
326
326
  addRoute(route: Route): void;
327
327
  Route: typeof Route;
328
- route(opts: RouteOpts): Route;
329
- route(path: string, key?: string): Route;
330
- route(path: string, opts?: RouteOpts): Route;
331
- route(path: string, key?: string, opts?: RouteOpts): Route;
328
+ route(opts: RouteOpts): Route<Required<RouteContext>>;
329
+ route(path: string, key?: string): Route<Required<RouteContext>>;
330
+ route(path: string, opts?: RouteOpts): Route<Required<RouteContext>>;
331
+ route(path: string, key?: string, opts?: RouteOpts): Route<Required<RouteContext>>;
332
332
  /**
333
333
  * 等于queryRoute,但是调用了handle
334
334
  * @param param0
@@ -553,9 +553,9 @@ declare class App<T = {}, U = AppReqRes> {
553
553
  add: (route: Route) => void;
554
554
  Route: typeof Route;
555
555
  route(opts: RouteOpts): Route<U>;
556
- route(path: string, key?: string): Route;
557
- route(path: string, opts?: RouteOpts): Route;
558
- route(path: string, key?: string, opts?: RouteOpts): Route;
556
+ route(path: string, key?: string): Route<U>;
557
+ route(path: string, opts?: RouteOpts): Route<U>;
558
+ route(path: string, key?: string, opts?: RouteOpts): Route<U>;
559
559
  call(message: {
560
560
  path: string;
561
561
  key?: string;
package/dist/router.js CHANGED
@@ -5669,7 +5669,7 @@ class QueryRouter {
5669
5669
  const has = this.routes.find((r) => r.path === route.path && r.key === route.key);
5670
5670
  if (has) {
5671
5671
  // remove the old route
5672
- this.routes = this.routes.filter((r) => r.path === route.path && r.key === route.key);
5672
+ this.routes = this.routes.filter((r) => r.id !== has.id);
5673
5673
  }
5674
5674
  this.routes.push(route);
5675
5675
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@kevisual/router",
4
- "version": "0.0.6-alpha-3",
4
+ "version": "0.0.6-alpha-5",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",