Skip to content

Commit ecbbe1b

Browse files
committed
fix(routes-gen): fixed dash delimiters in routes generation
1 parent ab5c7d1 commit ecbbe1b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/routes-gen/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# routes-gen
22

3+
## 0.3.2
4+
5+
### Patch Changes
6+
7+
- Fixed dash delimiters in routes generation.
8+
39
## 0.3.1
410

511
### Patch Changes

packages/routes-gen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "routes-gen",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"license": "MIT",

packages/routes-gen/src/export-routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const extractPathParams = (path: Route["path"]) =>
88
? path
99
.split("/")
1010
.filter((item) => item.includes(":"))
11-
.map((item) => `${item.split(".")[0].substring(1)}`)
11+
.map((item) => item.split(".")[0].split("-")[0].substring(1))
1212
: [];
1313

1414
export const exportRoutes = ({
@@ -34,7 +34,7 @@ export const exportRoutes = ({
3434

3535
return ` "${route.path}": ${
3636
params.length > 0
37-
? `{ ${params.map((path) => `${path}: string`).join(", ")} }`
37+
? `{ ${params.map((path) => `"${path}": string`).join(", ")} }`
3838
: "{}"
3939
};`;
4040
})

0 commit comments

Comments
 (0)