mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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>
This commit is contained in:
1 parent
2ddb2fad94
commit
8c6c060918
1 file changed
+9
-10
@@ -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>`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user