File tree Expand file tree Collapse file tree
packages/router-generator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -295,28 +295,28 @@ const splitPathRegex = /[/-]/g
295295const leadingDigitRegex = / ^ ( \d ) / g
296296
297297const toVariableSafeChar = ( char : string ) : string => {
298- if ( alphanumericRegex . test ( char ) ) {
299- return char // Keep alphanumeric characters and underscores as is
300- }
298+ if ( alphanumericRegex . test ( char ) ) {
299+ return char // Keep alphanumeric characters and underscores as is
300+ }
301301
302- // Replace special characters with meaningful text equivalents
303- switch ( char ) {
304- case '.' :
305- return 'Dot'
306- case '-' :
307- return 'Dash'
308- case '@' :
309- return 'At'
310- case '(' :
311- return '' // Removed since route groups use parentheses
312- case ')' :
313- return '' // Removed since route groups use parentheses
314- case ' ' :
315- return '' // Remove spaces
316- default :
317- return `Char${ char . charCodeAt ( 0 ) } ` // For any other characters
318- }
302+ // Replace special characters with meaningful text equivalents
303+ switch ( char ) {
304+ case '.' :
305+ return 'Dot'
306+ case '-' :
307+ return 'Dash'
308+ case '@' :
309+ return 'At'
310+ case '(' :
311+ return '' // Removed since route groups use parentheses
312+ case ')' :
313+ return '' // Removed since route groups use parentheses
314+ case ' ' :
315+ return '' // Remove spaces
316+ default :
317+ return `Char${ char . charCodeAt ( 0 ) } ` // For any other characters
319318 }
319+ }
320320
321321export function routePathToVariable ( routePath : string ) : string {
322322 const cleaned = removeUnderscores ( routePath )
You can’t perform that action at this time.
0 commit comments