tools: replace concat with template literals · nodejs/node@15ae5a4
@@ -11,7 +11,7 @@ const marked = require('marked');
1111// customized heading without id attribute
1212var renderer = new marked.Renderer();
1313renderer.heading = function(text, level) {
14-return '<h' + level + '>' + text + '</h' + level + '>\n';
14+return `<h${level}>${text}</h${level}>\n`;
1515};
1616marked.setOptions({
1717renderer: renderer
@@ -225,25 +225,25 @@ function processList(section) {
225225} else if (type === 'list_item_end') {
226226if (!current) {
227227throw new Error('invalid list - end without current item\n' +
228-JSON.stringify(tok) + '\n' +
228+`${JSON.stringify(tok)}\n` +
229229JSON.stringify(list));
230230}
231231current = stack.pop();
232232} else if (type === 'text') {
233233if (!current) {
234234throw new Error('invalid list - text without current item\n' +
235-JSON.stringify(tok) + '\n' +
235+`${JSON.stringify(tok)}\n` +
236236JSON.stringify(list));
237237}
238238current.textRaw = current.textRaw || '';
239-current.textRaw += tok.text + ' ';
239+current.textRaw += `${tok.text} `;
240240}
241241});
242242243243// shove the name in there for properties, since they are always
244244// just going to be the value etc.
245245if (section.type === 'property' && values[0]) {
246-values[0].textRaw = '`' + section.name + '` ' + values[0].textRaw;
246+values[0].textRaw = `\`${section.name}\` ${values[0].textRaw}`;
247247}
248248249249// now pull the actual values out of the text bits.
@@ -345,8 +345,8 @@ function parseSignature(text, sig) {
345345// at this point, the name should match.
346346if (p !== param.name) {
347347console.error('Warning: invalid param "%s"', p);
348-console.error(' > ' + JSON.stringify(param));
349-console.error(' > ' + text);
348+console.error(` > ${JSON.stringify(param)}`);
349+console.error(` > ${text}`);
350350}
351351if (optional) param.optional = true;
352352if (def !== undefined) param.default = def;
@@ -411,7 +411,7 @@ function parseListItem(item) {
411411function finishSection(section, parent) {
412412if (!section || !parent) {
413413throw new Error('Invalid finishSection call\n' +
414-JSON.stringify(section) + '\n' +
414+`${JSON.stringify(section)}\n` +
415415JSON.stringify(parent));
416416}
417417@@ -471,11 +471,11 @@ function finishSection(section, parent) {
471471472472var plur;
473473if (section.type.slice(-1) === 's') {
474-plur = section.type + 'es';
474+plur = `${section.type}es`;
475475} else if (section.type.slice(-1) === 'y') {
476476plur = section.type.replace(/y$/, 'ies');
477477} else {
478-plur = section.type + 's';
478+plur = `${section.type}s`;
479479}
480480481481// if the parent's type is 'misc', then it's just a random