fix(csv-loader): use commas in generated type declarations
Update `type-gen.ts` to replace semicolons with commas in the generated TypeScript type definitions to ensure valid syntax.
This commit is contained in:
@@ -6,15 +6,14 @@ function resolveReferencesInSchemaString(
|
||||
schemaString: string,
|
||||
resourceNames: Map<string, string>,
|
||||
): string {
|
||||
return schemaString.replace(
|
||||
/@([a-zA-Z0-9\-_]+)(\[\])?/g,
|
||||
(_match, tableName, arraySuffix) => {
|
||||
return schemaString
|
||||
.replace(/@([a-zA-Z0-9\-_]+)(\[\])?/g, (_match, tableName, arraySuffix) => {
|
||||
const typeName =
|
||||
resourceNames.get(tableName) ||
|
||||
tableName.charAt(0).toUpperCase() + tableName.slice(1);
|
||||
return arraySuffix ? `${typeName}[]` : typeName;
|
||||
},
|
||||
);
|
||||
})
|
||||
.replace(/; ?/g, ", ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user