feat(csv-loader): expand custom type references in schemas
Allow custom type names to be expanded before parsing the schema string. This enables using declared types within complex structures like tuples or arrays. The original schema string is preserved for type generation to ensure the output uses the named type rather than the expanded inline definition.
This commit is contained in:
@@ -60,7 +60,8 @@ export function generateTypeDefinition(
|
||||
.map((config) => {
|
||||
const typeStr = config.declaredTypeName
|
||||
? config.declaredTypeName
|
||||
: schemaToTypeString(config.schema, resourceNames);
|
||||
: (config.schemaString ??
|
||||
schemaToTypeString(config.schema, resourceNames));
|
||||
return ` readonly ${config.name}: ${typeStr};`;
|
||||
})
|
||||
.join("\n");
|
||||
|
||||
Reference in New Issue
Block a user