Skip to content

Commit a6f0435

Browse files
committed
Fix coverage of array destructuring
1 parent ea8d47f commit a6f0435

9 files changed

+31
-5
lines changed

Diff for: lib/infer/params.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function paramToDoc(param, comment, i, prefix) {
2121
type: 'NameExpression',
2222
name: 'Object'
2323
};
24-
} else if (param.type == 'ArrayExpression') {
24+
} else if (param.type == 'ArrayPattern') {
2525
return {
2626
type: 'NameExpression',
2727
name: 'Array'

Diff for: test/fixture/es6-import.output.custom.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Similar, but with an array
3434

3535
**Parameters**
3636

37-
- `$0`
37+
- `$0` **Array**
3838
- `$0.a`
3939
- `$0.b`
4040
- `$0.c`

Diff for: test/fixture/es6-import.output.json

+4
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@
302302
{
303303
"title": "param",
304304
"name": "$0",
305+
"type": {
306+
"type": "NameExpression",
307+
"name": "Array"
308+
},
305309
"properties": [
306310
{
307311
"title": "param",

Diff for: test/fixture/es6-import.output.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Similar, but with an array
3434

3535
**Parameters**
3636

37-
- `$0`
37+
- `$0` **Array**
3838
- `$0.a`
3939
- `$0.b`
4040
- `$0.c`

Diff for: test/fixture/es6-import.output.md.json

+9
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,15 @@
560560
"type": "text",
561561
"value": " "
562562
},
563+
{
564+
"type": "strong",
565+
"children": [
566+
{
567+
"type": "text",
568+
"value": "Array"
569+
}
570+
]
571+
},
563572
{
564573
"type": "text",
565574
"value": " "

Diff for: test/fixture/es6.output.custom.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Similar, but with an array
3434

3535
**Parameters**
3636

37-
- `$0`
37+
- `$0` **Array**
3838
- `$0.a`
3939
- `$0.b`
4040
- `$0.c`

Diff for: test/fixture/es6.output.json

+4
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@
302302
{
303303
"title": "param",
304304
"name": "$0",
305+
"type": {
306+
"type": "NameExpression",
307+
"name": "Array"
308+
},
305309
"properties": [
306310
{
307311
"title": "param",

Diff for: test/fixture/es6.output.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Similar, but with an array
3434

3535
**Parameters**
3636

37-
- `$0`
37+
- `$0` **Array**
3838
- `$0.a`
3939
- `$0.b`
4040
- `$0.c`

Diff for: test/fixture/es6.output.md.json

+9
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,15 @@
560560
"type": "text",
561561
"value": " "
562562
},
563+
{
564+
"type": "strong",
565+
"children": [
566+
{
567+
"type": "text",
568+
"value": "Array"
569+
}
570+
]
571+
},
563572
{
564573
"type": "text",
565574
"value": " "

0 commit comments

Comments
 (0)