@qualisero/openapi-endpoint 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +3 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -324,8 +324,10 @@ function toEnumMemberName(value) {
324
324
  // For non-identifier strings, replace special characters with underscores
325
325
  const cleaned = toPascalCase(value.replace(/[^a-zA-Z0-9_$]/g, '_'));
326
326
  // If the result is empty or still invalid, prefix with underscore to make it valid
327
+ // Sanitize the full value to ensure unique identifiers for enum members
327
328
  if (cleaned.length === 0 || !/^[a-zA-Z_$]/.test(cleaned)) {
328
- return `_Char${value.charCodeAt(0)}`;
329
+ const sanitized = String(value).replace(/[^a-zA-Z0-9_$]/g, '_');
330
+ return sanitized.length > 0 ? `_${sanitized}` : '_Empty';
329
331
  }
330
332
  return cleaned;
331
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qualisero/openapi-endpoint",
3
- "version": "0.19.1",
3
+ "version": "0.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/qualisero/openapi-endpoint.git"