vovk-cli 0.0.1-draft.272 → 0.0.1-draft.275
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
3
3
|
interface CompileOptions {
|
|
4
4
|
name: string;
|
|
5
5
|
schema: JSONSchema7 & {
|
package/dist/utils/compileTs.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import camelCase from 'lodash/camelCase.js';
|
|
2
1
|
import upperFirst from 'lodash/upperFirst.js';
|
|
2
|
+
import camelCase from 'lodash/camelCase.js';
|
|
3
3
|
export function compileTs(options) {
|
|
4
4
|
const context = {
|
|
5
5
|
refs: options.refs || new Map(),
|
|
@@ -236,11 +236,11 @@ function refToTypeName(ref) {
|
|
|
236
236
|
// Extract the last part of the reference as the type name
|
|
237
237
|
const parts = ref.split('/');
|
|
238
238
|
const name = parts[parts.length - 1];
|
|
239
|
+
// Convert kebab-case to PascalCase
|
|
239
240
|
return upperFirst(camelCase(name));
|
|
240
241
|
}
|
|
241
|
-
// Update the capitalize function to use lodash methods for consistency
|
|
242
242
|
function capitalize(str) {
|
|
243
|
-
return
|
|
243
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
244
244
|
}
|
|
245
245
|
function wrapUnionType(type) {
|
|
246
246
|
// Wrap union types in parentheses for array types
|