Skip to content

Commit

Permalink
Merge pull request #915 from samchon/features/migrate
Browse files Browse the repository at this point in the history
Upgrade `@nestia/migrate` for special characters' escaping.
  • Loading branch information
samchon authored Jun 13, 2024
2 parents f1ad7de + b4aaf62 commit a78b573
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/migrate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/migrate",
"version": "0.13.14",
"version": "0.13.16",
"description": "Migration program from swagger to NestJS",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/migrate/src/utils/StringUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ export namespace StringUtil {
export const escapeNonVariableSymbols = (str: string): string => {
for (const [before, after] of VARIABLE_REPLACERS)
str = str.split(before).join(after);
for (let i: number = 0; i <= 9; ++i)
if (str[0] === i.toString()) {
str = "_" + str;
break;
}
str = str.trim();
if (str === "") return "_empty_";
return str;
};
}
Expand Down Expand Up @@ -92,4 +99,5 @@ const VARIABLE_REPLACERS: [string, string][] = [
["?", "_question_"],
[":", "_colon_"],
[";", "_semicolon_"],
["...", "_rest_"],
];
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@mui/icons-material": "5.15.6",
"@mui/material": "5.15.6",
"@mui/system": "5.15.6",
"@nestia/migrate": "^0.13.14",
"@nestia/migrate": "^0.13.16",
"@samchon/openapi": "^0.1.22",
"@stackblitz/sdk": "^1.9.0",
"js-yaml": "^4.1.0",
Expand Down

0 comments on commit a78b573

Please sign in to comment.