Skip to content

Commit

Permalink
chore: optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
phk422 committed Aug 30, 2024
1 parent 1e2e1c2 commit 428f663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/openapi-typescript/src/lib/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export function tsEnumMember(value: string | number, metadata: { name?: string;
if (invalidCharMatch[0] === name) {
name = `"${name}"`;
} else {
name = name.replace(JS_PROPERTY_INDEX_INVALID_CHARS_RE, (substring) => SPECIAL_CHARACTER_MAP[substring] || "_");
name = name.replace(JS_PROPERTY_INDEX_INVALID_CHARS_RE, (s) => s in SPECIAL_CHARACTER_MAP ? SPECIAL_CHARACTER_MAP[s] : "_");
}
}
}
Expand Down

0 comments on commit 428f663

Please sign in to comment.