Aeson provides two functions, fieldLabelModifier and constructorTagModifier which are used to modify the names of fields and data constructor tags, aeson-typescript respects these but gives no control over the ability to modify the names of the interfaces and types it generates.
The main problem this causes happens when you want to generate types for two types from different qualified modules, for example:
Which will create a file with two duplicate types:
// From the first derivation.
type Example = IExample;
interface IExample { ... };
// From the second derivation.
type Example = IExample;
interface IExample { ... }
This PR adds two modifier functions similar to aeson's to FormattingOptions, adding these gives the ability to modify record type names in any way you need. Either automatically with generics or just manually such as:
Aeson provides two functions,
fieldLabelModifier
andconstructorTagModifier
which are used to modify the names of fields and data constructor tags,aeson-typescript
respects these but gives no control over the ability to modify the names of the interfaces and types it generates.The main problem this causes happens when you want to generate types for two types from different qualified modules, for example:
Which will create a file with two duplicate types:
This PR adds two modifier functions similar to aeson's to
FormattingOptions
, adding these gives the ability to modify record type names in any way you need. Either automatically with generics or just manually such as:To produce: