diff options
Diffstat (limited to 'tools/eslint/node_modules/lodash/_insertWrapDetails.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/_insertWrapDetails.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/eslint/node_modules/lodash/_insertWrapDetails.js b/tools/eslint/node_modules/lodash/_insertWrapDetails.js index 191f226de6..e790808646 100644 --- a/tools/eslint/node_modules/lodash/_insertWrapDetails.js +++ b/tools/eslint/node_modules/lodash/_insertWrapDetails.js @@ -10,9 +10,11 @@ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { - var length = details.length, - lastIndex = length - 1; - + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); |