Problem when using Record + optional types #152

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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@h13i32maru

h13i32maru Nov 1, 2015

Member

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

Member

h13i32maru commented Nov 1, 2015

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

@h13i32maru

This comment has been minimized.

Show comment
Hide comment
@h13i32maru

h13i32maru Nov 1, 2015

Member

I fixed this issue at v0.4.2.

Member

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