schemats
schemats copied to clipboard
Separate camel caseing options
I created separate options for camelCaseing type names and column names.
Use case: I wanted camelCased type names for aesthetic and readability reasons while keeping the structural integrate type checking provided by non-modified column names.
I have added tests accordingly. I had to add 2 type assertions in the cli
integration test due to a strict undefined checking error, but since the test is skipped if the concerning variable is undefined this shouldn't cause any issues.
I was just about to add this myself, for the same reasons you cited. For what it's worth, I checked your code and it all looks good.
Rather than adding two more options, did you consider overloading the existing camelCase
option with columns
and types
string values? Like this:
export type OptionValues = {
camelCase?: boolean | 'columns' | 'types';
writeHeader?: boolean;
}
I think this shouldn't present any compatibility concerns, and it has a smaller API surface area.
To be honest I didn't think about that, of course that's a way better solution (in my defense, it was very late...) I have implemented this new system now.