A pretty simply array that can have both strings and numbers can be shown as (string | number)[], but is being output as string | number without any union'ing going on - specifically noticed with this -
function regex(regexp: RegExp): string | number | (string | number)[] {
}
Outputting as this -
regex(regexp: RegExp): string | number | string | number
Didn't find anything on searches for "union", but Friday rush so apologies if I missed something.
Stepping through the code, this reflection's type property is being set to a Union type and the type's isArray property is set to true, so it looks like it's an issue in the theme code not checking for isArray. I added a pull request to that repo to fix this issue.
@nicknisi Do you think there's a better way we can do some of this? I know there's a way to serialise the types into strings, do you think we can do that and remove the custom stringification process that TypeDoc does?
@blakeembrey I think we can for sure. TypeScript's checker has a typeToString method that gives us the exactly what we'd need for the type string. I'll try out making the switch.
I believe this was closed in TypeStrong/typedoc-default-themes#37
Thanks @nicknisi! :tada: