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:
2026-04-22 19:23:49 +08:00
parent eef3dbfac8
commit 89be2783d1
2 changed files with 7 additions and 8 deletions
+4 -5
View File
@@ -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, ", ");
}
/**