mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Bump to v4.5.1.
This commit is contained in:
@@ -2,6 +2,7 @@ import apply from './_apply';
|
||||
import createCtorWrapper from './_createCtorWrapper';
|
||||
import createHybridWrapper from './_createHybridWrapper';
|
||||
import createRecurryWrapper from './_createRecurryWrapper';
|
||||
import getPlaceholder from './_getPlaceholder';
|
||||
import replaceHolders from './_replaceHolders';
|
||||
import root from './_root';
|
||||
|
||||
@@ -19,10 +20,9 @@ function createCurryWrapper(func, bitmask, arity) {
|
||||
|
||||
function wrapper() {
|
||||
var length = arguments.length,
|
||||
index = length,
|
||||
args = Array(length),
|
||||
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
|
||||
placeholder = wrapper.placeholder;
|
||||
index = length,
|
||||
placeholder = getPlaceholder(wrapper);
|
||||
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
@@ -32,9 +32,13 @@ function createCurryWrapper(func, bitmask, arity) {
|
||||
: replaceHolders(args, placeholder);
|
||||
|
||||
length -= holders.length;
|
||||
return length < arity
|
||||
? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length)
|
||||
: apply(fn, this, args);
|
||||
if (length < arity) {
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
|
||||
args, holders, undefined, undefined, arity - length);
|
||||
}
|
||||
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
||||
return apply(fn, this, args);
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user