File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const typeMap = {
40
40
'http.ServerResponse' : 'http.html#http_class_http_serverresponse' ,
41
41
} ;
42
42
43
+ const arrayPart = / (?: \[ ] ) + $ / ;
44
+
43
45
module . exports = {
44
46
toLink : function ( typeInput ) {
45
47
const typeLinks = [ ] ;
@@ -51,12 +53,10 @@ module.exports = {
51
53
if ( typeText ) {
52
54
let typeUrl = null ;
53
55
54
- // To support type[], we store the full string and use
55
- // the bracket-less version to lookup the type URL
56
+ // To support type[], type[][] etc., we store the full string
57
+ // and use the bracket-less version to lookup the type URL
56
58
const typeTextFull = typeText ;
57
- if ( / \[ ] $ / . test ( typeText ) ) {
58
- typeText = typeText . slice ( 0 , - 2 ) ;
59
- }
59
+ typeText = typeText . replace ( arrayPart , '' ) ;
60
60
61
61
const primitive = jsPrimitives [ typeText . toLowerCase ( ) ] ;
62
62
You can’t perform that action at this time.
0 commit comments