router-kit 0.1.6 → 0.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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export let routes = [];
|
|
2
1
|
function normalizeRoutes(inputRoutes) {
|
|
3
2
|
const normalizedRoutes = inputRoutes.map((route) => {
|
|
4
3
|
var _a, _b;
|
|
@@ -14,10 +13,13 @@ function normalizeRoutes(inputRoutes) {
|
|
|
14
13
|
}
|
|
15
14
|
return normalized;
|
|
16
15
|
});
|
|
17
|
-
routes =
|
|
18
|
-
|
|
16
|
+
routes.length = 0;
|
|
17
|
+
routes.push(...normalizedRoutes);
|
|
18
|
+
return routes;
|
|
19
19
|
}
|
|
20
20
|
function createRouter(inputRoutes) {
|
|
21
|
-
|
|
21
|
+
// normalize and mutate the exported `routes` array in-place
|
|
22
|
+
return normalizeRoutes(inputRoutes);
|
|
22
23
|
}
|
|
24
|
+
export const routes = [];
|
|
23
25
|
export default createRouter;
|
package/package.json
CHANGED