Bump to v4.0.0.

This commit is contained in:
John-David Dalton
2015-09-17 17:52:09 -07:00
parent 1d77dfa4b7
commit 54e7baecc3
675 changed files with 11257 additions and 8085 deletions

View File

@@ -1,8 +1,10 @@
import LodashWrapper from './LodashWrapper';
import baseFlatten from './baseFlatten';
import getData from './getData';
import getFuncName from './getFuncName';
import isArray from '../lang/isArray';
import isArray from '../isArray';
import isLaziable from './isLaziable';
import rest from '../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;
};
};
});
}
export default createFlow;