mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
lodash: Fix JSDoc entries, rename private constructor Lodash to LoDash, and optimize wrapper methods. [jddalton]
Former-commit-id: 1a2541900aa93c4c19c1eee12132bce89200b564
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
'isFunc',
|
||||
'length',
|
||||
'object',
|
||||
'Math',
|
||||
'noaccum',
|
||||
'prop',
|
||||
'property',
|
||||
@@ -166,6 +165,7 @@
|
||||
// minify snippet variables/arguments
|
||||
compiledVars.forEach(function(variable, index) {
|
||||
result = result.replace(RegExp('([^.]\\b|\\\\n)' + variable + '\\b(?!\'\\s*[\\]:])', 'g'), '$1' + minNames[index]);
|
||||
|
||||
// correct `typeof x == 'object'`
|
||||
if (variable == 'object') {
|
||||
result = result.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), "$1object'");
|
||||
@@ -176,6 +176,10 @@
|
||||
.replace(RegExp(':\\s*' + minNames[index] + '\\s*,', 'g'), ':' + variable + ',')
|
||||
.replace(RegExp('\\s*' + minNames[index] + '\\s*;', 'g'), variable + ';');
|
||||
}
|
||||
if (variable == 'slice') {
|
||||
// correct `slice.call(arguments)`
|
||||
result = result.replace(RegExp('\\b' + minNames[index] + '(\\.call\\(arguments\\))'), 'slice$1');
|
||||
}
|
||||
});
|
||||
|
||||
// minify snippet values
|
||||
|
||||
Reference in New Issue
Block a user