react-query-lightbase-codegen 2.5.0 → 2.5.1
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.
- package/dist/utils.js +5 -1
- package/package.json +1 -1
- package/src/utils.ts +5 -1
package/dist/utils.js
CHANGED
|
@@ -52,7 +52,11 @@ function sanitizeTypeName(name) {
|
|
|
52
52
|
return pascalCase(name.replace(/[^a-zA-Z0-9_]/g, "_").replace(/_+$/, ""));
|
|
53
53
|
}
|
|
54
54
|
function specTitle(spec) {
|
|
55
|
-
|
|
55
|
+
const title = spec.info.title ?? "openAPi";
|
|
56
|
+
if (!spec.info.title) {
|
|
57
|
+
console.warn("No title found in OpenAPI spec, using 'openAPi' as default");
|
|
58
|
+
}
|
|
59
|
+
return camelCase(title.toLowerCase().replace(/\s+/g, "-"));
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
58
62
|
* Converts an OpenAPI schema object into a TypeScript type string.
|
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -50,7 +50,11 @@ export function sanitizeTypeName(name: string): string {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export function specTitle(spec: OpenAPIV3.Document): string {
|
|
53
|
-
|
|
53
|
+
const title = spec.info.title ?? "openAPi";
|
|
54
|
+
if (!spec.info.title) {
|
|
55
|
+
console.warn("No title found in OpenAPI spec, using 'openAPi' as default");
|
|
56
|
+
}
|
|
57
|
+
return camelCase(title.toLowerCase().replace(/\s+/g, "-"));
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
/**
|