Make _(…) wrapper versions of _.first and _.last capable of returning wrapped and unwrapped values.

Former-commit-id: b30704c1ce359213aa09069b290ee55edfb3e33e
This commit is contained in:
John-David Dalton
2012-11-20 07:32:51 -08:00
parent bd4bff3b6b
commit b57fe466ce
4 changed files with 60 additions and 20 deletions

View File

@@ -1397,9 +1397,6 @@
});
});
// remove Lo-Dash specific `lodash.prototype` extensions
source = source.replace(/(?:\s*\/\/.*)*\n( *)forEach\(filter[\s\S]+?lodash\.[\s\S]+?\n\1}.+/, '');
// remove unneeded template related variables
source = removeVar(source, 'reComplexDelimiter');
source = removeVar(source, 'reEmptyStringLeading');
@@ -1419,6 +1416,11 @@
// remove `lodash.prototype.toString` and `lodash.prototype.valueOf` assignments
source = source.replace(/ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/g, '');
// remove `lodash.prototype` batch method assignments
source = source
.replace(/(?:\s*\/\/.*)*\n( *)forEach\(\['first'[\s\S]+?\n\1}.+/, '')
.replace(/(?:\s*\/\/.*)*\n( *)forEach\(filter[\s\S]+?lodash\.[\s\S]+?\n\1}.+/, '');
// remove unused features from `createBound`
if (buildMethods.indexOf('partial') == -1) {
source = source.replace(matchFunction(source, 'createBound'), function(match) {