diff --git a/package.json b/package.json index 652d869..70593f4 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "babel-core": "^5.0.0", "brfs": "^1.4.0", "concat-stream": "^1.5.0", - "doctrine": "^0.7.0", + "doctrine": "^0.7.1", "documentation-theme-default": "^1.0.0", "extend": "^3.0.0", "get-comments": "^1.0.1", diff --git a/test/fixture/optional.input.js b/test/fixture/optional.input.js index 22f0b80..2f8d1f2 100644 --- a/test/fixture/optional.input.js +++ b/test/fixture/optional.input.js @@ -4,6 +4,7 @@ * @param {string} address - An IPv6 address string * @param {number} [groups=8] - How many octets to parse * @param {?number} third - A third argument + * @param {Array} [foo=[1]] to properly be parsed * @example * var address = new Address6('2001::/32'); */ diff --git a/test/fixture/optional.output.custom.md b/test/fixture/optional.output.custom.md index 30d06ec..fe4a2e3 100644 --- a/test/fixture/optional.output.custom.md +++ b/test/fixture/optional.output.custom.md @@ -7,6 +7,7 @@ Represents an IPv6 address - `address` **string** An IPv6 address string - `groups` **[number]** How many octets to parse (optional, default `8`) - `third` **[number]** A third argument +- `foo` **[Array]** to properly be parsed (optional, default `[1]`) **Examples** diff --git a/test/fixture/optional.output.json b/test/fixture/optional.output.json index 9ed6685..564d65d 100644 --- a/test/fixture/optional.output.json +++ b/test/fixture/optional.output.json @@ -47,10 +47,24 @@ }, "name": "third" }, + { + "title": "param", + "description": "to properly be parsed", + "lineNumber": 6, + "type": { + "type": "OptionalType", + "expression": { + "type": "NameExpression", + "name": "Array" + } + }, + "name": "foo", + "default": "[1]" + }, { "title": "example", "description": "var address = new Address6('2001::/32');", - "lineNumber": 6 + "lineNumber": 7 } ], "loc": { @@ -59,7 +73,7 @@ "column": 0 }, "end": { - "line": 9, + "line": 10, "column": 3 } }, @@ -70,7 +84,7 @@ "column": 0 }, "end": { - "line": 10, + "line": 11, "column": 0 } } @@ -117,6 +131,20 @@ "prefix": true }, "name": "third" + }, + { + "title": "param", + "description": "to properly be parsed", + "lineNumber": 6, + "type": { + "type": "OptionalType", + "expression": { + "type": "NameExpression", + "name": "Array" + } + }, + "name": "foo", + "default": "[1]" } ], "examples": [ diff --git a/test/fixture/optional.output.md b/test/fixture/optional.output.md index 30d06ec..fe4a2e3 100644 --- a/test/fixture/optional.output.md +++ b/test/fixture/optional.output.md @@ -7,6 +7,7 @@ Represents an IPv6 address - `address` **string** An IPv6 address string - `groups` **[number]** How many octets to parse (optional, default `8`) - `third` **[number]** A third argument +- `foo` **[Array]** to properly be parsed (optional, default `[1]`) **Examples** diff --git a/test/fixture/optional.output.md.json b/test/fixture/optional.output.md.json index 7e95c25..38bd40b 100644 --- a/test/fixture/optional.output.md.json +++ b/test/fixture/optional.output.md.json @@ -257,6 +257,85 @@ ] } ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "foo" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "[Array]" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "to properly be parsed", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "[1]" + }, + { + "type": "text", + "value": ")" + } + ] + } + ] + } + ] } ] },