nuxt-typed-router
Advanced tools
Comparing version 0.2.21 to 0.2.22
@@ -15,3 +15,3 @@ "use strict"; | ||
this.extendRoutes(async (routes) => { | ||
utils_1.transformRouteNames(routes, stripAtFromName); | ||
(0, utils_1.transformRouteNames)(routes, stripAtFromName); | ||
let routesObjectString = '{'; | ||
@@ -21,3 +21,3 @@ let routeObjectJs = {}; | ||
const routeName = route.name; | ||
const matchingSiblings = utils_1.extractMatchingSiblings(route, siblings); | ||
const matchingSiblings = (0, utils_1.extractMatchingSiblings)(route, siblings); | ||
const haveMatchingSiblings = !!(matchingSiblings === null || matchingSiblings === void 0 ? void 0 : matchingSiblings.length); | ||
@@ -29,6 +29,6 @@ if ((route.children && !haveMatchingSiblings) || | ||
const parentPath = splittedPaths[splittedPaths.length - 1]; | ||
const nameKey = lodash_1.camelCase(parentPath || 'index'); | ||
const nameKey = (0, lodash_1.camelCase)(parentPath || 'index'); | ||
routesObjectString += `${nameKey}:{`; | ||
routeObject[nameKey] = {}; | ||
childrenChunks === null || childrenChunks === void 0 ? void 0 : childrenChunks.map((r) => recursiveTypedRoutes(r, level + 1, routeObject[nameKey], utils_1.extractUnMatchingSiblings(route, siblings), nameKey, haveMatchingSiblings)); | ||
childrenChunks === null || childrenChunks === void 0 ? void 0 : childrenChunks.map((r) => recursiveTypedRoutes(r, level + 1, routeObject[nameKey], (0, utils_1.extractUnMatchingSiblings)(route, siblings), nameKey, haveMatchingSiblings)); | ||
routesObjectString += '},'; | ||
@@ -42,3 +42,3 @@ } | ||
} | ||
const keyName = lodash_1.camelCase(splitted.join('-')) || 'index'; | ||
const keyName = route.path === '' ? 'index' : (0, lodash_1.camelCase)(splitted.join('-')) || 'index'; | ||
routesObjectString += `'${keyName}': '${routeName}',`; | ||
@@ -51,3 +51,3 @@ routeObject[keyName] = routeName; | ||
const templateRoutes = `export const ${routesObjectName} = ${routesObjectString};`; | ||
await save_1.saveRoutesFiles(filePath, templateRoutes); | ||
await (0, save_1.saveRoutesFiles)(filePath, templateRoutes); | ||
}); | ||
@@ -54,0 +54,0 @@ } |
{ | ||
"name": "nuxt-typed-router", | ||
"version": "0.2.21", | ||
"version": "0.2.22", | ||
"description": "Provide autocompletion for pages route names generated by Nuxt router", | ||
@@ -5,0 +5,0 @@ "main": "lib/module.js", |
16962