Skip to content

Commit 0fa3873

Browse files
arvtmcw
authored andcommitted
Update Doctrine
Update Doctrine to 1.5 to pick up BooleanLiteralType. Make sure we can output html/md for BooleanLiteralType. Towards #512
1 parent efa76ef commit 0fa3873

6 files changed

+229
-1
lines changed

lib/output/util/format_type.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ function formatType(getHref, node) {
172172
case Syntax.StringLiteralType:
173173
return [u('inlineCode', JSON.stringify(node.value))];
174174
case Syntax.NumericLiteralType:
175+
case Syntax.BooleanLiteralType:
175176
return [u('inlineCode', String(node.value))];
176177

177178
default:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"concat-stream": "^1.5.0",
2323
"debounce": "^1.0.0",
2424
"disparity": "^2.0.0",
25-
"doctrine": "^1.3.0",
25+
"doctrine": "^1.5.0",
2626
"events": "^1.1.0",
2727
"extend": "^3.0.0",
2828
"get-comments": "^1.0.1",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** */
2+
function f(t: true, f: false): [true, false] {
3+
return [t, f];
4+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[
2+
{
3+
"description": "",
4+
"tags": [],
5+
"loc": {
6+
"start": {
7+
"line": 1,
8+
"column": 0
9+
},
10+
"end": {
11+
"line": 1,
12+
"column": 6
13+
}
14+
},
15+
"context": {
16+
"loc": {
17+
"start": {
18+
"line": 2,
19+
"column": 0
20+
},
21+
"end": {
22+
"line": 4,
23+
"column": 1
24+
}
25+
}
26+
},
27+
"errors": [],
28+
"name": "f",
29+
"kind": "function",
30+
"params": [
31+
{
32+
"title": "param",
33+
"name": "t",
34+
"lineNumber": 2,
35+
"type": {
36+
"type": "BooleanLiteralType",
37+
"value": true
38+
}
39+
},
40+
{
41+
"title": "param",
42+
"name": "f",
43+
"lineNumber": 2,
44+
"type": {
45+
"type": "BooleanLiteralType",
46+
"value": false
47+
}
48+
}
49+
],
50+
"returns": [
51+
{
52+
"type": {
53+
"type": "ArrayType",
54+
"elements": [
55+
{
56+
"type": "BooleanLiteralType",
57+
"value": true
58+
},
59+
{
60+
"type": "BooleanLiteralType",
61+
"value": false
62+
}
63+
]
64+
}
65+
}
66+
],
67+
"members": {
68+
"instance": [],
69+
"static": []
70+
},
71+
"path": [
72+
{
73+
"name": "f",
74+
"kind": "function"
75+
}
76+
],
77+
"namespace": "f"
78+
}
79+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2+
3+
# f
4+
5+
**Parameters**
6+
7+
- `t` **`true`**
8+
- `f` **`false`**
9+
10+
Returns **\[`true`, `false`]**
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"type": "root",
3+
"children": [
4+
{
5+
"type": "html",
6+
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
7+
},
8+
{
9+
"depth": 1,
10+
"type": "heading",
11+
"children": [
12+
{
13+
"type": "text",
14+
"value": "f"
15+
}
16+
]
17+
},
18+
{
19+
"type": "strong",
20+
"children": [
21+
{
22+
"type": "text",
23+
"value": "Parameters"
24+
}
25+
]
26+
},
27+
{
28+
"ordered": false,
29+
"type": "list",
30+
"children": [
31+
{
32+
"type": "listItem",
33+
"children": [
34+
{
35+
"type": "paragraph",
36+
"children": [
37+
{
38+
"type": "inlineCode",
39+
"value": "t"
40+
},
41+
{
42+
"type": "text",
43+
"value": " "
44+
},
45+
{
46+
"type": "strong",
47+
"children": [
48+
{
49+
"type": "inlineCode",
50+
"value": "true"
51+
}
52+
]
53+
},
54+
{
55+
"type": "text",
56+
"value": " "
57+
}
58+
]
59+
}
60+
]
61+
},
62+
{
63+
"type": "listItem",
64+
"children": [
65+
{
66+
"type": "paragraph",
67+
"children": [
68+
{
69+
"type": "inlineCode",
70+
"value": "f"
71+
},
72+
{
73+
"type": "text",
74+
"value": " "
75+
},
76+
{
77+
"type": "strong",
78+
"children": [
79+
{
80+
"type": "inlineCode",
81+
"value": "false"
82+
}
83+
]
84+
},
85+
{
86+
"type": "text",
87+
"value": " "
88+
}
89+
]
90+
}
91+
]
92+
}
93+
]
94+
},
95+
{
96+
"type": "paragraph",
97+
"children": [
98+
{
99+
"type": "text",
100+
"value": "Returns "
101+
},
102+
{
103+
"type": "strong",
104+
"children": [
105+
{
106+
"type": "text",
107+
"value": "["
108+
},
109+
{
110+
"type": "inlineCode",
111+
"value": "true"
112+
},
113+
{
114+
"type": "text",
115+
"value": ", "
116+
},
117+
{
118+
"type": "inlineCode",
119+
"value": "false"
120+
},
121+
{
122+
"type": "text",
123+
"value": "]"
124+
}
125+
]
126+
},
127+
{
128+
"type": "text",
129+
"value": " "
130+
}
131+
]
132+
}
133+
]
134+
}

0 commit comments

Comments
 (0)