@thi.ng/router 3.1.4 → 3.1.7
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/CHANGELOG.md +7 -1
- package/basic.js +4 -4
- package/history.js +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2022-
|
|
3
|
+
- **Last updated**: 2022-06-09T16:14:01Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [3.1.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/router@3.1.5) (2022-04-07)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- replace deprecated .substr() w/ .substring() ([0710509](https://github.com/thi-ng/umbrella/commit/0710509))
|
|
17
|
+
|
|
12
18
|
## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/router@3.1.0) (2021-11-17)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/basic.js
CHANGED
|
@@ -51,9 +51,9 @@ let BasicRouter = class BasicRouter {
|
|
|
51
51
|
*/
|
|
52
52
|
route(src) {
|
|
53
53
|
if (src.charAt(0) === "#") {
|
|
54
|
-
src = src.
|
|
54
|
+
src = src.substring(1);
|
|
55
55
|
}
|
|
56
|
-
src = src.
|
|
56
|
+
src = src.substring(this.config.prefix.length);
|
|
57
57
|
let match = this.matchRoutes(src);
|
|
58
58
|
if (!match) {
|
|
59
59
|
if (!this.handleRouteFailure()) {
|
|
@@ -97,7 +97,7 @@ let BasicRouter = class BasicRouter {
|
|
|
97
97
|
this.config.prefix +
|
|
98
98
|
route.match
|
|
99
99
|
.map((x) => x.charAt(0) === "?"
|
|
100
|
-
? (x = params[x.
|
|
100
|
+
? (x = params[x.substring(1)]) != null
|
|
101
101
|
? x
|
|
102
102
|
: "NULL"
|
|
103
103
|
: x)
|
|
@@ -127,7 +127,7 @@ let BasicRouter = class BasicRouter {
|
|
|
127
127
|
for (let i = 0; i < n; i++) {
|
|
128
128
|
const m = match[i];
|
|
129
129
|
if (m.charAt(0) === "?") {
|
|
130
|
-
params[m.
|
|
130
|
+
params[m.substring(1)] = curr[i];
|
|
131
131
|
}
|
|
132
132
|
else if (curr[i] !== m) {
|
|
133
133
|
return;
|
package/history.js
CHANGED
|
@@ -83,7 +83,7 @@ export class HTMLRouter extends BasicRouter {
|
|
|
83
83
|
this.hashHandler ||
|
|
84
84
|
((e) => {
|
|
85
85
|
if (!this.ignoreHashChange) {
|
|
86
|
-
const hash = e.newURL.
|
|
86
|
+
const hash = e.newURL.substring(e.newURL.indexOf("#"));
|
|
87
87
|
if (hash !== this.currentPath) {
|
|
88
88
|
this.route(hash, false);
|
|
89
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/router",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "Generic router for browser & non-browser based applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/checks": "^3.
|
|
39
|
-
"@thi.ng/equiv": "^2.1.
|
|
40
|
-
"@thi.ng/errors": "^2.1.
|
|
41
|
-
"tslib": "^2.
|
|
37
|
+
"@thi.ng/api": "^8.3.7",
|
|
38
|
+
"@thi.ng/checks": "^3.2.0",
|
|
39
|
+
"@thi.ng/equiv": "^2.1.7",
|
|
40
|
+
"@thi.ng/errors": "^2.1.7",
|
|
41
|
+
"tslib": "^2.4.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@microsoft/api-extractor": "^7.
|
|
45
|
-
"@thi.ng/testament": "^0.2.
|
|
44
|
+
"@microsoft/api-extractor": "^7.25.0",
|
|
45
|
+
"@thi.ng/testament": "^0.2.8",
|
|
46
46
|
"rimraf": "^3.0.2",
|
|
47
47
|
"tools": "^0.0.1",
|
|
48
|
-
"typedoc": "^0.22.
|
|
49
|
-
"typescript": "^4.
|
|
48
|
+
"typedoc": "^0.22.17",
|
|
49
|
+
"typescript": "^4.7.3"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"browser",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
],
|
|
73
73
|
"exports": {
|
|
74
74
|
".": {
|
|
75
|
-
"
|
|
75
|
+
"default": "./index.js"
|
|
76
76
|
},
|
|
77
77
|
"./api": {
|
|
78
|
-
"
|
|
78
|
+
"default": "./api.js"
|
|
79
79
|
},
|
|
80
80
|
"./basic": {
|
|
81
|
-
"
|
|
81
|
+
"default": "./basic.js"
|
|
82
82
|
},
|
|
83
83
|
"./history": {
|
|
84
|
-
"
|
|
84
|
+
"default": "./history.js"
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"thi.ng": {
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
],
|
|
92
92
|
"year": 2014
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "9e516d30a1a537e027a6b3d78bf9121bc5831d31\n"
|
|
95
95
|
}
|