Reduce _.uniq in the lodash underscore build.

Former-commit-id: 12c8ee7a269dbaebbe4d05d902bfcc4bed193cec
This commit is contained in:
John-David Dalton
2012-10-20 20:16:39 -07:00
parent 850d55ab45
commit 1181cd2fd7
4 changed files with 45 additions and 40 deletions

View File

@@ -1188,6 +1188,11 @@
// simplify DOM node check from `_.isEqual`
source = source.replace(/(if *\(className *!= *objectClass).+?noNodeClass[\s\S]+?{/, '$1) {');
// remove arguments juggling from `_.uniq`
source = source.replace(matchFunction(source, 'uniq'), function(match) {
return match.replace(/(?: *\/\/.*\n)*( +)if *\(typeof isSorted[^}]+?}\n/, '');
});
// unexpose "exit early" feature from `_.forEach`, `_.forIn`, and `_.forOwn`
source = source.replace(/( +)var forEachIteratorOptions *=[\s\S]+?\n\1.+?;/, function(match) {
return match.replace(/=== *false\)/, '=== objectTypes)');