Bump to v4.0.0.

This commit is contained in:
John-David Dalton
2015-08-24 10:34:23 -07:00
parent 4ef16c96e5
commit 0646bacd86
665 changed files with 24828 additions and 19696 deletions

View File

@@ -1,5 +1,6 @@
var LazyWrapper = require('./LazyWrapper'),
arrayPush = require('./arrayPush');
arrayPush = require('./arrayPush'),
arrayReduce = require('./arrayReduce');
/**
* The base implementation of `wrapperValue` which returns the result of
@@ -8,7 +9,7 @@ var LazyWrapper = require('./LazyWrapper'),
*
* @private
* @param {*} value The unwrapped value.
* @param {Array} actions Actions to peform to resolve the unwrapped value.
* @param {Array} actions Actions to perform to resolve the unwrapped value.
* @returns {*} Returns the resolved value.
*/
function baseWrapperValue(value, actions) {
@@ -16,14 +17,9 @@ function baseWrapperValue(value, actions) {
if (result instanceof LazyWrapper) {
result = result.value();
}
var index = -1,
length = actions.length;
while (++index < length) {
var action = actions[index];
result = action.func.apply(action.thisArg, arrayPush([result], action.args));
}
return result;
return arrayReduce(actions, function(result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
module.exports = baseWrapperValue;