Skip to content
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

Problem when using Record + optional types #152

Closed
dlmr opened this issue Oct 27, 2015 · 2 comments
Closed

Problem when using Record + optional types #152

dlmr opened this issue Oct 27, 2015 · 2 comments

Comments

@dlmr
Copy link

@dlmr dlmr commented Oct 27, 2015

There is an error when using Record along with different types. Or maybe this is not something that is supported by choice?

Example

/**
 * @param {{bar: (string|string[])}} options - this is object param.
 */
export function foo(options = {}) {}

The following errors is thrown when bulding the docs.

esdoc/out/src/Publisher/Builder/DocBuilder.js:469
            throw _iteratorError2;
            ^

SyntaxError: Invalid regular expression: /[~]\{bar: (string$/: Unterminated group
    at RegExp (native)

Looked a bit more into this and the issue above is because of the parenthesis, however removing them results in a lint error about invalid JSDoc (might not be relevant for ESDoc).

/**
 * @param {{bar: string|string[]}} options - this is object param.
 */
export function foo(options = {}) {}

The output becomes.

Name Type Attribute Description
options {bar: string string[]}

And not the expected.

Name Type Attribute Description
options {bar: string string[]}
h13i32maru added a commit that referenced this issue Nov 1, 2015
@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Nov 1, 2015

@dlmr Hi. Thanks for this issue. This is ESDoc bug. I will fix this.

@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Nov 1, 2015

I fixed this issue at v0.4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.