-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error parsing the jsdoc type expression "{number| {function(row?:any,index?:number): number}}" #221
Comments
@dalelotts - can you give me a bit more information. Is it the |
The library we use to parse the types is https://github.com/hegemonic/catharsis |
Call stack here:
|
OK, I'll take a look... |
Right! I can reproduce this in a unit test. It look like catharsis does not like this syntax... |
@dalelotts - it seems that you are using an invalid syntax. The correct syntax should not include the parameter names. For example the following test passes in dgeni-packages: it('should handle optional function params', function() {
value = '{number|function(?any,?number): number} some description';
value = transform(doc, tag, value);
expect(tag.typeList).toEqual([ 'number', 'function(?any, ?number): number' ]);
}); |
I'm trying to document a property that returns a number or a function - this seems to work with pure jsdocs but not here
* @type {number|function(row?:any,index?:number): number}
The property is defined as follows.
@Input() rowHeight: (number | ((row?: any, index?: number) => number)) = 0;
If I removing the
?
's it works, but I believe they will no longer appear as optional parameters.Any suggestions on how we can work around this?
The text was updated successfully, but these errors were encountered: