Fixes #15. This PR is a little more intrusive/comprehensive than #16.
This moves all pluralization-related logic for type-generation in TypeScript into the genTypeScriptFieldType method. This required changing the method signature.
I did not change any of the other languages. This approach would not be appropriate for C, where the type and its "pluralization" ([]) are separated by the name of the field.
Related Issue
15
Motivation and Context
There is a lot of repetitive code for handling the Array<> logic. This PR simplifies the code and should make the behavior more consistent.
How Has This Been Tested
The TS reference output has been updated and matches the version in #16.
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Also, some refactoring
Checklist
[x] My code follows the code style of this project.
caveat: TS code-gen is now a little less similar to the other code-gen
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.
[x] All new and existing tests passed.
Note: The branch name does not include the issue number. If the suggested fix is welcome but the branch name is a blocker, please let me know and I'll fix it.
Description
Fixes #15. This PR is a little more intrusive/comprehensive than #16.
This moves all pluralization-related logic for type-generation in TypeScript into the
genTypeScriptFieldType
method. This required changing the method signature.I did not change any of the other languages. This approach would not be appropriate for C, where the type and its "pluralization" (
[]
) are separated by the name of the field.Related Issue
15
Motivation and Context
There is a lot of repetitive code for handling the
Array<>
logic. This PR simplifies the code and should make the behavior more consistent.How Has This Been Tested
The TS reference output has been updated and matches the version in #16.
Types of changes
Also, some refactoring
Checklist
Note: The branch name does not include the issue number. If the suggested fix is welcome but the branch name is a blocker, please let me know and I'll fix it.