NeVeSpl / NTypewriter

File/code generator using Scriban text templates populated with C# code metadata from Roslyn API.
https://nevespl.github.io/NTypewriter/
MIT License
126 stars 25 forks source link

implement configurable nullable type, fixes #4 #6

Closed RudeySH closed 3 years ago

RudeySH commented 3 years ago

This PR resolves #4, it enables developers to customize the nullable postfix. Currently, the default is "null", but examples of postfixes that others might want to use are "undefined", "null | undefined", or even no postfix at all ("").

This PR also fixes arrays that have a nullable element type. It turns int | null[] into (int | null)[], and it also works with custom nullable postfixes of course. I could've used Array<...> instead, but I decided that because (...)[] is shorter, it's probably the preferred way to go.

RudeySH commented 3 years ago

Sorry, something went wrong. Give me a moment to redo this pull request cleanly.