@domql/router 2.5.200 → 2.5.203
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 +7 -6
- package/dist/esm/index.js +4 -3
- package/package.json +6 -6
package/dist/cjs/index.js
CHANGED
|
@@ -16,21 +16,22 @@ 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 router_exports = {};
|
|
20
|
+
__export(router_exports, {
|
|
21
|
+
default: () => router_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(router_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)
|
|
33
|
+
if (activeRoute)
|
|
34
|
+
return `/${activeRoute}`;
|
|
34
35
|
};
|
|
35
36
|
let lastPathname;
|
|
36
37
|
let lastLevel = 0;
|
|
@@ -114,4 +115,4 @@ const router = (path, el, state = {}, options = {}) => {
|
|
|
114
115
|
}
|
|
115
116
|
(0, import_event.triggerEventOn)("routeChanged", element, opts);
|
|
116
117
|
};
|
|
117
|
-
var
|
|
118
|
+
var router_default = router;
|
package/dist/esm/index.js
CHANGED
|
@@ -22,7 +22,8 @@ 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)
|
|
25
|
+
if (activeRoute)
|
|
26
|
+
return `/${activeRoute}`;
|
|
26
27
|
};
|
|
27
28
|
let lastPathname;
|
|
28
29
|
let lastLevel = 0;
|
|
@@ -103,9 +104,9 @@ const router = (path, el, state = {}, options = {}) => {
|
|
|
103
104
|
}
|
|
104
105
|
triggerEventOn("routeChanged", element, opts);
|
|
105
106
|
};
|
|
106
|
-
var
|
|
107
|
+
var router_default = router;
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
+
router_default as default,
|
|
109
110
|
getActiveRoute,
|
|
110
111
|
lastLevel,
|
|
111
112
|
lastPathname,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/router",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.203",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"build:esm": "npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm",
|
|
19
19
|
"build:cjs": "npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs",
|
|
20
20
|
"build:iife": "npx esbuild *.js --target=node16 --format=iife --outdir=dist/iife",
|
|
21
|
-
"build": "rimraf -I dist; npm run build:cjs; npm run build:esm",
|
|
22
|
-
"prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
21
|
+
"build": "npx rimraf -I dist; npm run build:cjs; npm run build:esm",
|
|
22
|
+
"prepublish": "npx 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.203",
|
|
26
|
+
"@domql/utils": "^2.5.203"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "f8c712416647ab3789253b7176eaa762627fc677",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/core": "^7.12.0"
|
|
31
31
|
}
|