(value: T)
| 434 | } |
| 435 | |
| 436 | export function cloneSchemaForCodegen<T>(value: T): T { |
| 437 | if (Array.isArray(value)) { |
| 438 | return value.map((item) => cloneSchemaForCodegen(item)) as T; |
| 439 | } |
| 440 | |
| 441 | if (value && typeof value === "object") { |
| 442 | const source = value as Record<string, unknown>; |
| 443 | const result: Record<string, unknown> = {}; |
| 444 | |
| 445 | for (const [key, child] of Object.entries(source)) { |
| 446 | result[key] = cloneSchemaForCodegen(child); |
| 447 | } |
| 448 | |
| 449 | return result as T; |
| 450 | } |
| 451 | |
| 452 | return value; |
| 453 | } |
| 454 | |
| 455 | export function getEnumValueDescriptions(schema: JSONSchema7 | null | undefined): EnumValueDescriptions | undefined { |
| 456 | if (!schema || typeof schema !== "object") return undefined; |
no outgoing calls
no test coverage detected
searching dependent graphs…