mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Apply template string transform.
This commit is contained in:
@@ -10,14 +10,14 @@ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
|
||||
* @returns {string} Returns the modified source.
|
||||
*/
|
||||
function insertWrapDetails(source, details) {
|
||||
var length = details.length;
|
||||
const length = details.length;
|
||||
if (!length) {
|
||||
return source;
|
||||
}
|
||||
var lastIndex = length - 1;
|
||||
const lastIndex = length - 1;
|
||||
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
|
||||
details = details.join(length > 2 ? ', ' : ' ');
|
||||
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
|
||||
return source.replace(reWrapComment, `{\n/* [wrapped with ${ details }] */\n`);
|
||||
}
|
||||
|
||||
export default insertWrapDetails;
|
||||
|
||||
Reference in New Issue
Block a user