lodash: Fix JSDoc entries, rename private constructor Lodash to LoDash, and optimize wrapper methods. [jddalton]

Former-commit-id: 1a2541900aa93c4c19c1eee12132bce89200b564
This commit is contained in:
John-David Dalton
2012-05-07 13:58:51 -04:00
parent 21b86980a7
commit 88e754850d
4 changed files with 190 additions and 159 deletions

View File

@@ -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