@domql/router 2.5.190 → 2.5.200
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/dist/cjs/index.js +6 -7
- package/dist/esm/index.js +3 -4
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -16,22 +16,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
default: () =>
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
|
+
default: () => index_default,
|
|
22
22
|
getActiveRoute: () => getActiveRoute,
|
|
23
23
|
lastLevel: () => lastLevel,
|
|
24
24
|
lastPathname: () => lastPathname,
|
|
25
25
|
router: () => router
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
var import_event = require("@domql/event");
|
|
29
29
|
var import_utils = require("@domql/utils");
|
|
30
30
|
const getActiveRoute = (level = 0, route = import_utils.window.location.pathname) => {
|
|
31
31
|
const routeArray = route.split("/");
|
|
32
32
|
const activeRoute = routeArray[level + 1];
|
|
33
|
-
if (activeRoute)
|
|
34
|
-
return `/${activeRoute}`;
|
|
33
|
+
if (activeRoute) return `/${activeRoute}`;
|
|
35
34
|
};
|
|
36
35
|
let lastPathname;
|
|
37
36
|
let lastLevel = 0;
|
|
@@ -115,4 +114,4 @@ const router = (path, el, state = {}, options = {}) => {
|
|
|
115
114
|
}
|
|
116
115
|
(0, import_event.triggerEventOn)("routeChanged", element, opts);
|
|
117
116
|
};
|
|
118
|
-
var
|
|
117
|
+
var index_default = router;
|
package/dist/esm/index.js
CHANGED
|
@@ -22,8 +22,7 @@ import { setContentKey, document, window } from "@domql/utils";
|
|
|
22
22
|
const getActiveRoute = (level = 0, route = window.location.pathname) => {
|
|
23
23
|
const routeArray = route.split("/");
|
|
24
24
|
const activeRoute = routeArray[level + 1];
|
|
25
|
-
if (activeRoute)
|
|
26
|
-
return `/${activeRoute}`;
|
|
25
|
+
if (activeRoute) return `/${activeRoute}`;
|
|
27
26
|
};
|
|
28
27
|
let lastPathname;
|
|
29
28
|
let lastLevel = 0;
|
|
@@ -104,9 +103,9 @@ const router = (path, el, state = {}, options = {}) => {
|
|
|
104
103
|
}
|
|
105
104
|
triggerEventOn("routeChanged", element, opts);
|
|
106
105
|
};
|
|
107
|
-
var
|
|
106
|
+
var index_default = router;
|
|
108
107
|
export {
|
|
109
|
-
|
|
108
|
+
index_default as default,
|
|
110
109
|
getActiveRoute,
|
|
111
110
|
lastLevel,
|
|
112
111
|
lastPathname,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/router",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.200",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@domql/event": "^2.5.
|
|
26
|
-
"@domql/utils": "^2.5.
|
|
25
|
+
"@domql/event": "^2.5.200",
|
|
26
|
+
"@domql/utils": "^2.5.200"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "0afb63ec375f0526f47ff300885de393138b01e8",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/core": "^7.12.0"
|
|
31
31
|
}
|