From 397ad0936dcab58d02f09aee225ac3a37a49ecad Mon Sep 17 00:00:00 2001 From: Nicola Del Gobbo Date: Fri, 6 Oct 2017 09:49:05 -0700 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Gibson Fahnestock Reviewed-By: Gireesh Punathil --- tools/doc/type-parser.js | 19 +++++++++---------- 1 file 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('<' + - typeTextFull + '>'); + typeLinks.push(` + <${typeTextFull}>`); } else { - typeLinks.push('<' + typeTextFull + - '>'); + typeLinks.push(`<${typeTextFull}>`); } } });