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