catharsis
catharsis copied to clipboard
Type-expression parser should handle nested type unions without enclosing in parentheses.
Lodash is looking into using jsdoc and we're running into issues
The type-expression parser doesn't handle nested type unions unless all of the type unions are enclosed in parentheses. So for example this fails:
{Function|...(string|string[])}
but this is ok
{(Function|...(string|string[]))}
I'm open to implementing this, but I think I tried once already and ended up flailing. You might be better off biting the bullet and enclosing your type unions in parentheses, as in the second example.
Wouldn't be too difficult to do a global search & replace for future releases, but there still remains the concern of generating documentation for releases that have already been published. For this, there would need to be some sort of preprocessing layer in order to correctly generate the markdown for legacy releases.