diff --git a/packages/routes-gen/CHANGELOG.md b/packages/routes-gen/CHANGELOG.md index 700f50e..19de4c8 100644 --- a/packages/routes-gen/CHANGELOG.md +++ b/packages/routes-gen/CHANGELOG.md @@ -1,5 +1,11 @@ # routes-gen +## 0.3.2 + +### Patch Changes + +- Fixed dash delimiters in routes generation. + ## 0.3.1 ### Patch Changes diff --git a/packages/routes-gen/package.json b/packages/routes-gen/package.json index a2adb16..c8caba1 100644 --- a/packages/routes-gen/package.json +++ b/packages/routes-gen/package.json @@ -1,6 +1,6 @@ { "name": "routes-gen", - "version": "0.3.1", + "version": "0.3.2", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", diff --git a/packages/routes-gen/src/export-routes.ts b/packages/routes-gen/src/export-routes.ts index 5031f6f..7314c94 100644 --- a/packages/routes-gen/src/export-routes.ts +++ b/packages/routes-gen/src/export-routes.ts @@ -8,7 +8,7 @@ const extractPathParams = (path: Route["path"]) => ? path .split("/") .filter((item) => item.includes(":")) - .map((item) => `${item.split(".")[0].substring(1)}`) + .map((item) => item.split(".")[0].split("-")[0].substring(1)) : []; export const exportRoutes = ({ @@ -34,7 +34,7 @@ export const exportRoutes = ({ return ` "${route.path}": ${ params.length > 0 - ? `{ ${params.map((path) => `${path}: string`).join(", ")} }` + ? `{ ${params.map((path) => `"${path}": string`).join(", ")} }` : "{}" };`; })