Skip to content

Commit

Permalink
Escape backtick and template variable from type name
Browse files Browse the repository at this point in the history
  • Loading branch information
MacFJA committed Aug 20, 2023
1 parent 4f452f9 commit da4d5d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cli/src/metadataGeneration/typeResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,11 @@ export class TypeResolver {
.replace(/,/g, '.')
.replace(/'([^']*)'/g, '$1')
.replace(/"([^"]*)"/g, '$1')
.replace(/`([^`]*)`/g, '$1')
.replace(/&/g, '-and-')
.replace(/\|/g, '-or-')
.replace(/\[\]/g, '-Array')
.replace(/\$\{([^}]+)\}/g, '_$1') // ${variable} -> _variable
.replace(/{|}/g, '_') // SuccessResponse_{indexesCreated-number}_ -> SuccessResponse__indexesCreated-number__
.replace(/([a-z]+):([a-z]+)/gi, '$1-$2') // SuccessResponse_indexesCreated:number_ -> SuccessResponse_indexesCreated-number_
.replace(/;/g, '--')
Expand Down

0 comments on commit da4d5d6

Please sign in to comment.