mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65e5d998b3 | ||
|
|
ae51b52aa1 |
@@ -1,4 +1,4 @@
|
||||
# lodash-amd v4.4.0
|
||||
# lodash-amd v4.5.1
|
||||
|
||||
The [lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||
|
||||
@@ -27,4 +27,4 @@ require({
|
||||
});
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.4.0-amd) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.5.1-amd) for more details.
|
||||
|
||||
@@ -21,8 +21,7 @@ define(['./eq'], function(eq) {
|
||||
*/
|
||||
function assignValue(object, key, value) {
|
||||
var objValue = object[key];
|
||||
if ((!eq(objValue, value) ||
|
||||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
|
||||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
||||
(value === undefined && !(key in object))) {
|
||||
object[key] = value;
|
||||
}
|
||||
|
||||
@@ -93,9 +93,10 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
|
||||
return copySymbols(value, baseAssign(result, value));
|
||||
}
|
||||
} else {
|
||||
return cloneableTags[tag]
|
||||
? initCloneByTag(value, tag, isDeep)
|
||||
: (object ? value : {});
|
||||
if (!cloneableTags[tag]) {
|
||||
return object ? value : {};
|
||||
}
|
||||
result = initCloneByTag(value, tag, isDeep);
|
||||
}
|
||||
}
|
||||
// Check for circular references and return its corresponding clone.
|
||||
|
||||
@@ -11,23 +11,28 @@ define([], function() {
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} partials The arguments to prepend to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
* @returns {Array} Returns the new array of composed arguments.
|
||||
*/
|
||||
function composeArgs(args, partials, holders) {
|
||||
var holdersLength = holders.length,
|
||||
argsIndex = -1,
|
||||
argsLength = nativeMax(args.length - holdersLength, 0),
|
||||
function composeArgs(args, partials, holders, isCurried) {
|
||||
var argsIndex = -1,
|
||||
argsLength = args.length,
|
||||
holdersLength = holders.length,
|
||||
leftIndex = -1,
|
||||
leftLength = partials.length,
|
||||
result = Array(leftLength + argsLength);
|
||||
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
||||
result = Array(leftLength + rangeLength),
|
||||
isUncurried = !isCurried;
|
||||
|
||||
while (++leftIndex < leftLength) {
|
||||
result[leftIndex] = partials[leftIndex];
|
||||
}
|
||||
while (++argsIndex < holdersLength) {
|
||||
result[holders[argsIndex]] = args[argsIndex];
|
||||
if (isUncurried || argsIndex < argsLength) {
|
||||
result[holders[argsIndex]] = args[argsIndex];
|
||||
}
|
||||
}
|
||||
while (argsLength--) {
|
||||
while (rangeLength--) {
|
||||
result[leftIndex++] = args[argsIndex++];
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -11,18 +11,21 @@ define([], function() {
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} partials The arguments to append to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
* @returns {Array} Returns the new array of composed arguments.
|
||||
*/
|
||||
function composeArgsRight(args, partials, holders) {
|
||||
var holdersIndex = -1,
|
||||
function composeArgsRight(args, partials, holders, isCurried) {
|
||||
var argsIndex = -1,
|
||||
argsLength = args.length,
|
||||
holdersIndex = -1,
|
||||
holdersLength = holders.length,
|
||||
argsIndex = -1,
|
||||
argsLength = nativeMax(args.length - holdersLength, 0),
|
||||
rightIndex = -1,
|
||||
rightLength = partials.length,
|
||||
result = Array(argsLength + rightLength);
|
||||
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
||||
result = Array(rangeLength + rightLength),
|
||||
isUncurried = !isCurried;
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
while (++argsIndex < rangeLength) {
|
||||
result[argsIndex] = args[argsIndex];
|
||||
}
|
||||
var offset = argsIndex;
|
||||
@@ -30,7 +33,9 @@ define([], function() {
|
||||
result[offset + rightIndex] = partials[rightIndex];
|
||||
}
|
||||
while (++holdersIndex < holdersLength) {
|
||||
result[offset + holders[holdersIndex]] = args[argsIndex++];
|
||||
if (isUncurried || argsIndex < argsLength) {
|
||||
result[offset + holders[holdersIndex]] = args[argsIndex++];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
24
_countHolders.js
Normal file
24
_countHolders.js
Normal file
@@ -0,0 +1,24 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Gets the number of `placeholder` occurrences in `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} placeholder The placeholder to search for.
|
||||
* @returns {number} Returns the placeholder count.
|
||||
*/
|
||||
function countHolders(array, placeholder) {
|
||||
var length = array.length,
|
||||
result = 0;
|
||||
|
||||
while (length--) {
|
||||
if (array[length] === placeholder) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return countHolders;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, replaceHolders, root) {
|
||||
define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_getPlaceholder', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, getPlaceholder, replaceHolders, root) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -17,10 +17,9 @@ define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_create
|
||||
|
||||
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];
|
||||
@@ -30,9 +29,13 @@ define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_create
|
||||
: 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;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_createRecurryWrapper', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, createCtorWrapper, createRecurryWrapper, reorder, replaceHolders, root) {
|
||||
define(['./_composeArgs', './_composeArgsRight', './_countHolders', './_createCtorWrapper', './_createRecurryWrapper', './_getPlaceholder', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, countHolders, createCtorWrapper, createRecurryWrapper, getPlaceholder, reorder, replaceHolders, root) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -32,8 +32,7 @@ define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_cre
|
||||
var isAry = bitmask & ARY_FLAG,
|
||||
isBind = bitmask & BIND_FLAG,
|
||||
isBindKey = bitmask & BIND_KEY_FLAG,
|
||||
isCurry = bitmask & CURRY_FLAG,
|
||||
isCurryRight = bitmask & CURRY_RIGHT_FLAG,
|
||||
isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
|
||||
isFlip = bitmask & FLIP_FLAG,
|
||||
Ctor = isBindKey ? undefined : createCtorWrapper(func);
|
||||
|
||||
@@ -45,33 +44,34 @@ define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_cre
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
}
|
||||
if (isCurried) {
|
||||
var placeholder = getPlaceholder(wrapper),
|
||||
holdersCount = countHolders(args, placeholder);
|
||||
}
|
||||
if (partials) {
|
||||
args = composeArgs(args, partials, holders);
|
||||
args = composeArgs(args, partials, holders, isCurried);
|
||||
}
|
||||
if (partialsRight) {
|
||||
args = composeArgsRight(args, partialsRight, holdersRight);
|
||||
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
|
||||
}
|
||||
if (isCurry || isCurryRight) {
|
||||
var placeholder = wrapper.placeholder,
|
||||
argsHolders = replaceHolders(args, placeholder);
|
||||
|
||||
length -= argsHolders.length;
|
||||
if (length < arity) {
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, placeholder, thisArg, args,
|
||||
argsHolders, argPos, ary, arity - length
|
||||
);
|
||||
}
|
||||
length -= holdersCount;
|
||||
if (isCurried && length < arity) {
|
||||
var newHolders = replaceHolders(args, placeholder);
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
|
||||
args, newHolders, argPos, ary, arity - length
|
||||
);
|
||||
}
|
||||
var thisBinding = isBind ? thisArg : this,
|
||||
fn = isBindKey ? thisBinding[func] : func;
|
||||
|
||||
length = args.length;
|
||||
if (argPos) {
|
||||
args = reorder(args, argPos);
|
||||
} else if (isFlip && args.length > 1) {
|
||||
} else if (isFlip && length > 1) {
|
||||
args.reverse();
|
||||
}
|
||||
if (isAry && ary < args.length) {
|
||||
if (isAry && ary < length) {
|
||||
args.length = ary;
|
||||
}
|
||||
if (this && this !== root && this instanceof wrapper) {
|
||||
|
||||
@@ -18,7 +18,7 @@ define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLa
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
|
||||
* @param {Function} wrapFunc The function to create the `func` wrapper.
|
||||
* @param {*} placeholder The placeholder to replace.
|
||||
* @param {*} placeholder The placeholder value.
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @param {Array} [partials] The arguments to prepend to those provided to the new function.
|
||||
* @param {Array} [holders] The `partials` placeholder indexes.
|
||||
@@ -30,7 +30,7 @@ define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLa
|
||||
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
||||
var isCurry = bitmask & CURRY_FLAG,
|
||||
newArgPos = argPos ? copyArray(argPos) : undefined,
|
||||
newsHolders = isCurry ? holders : undefined,
|
||||
newHolders = isCurry ? holders : undefined,
|
||||
newHoldersRight = isCurry ? undefined : holders,
|
||||
newPartials = isCurry ? partials : undefined,
|
||||
newPartialsRight = isCurry ? undefined : partials;
|
||||
@@ -42,7 +42,7 @@ define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLa
|
||||
bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
|
||||
}
|
||||
var newData = [
|
||||
func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight,
|
||||
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
||||
newHoldersRight, newArgPos, ary, arity
|
||||
];
|
||||
|
||||
|
||||
16
_getPlaceholder.js
Normal file
16
_getPlaceholder.js
Normal file
@@ -0,0 +1,16 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Gets the argument placeholder value for `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to inspect.
|
||||
* @returns {*} Returns the placeholder value.
|
||||
*/
|
||||
function getPlaceholder(func) {
|
||||
var object = func;
|
||||
return object.placeholder;
|
||||
}
|
||||
|
||||
return getPlaceholder;
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
define(['./_baseCreate', './isFunction', './_isPrototype'], function(baseCreate, isFunction, isPrototype) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
/** Built-in value references. */
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
|
||||
/**
|
||||
* Initializes an object clone.
|
||||
@@ -11,11 +11,9 @@ define(['./_baseCreate', './isFunction', './_isPrototype'], function(baseCreate,
|
||||
* @returns {Object} Returns the initialized clone.
|
||||
*/
|
||||
function initCloneObject(object) {
|
||||
if (isPrototype(object)) {
|
||||
return {};
|
||||
}
|
||||
var Ctor = object.constructor;
|
||||
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
|
||||
return (isFunction(object.constructor) && !isPrototype(object))
|
||||
? baseCreate(getPrototypeOf(object))
|
||||
: {};
|
||||
}
|
||||
|
||||
return initCloneObject;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define([], function() {
|
||||
define(['./isFunction'], function(isFunction) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
@@ -12,7 +12,7 @@ define([], function() {
|
||||
*/
|
||||
function isPrototype(value) {
|
||||
var Ctor = value && value.constructor,
|
||||
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
||||
proto = (isFunction(Ctor) && Ctor.prototype) || objectProto;
|
||||
|
||||
return value === proto;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHold
|
||||
isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
|
||||
|
||||
var isCombo =
|
||||
(srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) ||
|
||||
(srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
|
||||
(srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
|
||||
((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
|
||||
((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
|
||||
((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
|
||||
|
||||
// Exit early if metadata can't be merged.
|
||||
if (!(isCommon || isCombo)) {
|
||||
@@ -48,7 +48,7 @@ define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHold
|
||||
if (srcBitmask & BIND_FLAG) {
|
||||
data[2] = source[2];
|
||||
// Set when currying a bound function.
|
||||
newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
|
||||
newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
|
||||
}
|
||||
// Compose partial arguments.
|
||||
var value = source[3];
|
||||
|
||||
@@ -19,7 +19,8 @@ define([], function() {
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
if (array[index] === placeholder) {
|
||||
var value = array[index];
|
||||
if (value === placeholder || value === PLACEHOLDER) {
|
||||
array[index] = PLACEHOLDER;
|
||||
result[++resIndex] = index;
|
||||
}
|
||||
|
||||
6
bind.js
6
bind.js
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -42,9 +42,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
var bind = rest(function(func, thisArg, partials) {
|
||||
var bitmask = BIND_FLAG;
|
||||
if (partials.length) {
|
||||
var placeholder = bind.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(bind));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(func, bitmask, thisArg, partials, holders);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -52,9 +52,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
var bindKey = rest(function(object, key, partials) {
|
||||
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
|
||||
if (partials.length) {
|
||||
var placeholder = bindKey.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(bindKey));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(key, bitmask, object, partials, holders);
|
||||
|
||||
@@ -33,9 +33,8 @@ define(['./isObjectLike'], function(isObjectLike) {
|
||||
if (!isObjectLike(value)) {
|
||||
return false;
|
||||
}
|
||||
var Ctor = value.constructor;
|
||||
return (objectToString.call(value) == errorTag) ||
|
||||
(typeof Ctor == 'function' && objectToString.call(Ctor.prototype) == errorTag);
|
||||
(typeof value.message == 'string' && typeof value.name == 'string');
|
||||
}
|
||||
|
||||
return isError;
|
||||
|
||||
@@ -53,10 +53,7 @@ define(['./_isHostObject', './isObjectLike'], function(isHostObject, isObjectLik
|
||||
objectToString.call(value) != objectTag || isHostObject(value)) {
|
||||
return false;
|
||||
}
|
||||
var proto = objectProto;
|
||||
if (typeof value.constructor == 'function') {
|
||||
proto = getPrototypeOf(value);
|
||||
}
|
||||
var proto = getPrototypeOf(value);
|
||||
if (proto === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
259
main.js
259
main.js
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.4.0 (Custom Build) <https://lodash.com/>
|
||||
* lodash 4.5.1 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash exports="amd" -d -o ./main.js`
|
||||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
@@ -13,7 +13,7 @@
|
||||
var undefined;
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.4.0';
|
||||
var VERSION = '4.5.1';
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -1033,6 +1033,26 @@
|
||||
return object.index - other.index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of `placeholder` occurrences in `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} placeholder The placeholder to search for.
|
||||
* @returns {number} Returns the placeholder count.
|
||||
*/
|
||||
function countHolders(array, placeholder) {
|
||||
var length = array.length,
|
||||
result = 0;
|
||||
|
||||
while (length--) {
|
||||
if (array[length] === placeholder) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
|
||||
*
|
||||
@@ -1171,7 +1191,8 @@
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
if (array[index] === placeholder) {
|
||||
var value = array[index];
|
||||
if (value === placeholder || value === PLACEHOLDER) {
|
||||
array[index] = PLACEHOLDER;
|
||||
result[++resIndex] = index;
|
||||
}
|
||||
@@ -1430,25 +1451,26 @@
|
||||
* The wrapper methods that are **not** chainable by default are:
|
||||
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
|
||||
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
|
||||
* `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
|
||||
* `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`,
|
||||
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
|
||||
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
|
||||
* `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
|
||||
* `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
|
||||
* `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`,
|
||||
* `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,
|
||||
* `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`,
|
||||
* `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`,
|
||||
* `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`,
|
||||
* `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`,
|
||||
* `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
|
||||
* `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
|
||||
* `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
|
||||
* `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`,
|
||||
* `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`,
|
||||
* `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`,
|
||||
* `upperCase`, `upperFirst`, `value`, and `words`
|
||||
* `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
|
||||
* `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, `forIn`,
|
||||
* `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`,
|
||||
* `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`,
|
||||
* `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
|
||||
* `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
|
||||
* `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
|
||||
* `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
|
||||
* `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
|
||||
* `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
|
||||
* `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
|
||||
* `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`,
|
||||
* `now`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`,
|
||||
* `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`,
|
||||
* `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`,
|
||||
* `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`,
|
||||
* `sum`, `sumBy`, `template`, `times`, `toLower`, `toInteger`, `toLength`,
|
||||
* `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,
|
||||
* `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,
|
||||
* `value`, and `words`
|
||||
*
|
||||
* @name _
|
||||
* @constructor
|
||||
@@ -2160,8 +2182,7 @@
|
||||
*/
|
||||
function assignValue(object, key, value) {
|
||||
var objValue = object[key];
|
||||
if ((!eq(objValue, value) ||
|
||||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
|
||||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
||||
(value === undefined && !(key in object))) {
|
||||
object[key] = value;
|
||||
}
|
||||
@@ -2318,9 +2339,10 @@
|
||||
return copySymbols(value, baseAssign(result, value));
|
||||
}
|
||||
} else {
|
||||
return cloneableTags[tag]
|
||||
? initCloneByTag(value, tag, isDeep)
|
||||
: (object ? value : {});
|
||||
if (!cloneableTags[tag]) {
|
||||
return object ? value : {};
|
||||
}
|
||||
result = initCloneByTag(value, tag, isDeep);
|
||||
}
|
||||
}
|
||||
// Check for circular references and return its corresponding clone.
|
||||
@@ -3870,23 +3892,28 @@
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} partials The arguments to prepend to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
* @returns {Array} Returns the new array of composed arguments.
|
||||
*/
|
||||
function composeArgs(args, partials, holders) {
|
||||
var holdersLength = holders.length,
|
||||
argsIndex = -1,
|
||||
argsLength = nativeMax(args.length - holdersLength, 0),
|
||||
function composeArgs(args, partials, holders, isCurried) {
|
||||
var argsIndex = -1,
|
||||
argsLength = args.length,
|
||||
holdersLength = holders.length,
|
||||
leftIndex = -1,
|
||||
leftLength = partials.length,
|
||||
result = Array(leftLength + argsLength);
|
||||
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
||||
result = Array(leftLength + rangeLength),
|
||||
isUncurried = !isCurried;
|
||||
|
||||
while (++leftIndex < leftLength) {
|
||||
result[leftIndex] = partials[leftIndex];
|
||||
}
|
||||
while (++argsIndex < holdersLength) {
|
||||
result[holders[argsIndex]] = args[argsIndex];
|
||||
if (isUncurried || argsIndex < argsLength) {
|
||||
result[holders[argsIndex]] = args[argsIndex];
|
||||
}
|
||||
}
|
||||
while (argsLength--) {
|
||||
while (rangeLength--) {
|
||||
result[leftIndex++] = args[argsIndex++];
|
||||
}
|
||||
return result;
|
||||
@@ -3900,18 +3927,21 @@
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} partials The arguments to append to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
* @returns {Array} Returns the new array of composed arguments.
|
||||
*/
|
||||
function composeArgsRight(args, partials, holders) {
|
||||
var holdersIndex = -1,
|
||||
function composeArgsRight(args, partials, holders, isCurried) {
|
||||
var argsIndex = -1,
|
||||
argsLength = args.length,
|
||||
holdersIndex = -1,
|
||||
holdersLength = holders.length,
|
||||
argsIndex = -1,
|
||||
argsLength = nativeMax(args.length - holdersLength, 0),
|
||||
rightIndex = -1,
|
||||
rightLength = partials.length,
|
||||
result = Array(argsLength + rightLength);
|
||||
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
||||
result = Array(rangeLength + rightLength),
|
||||
isUncurried = !isCurried;
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
while (++argsIndex < rangeLength) {
|
||||
result[argsIndex] = args[argsIndex];
|
||||
}
|
||||
var offset = argsIndex;
|
||||
@@ -3919,7 +3949,9 @@
|
||||
result[offset + rightIndex] = partials[rightIndex];
|
||||
}
|
||||
while (++holdersIndex < holdersLength) {
|
||||
result[offset + holders[holdersIndex]] = args[argsIndex++];
|
||||
if (isUncurried || argsIndex < argsLength) {
|
||||
result[offset + holders[holdersIndex]] = args[argsIndex++];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -4203,10 +4235,9 @@
|
||||
|
||||
function wrapper() {
|
||||
var length = arguments.length,
|
||||
index = length,
|
||||
args = Array(length),
|
||||
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
|
||||
placeholder = lodash.placeholder || wrapper.placeholder;
|
||||
index = length,
|
||||
placeholder = getPlaceholder(wrapper);
|
||||
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
@@ -4216,9 +4247,13 @@
|
||||
: 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;
|
||||
}
|
||||
@@ -4306,8 +4341,7 @@
|
||||
var isAry = bitmask & ARY_FLAG,
|
||||
isBind = bitmask & BIND_FLAG,
|
||||
isBindKey = bitmask & BIND_KEY_FLAG,
|
||||
isCurry = bitmask & CURRY_FLAG,
|
||||
isCurryRight = bitmask & CURRY_RIGHT_FLAG,
|
||||
isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
|
||||
isFlip = bitmask & FLIP_FLAG,
|
||||
Ctor = isBindKey ? undefined : createCtorWrapper(func);
|
||||
|
||||
@@ -4319,33 +4353,34 @@
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
}
|
||||
if (isCurried) {
|
||||
var placeholder = getPlaceholder(wrapper),
|
||||
holdersCount = countHolders(args, placeholder);
|
||||
}
|
||||
if (partials) {
|
||||
args = composeArgs(args, partials, holders);
|
||||
args = composeArgs(args, partials, holders, isCurried);
|
||||
}
|
||||
if (partialsRight) {
|
||||
args = composeArgsRight(args, partialsRight, holdersRight);
|
||||
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
|
||||
}
|
||||
if (isCurry || isCurryRight) {
|
||||
var placeholder = lodash.placeholder || wrapper.placeholder,
|
||||
argsHolders = replaceHolders(args, placeholder);
|
||||
|
||||
length -= argsHolders.length;
|
||||
if (length < arity) {
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, placeholder, thisArg, args,
|
||||
argsHolders, argPos, ary, arity - length
|
||||
);
|
||||
}
|
||||
length -= holdersCount;
|
||||
if (isCurried && length < arity) {
|
||||
var newHolders = replaceHolders(args, placeholder);
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
|
||||
args, newHolders, argPos, ary, arity - length
|
||||
);
|
||||
}
|
||||
var thisBinding = isBind ? thisArg : this,
|
||||
fn = isBindKey ? thisBinding[func] : func;
|
||||
|
||||
length = args.length;
|
||||
if (argPos) {
|
||||
args = reorder(args, argPos);
|
||||
} else if (isFlip && args.length > 1) {
|
||||
} else if (isFlip && length > 1) {
|
||||
args.reverse();
|
||||
}
|
||||
if (isAry && ary < args.length) {
|
||||
if (isAry && ary < length) {
|
||||
args.length = ary;
|
||||
}
|
||||
if (this && this !== root && this instanceof wrapper) {
|
||||
@@ -4483,7 +4518,7 @@
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
|
||||
* @param {Function} wrapFunc The function to create the `func` wrapper.
|
||||
* @param {*} placeholder The placeholder to replace.
|
||||
* @param {*} placeholder The placeholder value.
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @param {Array} [partials] The arguments to prepend to those provided to the new function.
|
||||
* @param {Array} [holders] The `partials` placeholder indexes.
|
||||
@@ -4495,7 +4530,7 @@
|
||||
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
||||
var isCurry = bitmask & CURRY_FLAG,
|
||||
newArgPos = argPos ? copyArray(argPos) : undefined,
|
||||
newsHolders = isCurry ? holders : undefined,
|
||||
newHolders = isCurry ? holders : undefined,
|
||||
newHoldersRight = isCurry ? undefined : holders,
|
||||
newPartials = isCurry ? partials : undefined,
|
||||
newPartialsRight = isCurry ? undefined : partials;
|
||||
@@ -4507,7 +4542,7 @@
|
||||
bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
|
||||
}
|
||||
var newData = [
|
||||
func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight,
|
||||
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
||||
newHoldersRight, newArgPos, ary, arity
|
||||
];
|
||||
|
||||
@@ -4928,6 +4963,18 @@
|
||||
return isNative(value) ? value : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the argument placeholder value for `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to inspect.
|
||||
* @returns {*} Returns the placeholder value.
|
||||
*/
|
||||
function getPlaceholder(func) {
|
||||
var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
|
||||
return object.placeholder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of the own symbol properties of `object`.
|
||||
*
|
||||
@@ -5054,11 +5101,9 @@
|
||||
* @returns {Object} Returns the initialized clone.
|
||||
*/
|
||||
function initCloneObject(object) {
|
||||
if (isPrototype(object)) {
|
||||
return {};
|
||||
}
|
||||
var Ctor = object.constructor;
|
||||
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
|
||||
return (isFunction(object.constructor) && !isPrototype(object))
|
||||
? baseCreate(getPrototypeOf(object))
|
||||
: {};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5205,7 +5250,7 @@
|
||||
*/
|
||||
function isPrototype(value) {
|
||||
var Ctor = value && value.constructor,
|
||||
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
||||
proto = (isFunction(Ctor) && Ctor.prototype) || objectProto;
|
||||
|
||||
return value === proto;
|
||||
}
|
||||
@@ -5244,9 +5289,9 @@
|
||||
isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
|
||||
|
||||
var isCombo =
|
||||
(srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) ||
|
||||
(srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
|
||||
(srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
|
||||
((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
|
||||
((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
|
||||
((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
|
||||
|
||||
// Exit early if metadata can't be merged.
|
||||
if (!(isCommon || isCombo)) {
|
||||
@@ -5256,7 +5301,7 @@
|
||||
if (srcBitmask & BIND_FLAG) {
|
||||
data[2] = source[2];
|
||||
// Set when currying a bound function.
|
||||
newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
|
||||
newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
|
||||
}
|
||||
// Compose partial arguments.
|
||||
var value = source[3];
|
||||
@@ -6188,7 +6233,8 @@
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`.
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
|
||||
* to remove elements from an array by predicate.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -6293,10 +6339,11 @@
|
||||
|
||||
/**
|
||||
* Removes all elements from `array` that `predicate` returns truthy for
|
||||
* and returns an array of the removed elements. The predicate is invoked with
|
||||
* three arguments: (value, index, array).
|
||||
* and returns an array of the removed elements. The predicate is invoked
|
||||
* with three arguments: (value, index, array).
|
||||
*
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`.
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
|
||||
* to pull elements from an array by value.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -8459,9 +8506,7 @@
|
||||
var bind = rest(function(func, thisArg, partials) {
|
||||
var bitmask = BIND_FLAG;
|
||||
if (partials.length) {
|
||||
var placeholder = lodash.placeholder || bind.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(bind));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(func, bitmask, thisArg, partials, holders);
|
||||
@@ -8514,9 +8559,7 @@
|
||||
var bindKey = rest(function(object, key, partials) {
|
||||
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
|
||||
if (partials.length) {
|
||||
var placeholder = lodash.placeholder || bindKey.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(bindKey));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(key, bitmask, object, partials, holders);
|
||||
@@ -8565,7 +8608,7 @@
|
||||
function curry(func, arity, guard) {
|
||||
arity = guard ? undefined : arity;
|
||||
var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
|
||||
result.placeholder = lodash.placeholder || curry.placeholder;
|
||||
result.placeholder = curry.placeholder;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -8609,7 +8652,7 @@
|
||||
function curryRight(func, arity, guard) {
|
||||
arity = guard ? undefined : arity;
|
||||
var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
|
||||
result.placeholder = lodash.placeholder || curryRight.placeholder;
|
||||
result.placeholder = curryRight.placeholder;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -9033,9 +9076,7 @@
|
||||
* // => 'hi fred'
|
||||
*/
|
||||
var partial = rest(function(func, partials) {
|
||||
var placeholder = lodash.placeholder || partial.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(partial));
|
||||
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
|
||||
});
|
||||
|
||||
@@ -9071,9 +9112,7 @@
|
||||
* // => 'hello fred'
|
||||
*/
|
||||
var partialRight = rest(function(func, partials) {
|
||||
var placeholder = lodash.placeholder || partialRight.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(partialRight));
|
||||
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
|
||||
});
|
||||
|
||||
@@ -9872,9 +9911,8 @@
|
||||
if (!isObjectLike(value)) {
|
||||
return false;
|
||||
}
|
||||
var Ctor = value.constructor;
|
||||
return (objectToString.call(value) == errorTag) ||
|
||||
(typeof Ctor == 'function' && objectToString.call(Ctor.prototype) == errorTag);
|
||||
(typeof value.message == 'string' && typeof value.name == 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -10287,10 +10325,7 @@
|
||||
objectToString.call(value) != objectTag || isHostObject(value)) {
|
||||
return false;
|
||||
}
|
||||
var proto = objectProto;
|
||||
if (typeof value.constructor == 'function') {
|
||||
proto = getPrototypeOf(value);
|
||||
}
|
||||
var proto = getPrototypeOf(value);
|
||||
if (proto === null) {
|
||||
return true;
|
||||
}
|
||||
@@ -11504,7 +11539,8 @@
|
||||
/**
|
||||
* The opposite of `_.mapValues`; this method creates an object with the
|
||||
* same values as `object` and keys generated by running each own enumerable
|
||||
* property of `object` through `iteratee`.
|
||||
* property of `object` through `iteratee`. The iteratee is invoked with
|
||||
* three arguments: (value, key, object).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -11532,7 +11568,7 @@
|
||||
/**
|
||||
* Creates an object with the same keys as `object` and values generated by
|
||||
* running each own enumerable property of `object` through `iteratee`. The
|
||||
* iteratee function is invoked with three arguments: (value, key, object).
|
||||
* iteratee is invoked with three arguments: (value, key, object).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -11665,9 +11701,10 @@
|
||||
});
|
||||
|
||||
/**
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of the
|
||||
* own and inherited enumerable properties of `object` that `predicate`
|
||||
* doesn't return truthy for.
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of
|
||||
* the own and inherited enumerable properties of `object` that `predicate`
|
||||
* doesn't return truthy for. The predicate is invoked with two arguments:
|
||||
* (value, key).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -11683,7 +11720,7 @@
|
||||
* // => { 'b': '2' }
|
||||
*/
|
||||
function omitBy(object, predicate) {
|
||||
predicate = getIteratee(predicate, 2);
|
||||
predicate = getIteratee(predicate);
|
||||
return basePickBy(object, function(value, key) {
|
||||
return !predicate(value, key);
|
||||
});
|
||||
@@ -11728,7 +11765,7 @@
|
||||
* // => { 'a': 1, 'c': 3 }
|
||||
*/
|
||||
function pickBy(object, predicate) {
|
||||
return object == null ? {} : basePickBy(object, getIteratee(predicate, 2));
|
||||
return object == null ? {} : basePickBy(object, getIteratee(predicate));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -11918,7 +11955,7 @@
|
||||
if (isArr) {
|
||||
accumulator = isArray(object) ? new Ctor : [];
|
||||
} else {
|
||||
accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
|
||||
accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
|
||||
}
|
||||
} else {
|
||||
accumulator = {};
|
||||
@@ -13914,8 +13951,8 @@
|
||||
var rangeRight = createRange(true);
|
||||
|
||||
/**
|
||||
* Invokes the iteratee function `n` times, returning an array of the results
|
||||
* of each invocation. The iteratee is invoked with one argument; (index).
|
||||
* Invokes the iteratee `n` times, returning an array of the results of
|
||||
* each invocation. The iteratee is invoked with one argument; (index).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -3,7 +3,8 @@ define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee)
|
||||
/**
|
||||
* The opposite of `_.mapValues`; this method creates an object with the
|
||||
* same values as `object` and keys generated by running each own enumerable
|
||||
* property of `object` through `iteratee`.
|
||||
* property of `object` through `iteratee`. The iteratee is invoked with
|
||||
* three arguments: (value, key, object).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -3,7 +3,7 @@ define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee)
|
||||
/**
|
||||
* Creates an object with the same keys as `object` and values generated by
|
||||
* running each own enumerable property of `object` through `iteratee`. The
|
||||
* iteratee function is invoked with three arguments: (value, key, object).
|
||||
* iteratee is invoked with three arguments: (value, key, object).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy) {
|
||||
|
||||
/**
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of the
|
||||
* own and inherited enumerable properties of `object` that `predicate`
|
||||
* doesn't return truthy for.
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of
|
||||
* the own and inherited enumerable properties of `object` that `predicate`
|
||||
* doesn't return truthy for. The predicate is invoked with two arguments:
|
||||
* (value, key).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -19,7 +20,7 @@ define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy)
|
||||
* // => { 'b': '2' }
|
||||
*/
|
||||
function omitBy(object, predicate) {
|
||||
predicate = baseIteratee(predicate, 2);
|
||||
predicate = baseIteratee(predicate);
|
||||
return basePickBy(object, function(value, key) {
|
||||
return !predicate(value, key);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash-amd",
|
||||
"version": "4.4.0",
|
||||
"version": "4.5.1",
|
||||
"description": "Lodash exported as AMD modules.",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -39,9 +39,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
* // => 'hi fred'
|
||||
*/
|
||||
var partial = rest(function(func, partials) {
|
||||
var placeholder = partial.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(partial));
|
||||
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -38,9 +38,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
* // => 'hello fred'
|
||||
*/
|
||||
var partialRight = rest(function(func, partials) {
|
||||
var placeholder = partialRight.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(partialRight));
|
||||
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy)
|
||||
* // => { 'a': 1, 'c': 3 }
|
||||
*/
|
||||
function pickBy(object, predicate) {
|
||||
return object == null ? {} : basePickBy(object, baseIteratee(predicate, 2));
|
||||
return object == null ? {} : basePickBy(object, baseIteratee(predicate));
|
||||
}
|
||||
|
||||
return pickBy;
|
||||
|
||||
3
pull.js
3
pull.js
@@ -5,7 +5,8 @@ define(['./pullAll', './rest'], function(pullAll, rest) {
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`.
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
|
||||
* to remove elements from an array by predicate.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -2,10 +2,11 @@ define(['./_baseIteratee', './_basePullAt'], function(baseIteratee, basePullAt)
|
||||
|
||||
/**
|
||||
* Removes all elements from `array` that `predicate` returns truthy for
|
||||
* and returns an array of the removed elements. The predicate is invoked with
|
||||
* three arguments: (value, index, array).
|
||||
* and returns an array of the removed elements. The predicate is invoked
|
||||
* with three arguments: (value, index, array).
|
||||
*
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`.
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
|
||||
* to pull elements from an array by value.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
4
times.js
4
times.js
@@ -10,8 +10,8 @@ define(['./_baseCastFunction', './_baseTimes', './toInteger'], function(baseCast
|
||||
var nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* Invokes the iteratee function `n` times, returning an array of the results
|
||||
* of each invocation. The iteratee is invoked with one argument; (index).
|
||||
* Invokes the iteratee `n` times, returning an array of the results of
|
||||
* each invocation. The iteratee is invoked with one argument; (index).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
define(['./_arrayEach', './_baseCreate', './_baseForOwn', './_baseIteratee', './isArray', './isFunction', './isObject', './isTypedArray'], function(arrayEach, baseCreate, baseForOwn, baseIteratee, isArray, isFunction, isObject, isTypedArray) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
/** Built-in value references. */
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
|
||||
/**
|
||||
* An alternative to `_.reduce`; this method transforms `object` to a new
|
||||
@@ -41,7 +41,7 @@ define(['./_arrayEach', './_baseCreate', './_baseForOwn', './_baseIteratee', './
|
||||
if (isArr) {
|
||||
accumulator = isArray(object) ? new Ctor : [];
|
||||
} else {
|
||||
accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
|
||||
accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
|
||||
}
|
||||
} else {
|
||||
accumulator = {};
|
||||
|
||||
@@ -71,25 +71,26 @@ define(['./_LazyWrapper', './_LodashWrapper', './_baseLodash', './isArray', './i
|
||||
* The wrapper methods that are **not** chainable by default are:
|
||||
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
|
||||
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
|
||||
* `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
|
||||
* `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`,
|
||||
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
|
||||
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
|
||||
* `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
|
||||
* `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
|
||||
* `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`,
|
||||
* `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,
|
||||
* `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`,
|
||||
* `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`,
|
||||
* `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`,
|
||||
* `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`,
|
||||
* `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
|
||||
* `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
|
||||
* `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
|
||||
* `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`,
|
||||
* `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`,
|
||||
* `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`,
|
||||
* `upperCase`, `upperFirst`, `value`, and `words`
|
||||
* `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
|
||||
* `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, `forIn`,
|
||||
* `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`,
|
||||
* `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`,
|
||||
* `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
|
||||
* `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
|
||||
* `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
|
||||
* `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
|
||||
* `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
|
||||
* `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
|
||||
* `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
|
||||
* `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`,
|
||||
* `now`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`,
|
||||
* `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`,
|
||||
* `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`,
|
||||
* `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`,
|
||||
* `sum`, `sumBy`, `template`, `times`, `toLower`, `toInteger`, `toLength`,
|
||||
* `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,
|
||||
* `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,
|
||||
* `value`, and `words`
|
||||
*
|
||||
* @name _
|
||||
* @constructor
|
||||
|
||||
Reference in New Issue
Block a user