Skip to content

Commit 5c7e7ef

Browse files
committed
fixed issue with union returns not unioning
1 parent c62e117 commit 5c7e7ef

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

lib/entry.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,13 @@ function getRelated() {
426426
*
427427
* @memberOf Entry
428428
* @returns {array} Returns the entry's `returns` data.
429-
*
430-
* @todo fix issue with union returns not unioning
431429
*/
432430
function getReturns() {
433431
var tag = getTag(this, 'returns');
434-
/*
435432
var unionReturn = (tag && 'type' in tag) ? getParamType(tag.type) : undefined;
436-
*/
437433
var
438434
desc = _.toString(_.get(tag, 'description')),
439-
type = _.toString(_.get(tag, 'type.name')) || '*';
435+
type = _.toString(_.get(tag, 'type.name')) || unionReturn || '*';
440436

441437
return tag ? [type, desc] : [];
442438
}

tests/fixtures/unions.github.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
1. `option` *(string[])|string)*: the option
3232

3333
#### Returns
34-
*(*)*: the result
34+
*(string|string[])*: the result
3535

3636
---
3737

@@ -48,7 +48,7 @@
4848
1. `option` *(||)*:
4949

5050
#### Returns
51-
*(*)*: reverse string
51+
*(Reverse|string)*: reverse string
5252

5353
---
5454

@@ -82,7 +82,7 @@
8282
1. `option` *(string[])|string)*: the option
8383

8484
#### Returns
85-
*(*)*: the result
85+
*(string[])|string)*: the result
8686

8787
---
8888

tests/fixtures/unions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
1. `option` *(string[])|string)*: the option
3232

3333
#### Returns
34-
*(*)*: the result
34+
*(string|string[])*: the result
3535

3636
---
3737

@@ -48,7 +48,7 @@
4848
1. `option` *(||)*:
4949

5050
#### Returns
51-
*(*)*: reverse string
51+
*(Reverse|string)*: reverse string
5252

5353
---
5454

@@ -82,7 +82,7 @@
8282
1. `option` *(string[])|string)*: the option
8383

8484
#### Returns
85-
*(*)*: the result
85+
*(string[])|string)*: the result
8686

8787
---
8888

tests/fixtures/unions.toc.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
1. `option` *(string[])|string)*: the option
3232

3333
#### Returns
34-
*(*)*: the result
34+
*(string|string[])*: the result
3535

3636
---
3737

@@ -48,7 +48,7 @@
4848
1. `option` *(||)*:
4949

5050
#### Returns
51-
*(*)*: reverse string
51+
*(Reverse|string)*: reverse string
5252

5353
---
5454

@@ -82,7 +82,7 @@
8282
1. `option` *(string[])|string)*: the option
8383

8484
#### Returns
85-
*(*)*: the result
85+
*(string[])|string)*: the result
8686

8787
---
8888

0 commit comments

Comments
 (0)