Skip to content

Commit

Permalink
Merge pull request #125 from Next2D/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ienaga committed Nov 13, 2023
2 parents 281748f + 22d8b6c commit d75aa85
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install
- run: npm run lint
- run: npx eslint ./src/**/*.ts

windows-browser-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install
- run: npm run lint
- run: npx eslint ./src/**/*.ts
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.gitattributes
.gitignore
.github
node_modules
__tests__
scripts
src
Framework_Flowchart.svg
tsconfig.eslint.json
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <ienaga@next2d.app> (https://github.com/ienaga/)",
Expand All @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions src/domain/parser/QueryParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,24 @@ export const execute = (name: string = ""): QueryObjectImpl =>
}
}

const defaultTop: string = config?.defaultTop || "top";
if (!name) {
const names: string[] = location.pathname.split("/");
names.shift();
name = `${names.join("/")}`;
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;
}
}

Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/interface/ConfigImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ConfigImpl extends BaseConfigImpl {
routing?: {
[key: string]: RoutingImpl
};
defaultTop?: string;
spa: boolean;
loading?: {
callback: string;
Expand Down

0 comments on commit d75aa85

Please sign in to comment.