diff options
author | Nicola Del Gobbo <nicoladelgobbo@gmail.com> | 2017-10-06 19:49:05 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2017-10-18 07:28:59 +0300 |
commit | 397ad0936dcab58d02f09aee225ac3a37a49ecad (patch) | |
tree | 64b14ac6f59fbc05fe478a31eab99235643b1fd3 /tools | |
parent | d96b2a7077941ec638b06fa5b67c0a46aba393ce (diff) |
tools: replace string concatenation with template
Replace string concatenation in tools/doc/type-parser.js
with template literals
PR-URL: https://github.com/nodejs/node/pull/15827
Reviewed-By: Ryan Graham <r.m.graham@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/doc/type-parser.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 4c2d29f2bf7..fd2fc708f07 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -1,8 +1,8 @@ 'use strict'; const nodeDocUrl = ''; const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/'; -const jsDocUrl = jsDocPrefix + 'Reference/Global_Objects/'; -const jsPrimitiveUrl = jsDocPrefix + 'Data_structures'; +const jsDocUrl = `${jsDocPrefix}Reference/Global_Objects/`; +const jsPrimitiveUrl = `${jsDocPrefix}Data_structures`; const jsPrimitives = { 'boolean': 'Boolean', 'integer': 'Number', // not a primitive, used for clarification @@ -22,10 +22,10 @@ const jsGlobalTypes = [ 'AsyncFunction', 'SharedArrayBuffer' ]; const typeMap = { - 'Iterable': jsDocPrefix + - 'Reference/Iteration_protocols#The_iterable_protocol', - 'Iterator': jsDocPrefix + - 'Reference/Iteration_protocols#The_iterator_protocol', + 'Iterable': + `${jsDocPrefix}Reference/Iteration_protocols#The_iterable_protocol`, + 'Iterator': + `${jsDocPrefix}Reference/Iteration_protocols#The_iterator_protocol`, 'Buffer': 'buffer.html#buffer_class_buffer', @@ -87,11 +87,10 @@ module.exports = { } if (typeUrl) { - typeLinks.push('<a href="' + typeUrl + '" class="type"><' + - typeTextFull + '></a>'); + typeLinks.push(` + <a href="${typeUrl}" class="type"><${typeTextFull}></a>`); } else { - typeLinks.push('<span class="type"><' + typeTextFull + - '></span>'); + typeLinks.push(`<span class="type"><${typeTextFull}></span>`); } } }); |