File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const typeMap = {
4040 'http.ServerResponse' : 'http.html#http_class_http_serverresponse' ,
4141} ;
4242
43+ const arrayPart = / (?: \[ ] ) + $ / ;
44+
4345module . exports = {
4446 toLink : function ( typeInput ) {
4547 const typeLinks = [ ] ;
@@ -51,12 +53,10 @@ module.exports = {
5153 if ( typeText ) {
5254 let typeUrl = null ;
5355
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
5658 const typeTextFull = typeText ;
57- if ( / \[ ] $ / . test ( typeText ) ) {
58- typeText = typeText . slice ( 0 , - 2 ) ;
59- }
59+ typeText = typeText . replace ( arrayPart , '' ) ;
6060
6161 const primitive = jsPrimitives [ typeText . toLowerCase ( ) ] ;
6262
You can’t perform that action at this time.
0 commit comments