parent
5666316285
commit
b983b6cb87
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @license
|
||||
* Lodash (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash include="each,filter,map,range,first,isEmpty,chain,extend,every,omit,merge,union,sortBy,uniq,intersection,reject,compact,reduce,debounce,throttle,values,pick,keys,flatten,min,max,isArray,delay,isString,isEqual,without,invoke,clone,findIndex" minus="template" -d`
|
||||
* Build: `lodash include="each,filter,map,range,first,isEmpty,chain,extend,every,omit,merge,union,sortBy,uniq,intersection,reject,compact,reduce,debounce,throttle,values,pick,keys,flatten,min,max,isArray,delay,isString,isEqual,without,invoke,clone,findIndex,find" minus="template" -d`
|
||||
* Copyright JS Foundation and other contributors <https://js.foundation/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* 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.17.5';
|
||||
var VERSION = '4.17.11';
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
|
@ -246,6 +246,14 @@
|
|||
/** Used to access faster Node.js helpers. */
|
||||
var nodeUtil = (function() {
|
||||
try {
|
||||
// Use `util.types` for Node.js 10+.
|
||||
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
||||
|
||||
if (types) {
|
||||
return types;
|
||||
}
|
||||
|
||||
// Legacy `process.binding('util')` for Node.js < 10.
|
||||
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
||||
} catch (e) {}
|
||||
}());
|
||||
|
@ -756,20 +764,6 @@
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value at `key`, unless `key` is "__proto__".
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {*} Returns the property value.
|
||||
*/
|
||||
function safeGet(object, key) {
|
||||
return key == '__proto__'
|
||||
? undefined
|
||||
: object[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `set` to an array of its values.
|
||||
*
|
||||
|
@ -2770,7 +2764,7 @@
|
|||
if (isArguments(objValue)) {
|
||||
newValue = toPlainObject(objValue);
|
||||
}
|
||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||
else if (!isObject(objValue) || isFunction(objValue)) {
|
||||
newValue = initCloneObject(srcValue);
|
||||
}
|
||||
}
|
||||
|
@ -3576,6 +3570,26 @@
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a `_.find` or `_.findLast` function.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} findIndexFunc The function to find the collection index.
|
||||
* @returns {Function} Returns the new find function.
|
||||
*/
|
||||
function createFind(findIndexFunc) {
|
||||
return function(collection, predicate, fromIndex) {
|
||||
var iterable = Object(collection);
|
||||
if (!isArrayLike(collection)) {
|
||||
var iteratee = getIteratee(predicate, 3);
|
||||
collection = keys(collection);
|
||||
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
|
||||
}
|
||||
var index = findIndexFunc(collection, predicate, fromIndex);
|
||||
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke it with optional `this`
|
||||
* binding of `thisArg`, partial application, and currying.
|
||||
|
@ -4662,6 +4676,22 @@
|
|||
return array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value at `key`, unless `key` is "__proto__".
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {*} Returns the property value.
|
||||
*/
|
||||
function safeGet(object, key) {
|
||||
if (key == '__proto__') {
|
||||
return;
|
||||
}
|
||||
|
||||
return object[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets metadata for `func`.
|
||||
*
|
||||
|
@ -5518,6 +5548,44 @@
|
|||
return func(collection, getIteratee(predicate, 3));
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection`, returning the first element
|
||||
* `predicate` returns truthy for. The predicate is invoked with three
|
||||
* arguments: (value, index|key, collection).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to inspect.
|
||||
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
||||
* @param {number} [fromIndex=0] The index to search from.
|
||||
* @returns {*} Returns the matched element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36, 'active': true },
|
||||
* { 'user': 'fred', 'age': 40, 'active': false },
|
||||
* { 'user': 'pebbles', 'age': 1, 'active': true }
|
||||
* ];
|
||||
*
|
||||
* _.find(users, function(o) { return o.age < 40; });
|
||||
* // => object for 'barney'
|
||||
*
|
||||
* // The `_.matches` iteratee shorthand.
|
||||
* _.find(users, { 'age': 1, 'active': true });
|
||||
* // => object for 'pebbles'
|
||||
*
|
||||
* // The `_.matchesProperty` iteratee shorthand.
|
||||
* _.find(users, ['active', false]);
|
||||
* // => object for 'fred'
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.find(users, 'active');
|
||||
* // => object for 'barney'
|
||||
*/
|
||||
var find = createFind(findIndex);
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection` and invokes `iteratee` for each element.
|
||||
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
||||
|
@ -7551,6 +7619,7 @@
|
|||
lodash.clone = clone;
|
||||
lodash.eq = eq;
|
||||
lodash.every = every;
|
||||
lodash.find = find;
|
||||
lodash.findIndex = findIndex;
|
||||
lodash.forEach = forEach;
|
||||
lodash.get = get;
|
||||
|
|
Loading…
Reference in New Issue