From 4314f07a384a4b5d1452376d8a7315f4c7de34c8 Mon Sep 17 00:00:00 2001 From: ienaga Date: Mon, 13 Nov 2023 09:16:14 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=83=88=E3=83=83=E3=83=97=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92config=E3=81=A7=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/domain/parser/QueryParser.ts | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 9ee13d3..3da6ec1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@next2d/framework", "description": "Next2D Framework is designed according to the principles of clean architecture, domain-driven development, test-driven development, and MVVM, with an emphasis on flexibility, scalability, and maintainability, and a design methodology that keeps each layer loosely coupled.", - "version": "2.0.1", + "version": "2.0.2", "homepage": "https://next2d.app", "bugs": "https://github.com/Next2D/Framework/issues/new", "author": "Toshiyuki Ienaga (https://github.com/ienaga/)", @@ -27,8 +27,8 @@ }, "devDependencies": { "@next2d/player": "*", - "@typescript-eslint/eslint-plugin": "^6.9.1", - "@typescript-eslint/parser": "^6.9.1", + "@typescript-eslint/eslint-plugin": "^6.10.0", + "@typescript-eslint/parser": "^6.10.0", "eslint": "^8.53.0", "jsdom": "^22.1.0", "typescript": "^5.2.2", diff --git a/src/domain/parser/QueryParser.ts b/src/domain/parser/QueryParser.ts index 5158ae2..636881e 100644 --- a/src/domain/parser/QueryParser.ts +++ b/src/domain/parser/QueryParser.ts @@ -36,6 +36,7 @@ export const execute = (name: string = ""): QueryObjectImpl => } } + const defaultTop: string = config.defaultTop || "top"; if (!name) { const names: string[] = location.pathname.split("/"); names.shift(); @@ -43,16 +44,16 @@ export const execute = (name: string = ""): QueryObjectImpl => if (name && config && config.routing) { const routing: RoutingImpl = config.routing[name]; if (!routing) { - name = "top"; + name = defaultTop; } if (routing && routing.private) { - name = routing.redirect || "top"; + name = routing.redirect || defaultTop; } } if (!name) { - name = "top"; + name = defaultTop; } } @@ -75,7 +76,7 @@ export const execute = (name: string = ""): QueryObjectImpl => } if (name.slice(0, 1) === ".") { - name = name.split("/").slice(1).join("/") || "top"; + name = name.split("/").slice(1).join("/") || defaultTop; } if (name.indexOf("@") > -1) {