@ktjs/router 0.14.9 → 0.14.10
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/index.d.ts +1 -1
- package/dist/index.iife.js +2 -2
- package/dist/index.legacy.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -168,7 +168,7 @@ declare function KTRouter({ router }: {
|
|
|
168
168
|
/**
|
|
169
169
|
* Create a new router instance
|
|
170
170
|
*/
|
|
171
|
-
declare const createRouter: ({ beforeEach, afterEach, onNotFound, onError, prefix, }: RouterConfig) => Router;
|
|
171
|
+
declare const createRouter: ({ beforeEach, afterEach, onNotFound, onError, prefix, routes: rawRoutes, }: RouterConfig) => Router;
|
|
172
172
|
|
|
173
173
|
export { GuardLevel, KTRouter, createRouter };
|
|
174
174
|
export type { NavOptions, RawRouteConfig, RouteConfig, RouteContext, RouteMatch, Router, RouterConfig };
|
package/dist/index.iife.js
CHANGED
|
@@ -162,7 +162,7 @@ var __ktjs_router__ = (function (exports) {
|
|
|
162
162
|
/**
|
|
163
163
|
* Create a new router instance
|
|
164
164
|
*/
|
|
165
|
-
const createRouter = ({ beforeEach = fn, afterEach = fn, onNotFound = fn, onError = fn, prefix = '', }) => {
|
|
165
|
+
const createRouter = ({ beforeEach = fn, afterEach = fn, onNotFound = fn, onError = fn, prefix = '', routes: rawRoutes, }) => {
|
|
166
166
|
// # private values
|
|
167
167
|
const routes = [];
|
|
168
168
|
const history = [];
|
|
@@ -417,7 +417,7 @@ var __ktjs_router__ = (function (exports) {
|
|
|
417
417
|
window.history.forward();
|
|
418
418
|
},
|
|
419
419
|
};
|
|
420
|
-
normalize(
|
|
420
|
+
normalize(rawRoutes, '/');
|
|
421
421
|
const { findByName, match } = createMatcher(routes);
|
|
422
422
|
const currentHash = window.location.hash.slice(1);
|
|
423
423
|
if (currentHash) {
|
package/dist/index.legacy.js
CHANGED
|
@@ -253,7 +253,7 @@ var __ktjs_router__ = (function (exports) {
|
|
|
253
253
|
* Create a new router instance
|
|
254
254
|
*/
|
|
255
255
|
var createRouter = function (_a) {
|
|
256
|
-
var _b = _a.beforeEach, beforeEach = _b === void 0 ? fn : _b, _c = _a.afterEach, afterEach = _c === void 0 ? fn : _c, _d = _a.onNotFound, onNotFound = _d === void 0 ? fn : _d, _e = _a.onError, onError = _e === void 0 ? fn : _e, _f = _a.prefix, prefix = _f === void 0 ? '' : _f;
|
|
256
|
+
var _b = _a.beforeEach, beforeEach = _b === void 0 ? fn : _b, _c = _a.afterEach, afterEach = _c === void 0 ? fn : _c, _d = _a.onNotFound, onNotFound = _d === void 0 ? fn : _d, _e = _a.onError, onError = _e === void 0 ? fn : _e, _f = _a.prefix, prefix = _f === void 0 ? '' : _f, rawRoutes = _a.routes;
|
|
257
257
|
// # private values
|
|
258
258
|
var routes = [];
|
|
259
259
|
var history = [];
|
|
@@ -550,7 +550,7 @@ var __ktjs_router__ = (function (exports) {
|
|
|
550
550
|
window.history.forward();
|
|
551
551
|
},
|
|
552
552
|
};
|
|
553
|
-
normalize(
|
|
553
|
+
normalize(rawRoutes, '/');
|
|
554
554
|
var _g = createMatcher(routes), findByName = _g.findByName, match = _g.match;
|
|
555
555
|
var currentHash = window.location.hash.slice(1);
|
|
556
556
|
if (currentHash) {
|
package/dist/index.mjs
CHANGED
|
@@ -159,7 +159,7 @@ function KTRouter({ router }) {
|
|
|
159
159
|
/**
|
|
160
160
|
* Create a new router instance
|
|
161
161
|
*/
|
|
162
|
-
const createRouter = ({ beforeEach = fn, afterEach = fn, onNotFound = fn, onError = fn, prefix = '', }) => {
|
|
162
|
+
const createRouter = ({ beforeEach = fn, afterEach = fn, onNotFound = fn, onError = fn, prefix = '', routes: rawRoutes, }) => {
|
|
163
163
|
// # private values
|
|
164
164
|
const routes = [];
|
|
165
165
|
const history = [];
|
|
@@ -414,7 +414,7 @@ const createRouter = ({ beforeEach = fn, afterEach = fn, onNotFound = fn, onErro
|
|
|
414
414
|
window.history.forward();
|
|
415
415
|
},
|
|
416
416
|
};
|
|
417
|
-
normalize(
|
|
417
|
+
normalize(rawRoutes, '/');
|
|
418
418
|
const { findByName, match } = createMatcher(routes);
|
|
419
419
|
const currentHash = window.location.hash.slice(1);
|
|
420
420
|
if (currentHash) {
|