From 3e7851aae22ffb6e380a66f1bb12aa843314e19a Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 17 Mar 2025 09:22:02 +0100 Subject: [PATCH] object -> array --- dist/router.js | 2 +- src/router.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/router.js b/dist/router.js index bf037ad..2eec438 100644 --- a/dist/router.js +++ b/dist/router.js @@ -70,7 +70,7 @@ export default class Router { } use(obj) { if (obj instanceof Router) { - this.routes = Object.assign(Object.assign({}, this.routes), obj.routes); + this.routes = [...this.routes, ...obj.routes]; this.sortRoutes(); } if (obj instanceof Tpl) { diff --git a/src/router.ts b/src/router.ts index 407238a..4eccbeb 100644 --- a/src/router.ts +++ b/src/router.ts @@ -95,7 +95,7 @@ export default class Router { */ use(obj: Router | Tpl): void { if(obj instanceof Router) { - this.routes = { ...this.routes, ...obj.routes }; + this.routes = [ ...this.routes, ...obj.routes ]; this.sortRoutes(); } if(obj instanceof Tpl) {