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,8 +1,10 @@
var LodashWrapper = require('./LodashWrapper'),
baseFlatten = require('./baseFlatten'),
getData = require('./getData'),
getFuncName = require('./getFuncName'),
isArray = require('../lang/isArray'),
isLaziable = require('./isLaziable');
isArray = require('../isArray'),
isLaziable = require('./isLaziable'),
rest = require('../rest');
/** Used to compose bitmasks for wrapper metadata. */
var CURRY_FLAG = 8,
@@ -24,23 +26,26 @@ var FUNC_ERROR_TEXT = 'Expected a function';
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return function() {
var wrapper,
length = arguments.length,
index = fromRight ? length : -1,
leftIndex = 0,
funcs = Array(length);
return rest(function(funcs) {
funcs = baseFlatten(funcs);
while ((fromRight ? index-- : ++index < length)) {
var func = funcs[leftIndex++] = arguments[index];
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
wrapper = new LodashWrapper([], true);
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? -1 : length;
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
@@ -68,7 +73,7 @@ function createFlow(fromRight) {
}
return result;
};
};
});
}
module.exports = createFlow;