File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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
1414export 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 } )
You can’t perform that action at this time.
0 commit comments