diff --git a/packages/ng-openapi-gen/src/lib/utils/string.ts b/packages/ng-openapi-gen/src/lib/utils/string.ts index a897172..2e15750 100644 --- a/packages/ng-openapi-gen/src/lib/utils/string.ts +++ b/packages/ng-openapi-gen/src/lib/utils/string.ts @@ -60,8 +60,7 @@ export function refName(fullRef: string): string { /** Escapes the name of a property / parameter if not valid JS identifier */ export function escapeId(name: string) { - // eslint-disable-next-line unicorn/better-regex - return /^[a-zA-Z]\w+$/.test(name) ? name : `'${name.replace(/'/g, "\\'")}'`; + return /^[A-Za-z]\w*$/.test(name) ? name : `'${name.replace(/'/g, "\\'")}'`; } /** Returns the TypeScript comments for the given schema description, in a given indentation level */