From c73bb67486c8fb4aea3579de03f33394b5169265 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 17 Jul 2016 20:21:41 -0700 Subject: [PATCH] Rebuild lodash and docs. --- dist/lodash.core.js | 413 +++++----- dist/lodash.core.min.js | 46 +- dist/lodash.fp.js | 230 ++++-- dist/lodash.fp.min.js | 33 +- dist/lodash.js | 1353 +++++++++++++++++-------------- dist/lodash.min.js | 245 +++--- dist/mapping.fp.js | 107 ++- doc/README.md | 1680 ++++++++++++++++++++------------------- lodash.js | 2 +- package.json | 2 +- 10 files changed, 2269 insertions(+), 1842 deletions(-) diff --git a/dist/lodash.core.js b/dist/lodash.core.js index 9b6092dd9..44613ae9d 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -13,12 +13,12 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.13.1'; + var VERSION = '4.14.0'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; - /** Used to compose bitmasks for wrapper metadata. */ + /** Used to compose bitmasks for function metadata. */ var BIND_FLAG = 1, PARTIAL_FLAG = 32; @@ -57,24 +57,21 @@ '`': '`' }; + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports; + var freeExports = freeGlobal && typeof exports == 'object' && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module; - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(typeof self == 'object' && self); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(typeof this == 'object' && this); - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); - /*--------------------------------------------------------------------------*/ /** @@ -113,6 +110,32 @@ return -1; } + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. @@ -151,17 +174,6 @@ }); } - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - /** * Used by `_.escape` to convert characters to HTML entities. * @@ -169,9 +181,7 @@ * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } + var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Checks if `value` is a host object in IE < 9. @@ -184,6 +194,20 @@ return false; } + /** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + /*--------------------------------------------------------------------------*/ /** Used for built-in method references. */ @@ -283,16 +307,16 @@ * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, - * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, - * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, - * `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`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `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`, @@ -407,13 +431,13 @@ } /** - * The base implementation of `_.delay` and `_.defer` which accepts an array - * of `func` arguments. + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments to provide to `func`. + * @param {Array} args The arguments to provide to `func`. * @returns {number} Returns the timer id. */ function baseDelay(func, wait, args) { @@ -573,7 +597,7 @@ } /** - * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. @@ -585,6 +609,17 @@ return value > other; } + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; + } + /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. @@ -644,13 +679,17 @@ isSameTag = objTag == othTag; stack || (stack = []); - var stacked = find(stack, function(entry) { - return entry[0] === object; + var objStack = find(stack, function(entry) { + return entry[0] == object; }); - if (stacked && stacked[1]) { - return stacked[1] == other; + var othStack = find(stack, function(entry) { + return entry[0] == other; + }); + if (objStack && othStack) { + return objStack[1] == other; } stack.push([object, other]); + stack.push([other, object]); if (isSameTag && !objIsObj) { var result = (objIsArr) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) @@ -679,6 +718,17 @@ return result; } + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; + } + /** * The base implementation of `_.iteratee`. * @@ -704,9 +754,7 @@ * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } + var baseKeys = overArg(nativeKeys, Object); /** * The base implementation of `_.keysIn` which doesn't skip the constructor @@ -727,7 +775,7 @@ } /** - * The base implementation of `_.lt` which doesn't coerce arguments to numbers. + * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. @@ -804,15 +852,31 @@ } /** - * The base implementation of `_.property` without support for deep paths. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; + function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return func.apply(this, otherArgs); }; } @@ -953,9 +1017,9 @@ var newValue = customizer ? customizer(object[key], source[key], key, object, source) - : source[key]; + : undefined; - assignValue(object, key, newValue); + assignValue(object, key, newValue === undefined ? source[key] : newValue); } return object; } @@ -968,7 +1032,7 @@ * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return rest(function(object, sources) { + return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined; @@ -1049,7 +1113,7 @@ * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ - function createCtorWrapper(Ctor) { + function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist @@ -1074,18 +1138,13 @@ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); - predicate = baseIteratee(predicate, 3); if (!isArrayLike(collection)) { - var props = keys(collection); + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } - var index = findIndexFunc(props || collection, function(value, key) { - if (props) { - key = value; - value = iterable[key]; - } - return predicate(value, key, iterable); - }, fromIndex); - return index > -1 ? collection[props ? props[index] : index] : undefined; + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } @@ -1095,19 +1154,18 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ - function createPartialWrapper(func, bitmask, thisArg, partials) { + function createPartial(func, bitmask, thisArg, partials) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); + Ctor = createCtor(func); function wrapper() { var argsIndex = -1, @@ -1212,18 +1270,14 @@ case boolTag: case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and - // booleans to `1` or `0` treating invalid dates coerced to `NaN` as - // not equal. - return +object == +other; + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, @@ -1399,7 +1453,7 @@ * @since 1.1.0 * @category Array * @param {Array} array The array to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. @@ -1735,7 +1789,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, @@ -1772,12 +1826,14 @@ * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * + * **Note:** Unlike `_.remove`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject @@ -1817,7 +1873,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @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`. @@ -1899,8 +1955,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * @@ -2007,8 +2062,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. @@ -2050,8 +2104,8 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [iteratees=[_.identity]] The iteratees to sort by. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * @@ -2101,7 +2155,7 @@ * @example * * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list + * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; @@ -2140,9 +2194,9 @@ * @returns {Function} Returns the new bound function. * @example * - * var greet = function(greeting, punctuation) { + * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; - * }; + * } * * var object = { 'user': 'fred' }; * @@ -2155,8 +2209,8 @@ * bound('hi'); * // => 'hi fred!' */ - var bind = rest(function(func, thisArg, partials) { - return createPartialWrapper(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials); + var bind = baseRest(function(func, thisArg, partials) { + return createPartial(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials); }); /** @@ -2177,7 +2231,7 @@ * }, 'deferred'); * // => Logs 'deferred' after one or more milliseconds. */ - var defer = rest(function(func, args) { + var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); @@ -2200,7 +2254,7 @@ * }, 1000, 'later'); * // => Logs 'later' after one second. */ - var delay = rest(function(func, wait, args) { + var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); @@ -2229,7 +2283,8 @@ throw new TypeError(FUNC_ERROR_TEXT); } return function() { - return !predicate.apply(this, arguments); + var args = arguments; + return !predicate.apply(this, args); }; } @@ -2249,61 +2304,12 @@ * var initialize = _.once(createApplication); * initialize(); * initialize(); - * // `initialize` invokes `createApplication` once + * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return func.apply(this, otherArgs); - }; - } - /*------------------------------------------------------------------------*/ /** @@ -2353,8 +2359,8 @@ * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.eq(object, object); * // => true @@ -2383,7 +2389,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -2405,11 +2411,9 @@ * @static * @memberOf _ * @since 0.1.0 - * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); @@ -2492,8 +2496,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); @@ -2515,8 +2518,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); @@ -2525,9 +2527,7 @@ * _.isDate('Mon April 23 2012'); * // => false */ - function isDate(value) { - return isObjectLike(value) && objectToString.call(value) == dateTag; - } + var isDate = baseIsDate; /** * Checks if `value` is an empty object, collection, map, or set. @@ -2591,8 +2591,8 @@ * else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true @@ -2643,8 +2643,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -2818,8 +2817,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); @@ -2847,8 +2845,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); @@ -2857,9 +2854,7 @@ * _.isRegExp('/abc/'); * // => false */ - function isRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; - } + var isRegExp = baseIsRegExp; /** * Checks if `value` is classified as a `String` primitive or object. @@ -2869,8 +2864,7 @@ * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); @@ -3037,18 +3031,18 @@ * @example * * function Foo() { - * this.c = 3; + * this.a = 1; * } * * function Bar() { - * this.e = 5; + * this.c = 3; * } * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { copyObject(source, keys(source), object); @@ -3072,18 +3066,18 @@ * @example * * function Foo() { - * this.b = 2; + * this.a = 1; * } * * function Bar() { - * this.d = 4; + * this.c = 3; * } * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); @@ -3179,10 +3173,10 @@ * @see _.defaultsDeep * @example * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - var defaults = rest(function(args) { + var defaults = baseRest(function(args) { args.push(undefined, assignInDefaults); return assignInWith.apply(undefined, args); }); @@ -3290,7 +3284,7 @@ * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = rest(function(object, props) { + var pick = baseRest(function(object, props) { return object == null ? {} : basePick(object, baseMap(baseFlatten(props, 1), toKey)); }); @@ -3407,7 +3401,7 @@ /*------------------------------------------------------------------------*/ /** - * This method returns the first argument given to it. + * This method returns the first argument it receives. * * @static * @since 0.1.0 @@ -3417,7 +3411,7 @@ * @returns {*} Returns `value`. * @example * - * var object = { 'user': 'fred' }; + * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true @@ -3486,13 +3480,13 @@ * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } * ]; * - * _.filter(users, _.matches({ 'age': 40, 'active': false })); - * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(assign({}, source)); @@ -3591,7 +3585,7 @@ } /** - * A method that returns `undefined`. + * This method returns `undefined`. * * @static * @memberOf _ @@ -3801,22 +3795,21 @@ /*--------------------------------------------------------------------------*/ - // Expose Lodash on the free variable `window` or `self` when available so it's - // globally accessible, even when bundled with Browserify, Webpack, etc. This - // also prevents errors in cases where Lodash is loaded by a script tag in the - // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch - // for more details. Use `_.noConflict` to remove Lodash from the global object. - (freeSelf || {})._ = lodash; - - // Some AMD build optimizers like r.js check for condition patterns like the following: + // Some AMD build optimizers, like r.js, check for condition patterns like: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = lodash; + // Define as an anonymous module so, through path mapping, it can be // referenced as the "underscore" module. define(function() { return lodash; }); } - // Check for `exports` after `define` in case a build optimizer adds an `exports` object. + // Check for `exports` after `define` in case a build optimizer adds it. else if (freeModule) { // Export for Node.js. (freeModule.exports = lodash)._ = lodash; diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index 96f15c212..4823456a6 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -3,26 +3,26 @@ * lodash (Custom Build) /license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash core -o ./dist/lodash.core.js` */ -;(function(){function n(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function t(n){return mn(Object(n))}function r(n,t){return n.push.apply(n,t),n}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return x(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return cn[n]}function c(n){return n instanceof f?n:new f(n)}function f(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(n,t,r,e){ -var u;return(u=n===rn)||(u=hn[r],u=(n===u||n!==n&&u!==u)&&!vn.call(e,r)),u?t:n}function l(n){return L(n)?_n(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(rn,r)},t)}function s(n,t){var r=true;return xn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(n,t,r){for(var e=-1,u=n.length;++e0&&e(f)?t>1?y(f,t-1,e,u,o):r(o,f):u||(o[o.length]=f)}return o}function b(n,r){return n&&En(n,r,t)}function g(n,t){return v(t,function(t){return K(n[t])})}function _(n,t){return n>t}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!L(n)&&!Q(t)?n!==n&&t!==t:d(n,t,j,r,e,u)}function d(n,t,r,e,u,o){var i=Tn(n),c=Tn(t),f="[object Array]",a="[object Array]";i||(f=bn.call(n),f="[object Arguments]"==f?"[object Object]":f), -c||(a=bn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=kn(o,function(t){return t[0]===n});return p&&p[1]?p[1]==t:(o.push([n,t]),a&&!l?(r=i?I(n,t,r,e,u,o):q(n,t,f),o.pop(),r):2&u||(i=l&&vn.call(n,"__wrapped__"),f=c&&vn.call(t,"__wrapped__"),!i&&!f)?a?(r=$(n,t,r,e,u,o),o.pop(),r):false:(i=i?n.value():n,t=f?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?nn:(typeof n=="object"?E:w)(n); -}function O(n,t){return t>n}function x(n,t){var r=-1,e=H(n)?Array(n.length):[];return xn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function E(n){var r=t(n);return function(t){var e=r.length;if(null==t)return!e;for(t=Object(t);e--;){var u=r[e];if(!(u in t&&j(n[u],t[u],rn,3)))return false}return true}}function A(n,t){return n=Object(n),M(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function w(n){return function(t){return null==t?rn:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r, -0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:rn,o=n.length>3&&typeof o=="function"?(u--, -o):rn;for(t=Object(t);++ei))return false;for(var c=-1,f=true,a=1&u?[]:rn;++cr?On(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,xn)}function P(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Bn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=rn),r}}function U(n){var t;if(typeof n!="function")throw new TypeError("Expected a function"); -return t=On(t===rn?n.length-1:Bn(t),0),function(){for(var r=arguments,e=-1,u=On(r.length-t,0),o=Array(u);++e-1&&0==t%1&&9007199254740991>=t),t&&!K(n)}function K(n){return n=L(n)?bn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n; -}function L(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Q(n){return!!n&&typeof n=="object"}function W(n){return typeof n=="number"||Q(n)&&"[object Number]"==bn.call(n)}function X(n){return typeof n=="string"||!Tn(n)&&Q(n)&&"[object String]"==bn.call(n)}function Y(n){return typeof n=="string"?n:null==n?"":n+""}function Z(n){return n?u(n,t(n)):[]}function nn(n){return n}function tn(n,e,u){var o=t(e),i=g(e,o);null!=u||L(e)&&(i.length||!o.length)||(u=e,e=n,n=this,i=g(e,t(e)));var c=!(L(u)&&"chain"in u&&!u.chain),f=K(n); -return xn(i,function(t){var u=e[t];n[t]=u,f&&(n.prototype[t]=function(){var t=this.__chain__;if(c||t){var e=n(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=t,e}return u.apply(n,r([this.value()],arguments))})}),n}var rn,en=1/0,un=/[&<>"'`]/g,on=RegExp(un.source),cn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},fn=typeof exports=="object"&&exports,an=fn&&typeof module=="object"&&module,ln=o(typeof self=="object"&&self),pn=o(typeof global=="object"&&global)||ln||o(typeof this=="object"&&this)||Function("return this")(),sn=Array.prototype,hn=Object.prototype,vn=hn.hasOwnProperty,yn=0,bn=hn.toString,gn=pn._,_n=Object.create,jn=hn.propertyIsEnumerable,dn=pn.isFinite,mn=Object.keys,On=Math.max; -f.prototype=l(c.prototype),f.prototype.constructor=f;var xn=function(n,t){return function(r,e){if(null==r)return r;if(!H(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o-1?r[i?i[u]:u]:rn}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Bn(r),0>r&&(r=On(e+r,0));n:{for(t=m(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),w("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return H(n)?n.length?N(n):[]:Z(n)},c.values=Z,c.extend=In, -tn(c,c),c.clone=function(n){return L(n)?Tn(n)?N(n):T(n,t(n)):n},c.escape=function(n){return(n=Y(n))&&on.test(n)?n.replace(un,i):n},c.every=function(n,t,r){return t=r?rn:t,s(n,m(t))},c.find=kn,c.forEach=J,c.has=function(n,t){return null!=n&&vn.call(n,t)},c.head=C,c.identity=nn,c.indexOf=G,c.isArguments=V,c.isArray=Tn,c.isBoolean=function(n){return true===n||false===n||Q(n)&&"[object Boolean]"==bn.call(n)},c.isDate=function(n){return Q(n)&&"[object Date]"==bn.call(n)},c.isEmpty=function(n){return H(n)&&(Tn(n)||X(n)||K(n.splice)||V(n))?!n.length:!t(n).length; -},c.isEqual=function(n,t){return j(n,t)},c.isFinite=function(n){return typeof n=="number"&&dn(n)},c.isFunction=K,c.isNaN=function(n){return W(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=W,c.isObject=L,c.isRegExp=function(n){return L(n)&&"[object RegExp]"==bn.call(n)},c.isString=X,c.isUndefined=function(n){return n===rn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:rn},c.max=function(n){return n&&n.length?h(n,nn,_):rn},c.min=function(n){return n&&n.length?h(n,nn,O):rn},c.noConflict=function(){ -return pn._===this&&(pn._=gn),this},c.noop=function(){},c.reduce=M,c.result=function(n,t,r){return t=null==n?rn:n[t],t===rn&&(t=r),K(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=H(n)?n:t(n),n.length)},c.some=function(n,t,r){return t=r?rn:t,S(n,m(t))},c.uniqueId=function(n){var t=++yn;return Y(n)+t},c.each=J,c.first=C,tn(c,function(){var n={};return b(c,function(t,r){vn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.13.1",xn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){ -var t=(/^(?:replace|split)$/.test(n)?String.prototype:sn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Tn(u)?u:[],n)}return this[r](function(r){return t.apply(Tn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(ln||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){ -return c}):an?((an.exports=c)._=c,fn._=c):pn._=c}).call(this); \ No newline at end of file +;(function(){function n(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return m(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r,e){return n===Z||J(n,an[r])&&!ln.call(e,r)?t:n; +}function f(n){return V(n)?vn(n):{}}function a(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(Z,r)},t)}function l(n,t){var r=true;return jn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function p(n,t,r){for(var e=-1,u=n.length;++et}function g(n,t,r,e,u){return n===t||(null==n||null==t||!V(n)&&!H(t)?n!==n&&t!==t:_(n,t,g,r,e,u))}function _(n,t,r,e,u,o){var i=kn(n),c=kn(t),f="[object Array]",a="[object Array]";i||(f=sn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=sn.call(t),a="[object Arguments]"==a?"[object Object]":a); +var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&ln.call(n,"__wrapped__"), +f=c&&ln.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=D(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t,r=r(i,f,e,u,o),o.pop(),r)}function j(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?O:r)(n)}function d(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;for(var c=-1,f=true,a=1&u?[]:Z;++cr?_n(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,jn)}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Nn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){ +return n===t||n!==n&&t!==t}function M(n){return H(n)&&P(n)&&ln.call(n,"callee")&&(!bn.call(n,"callee")||"[object Arguments]"==sn.call(n))}function P(n){var t;return(t=null!=n)&&(t=On(n),t=typeof t=="number"&&-1=t),t&&!U(n)}function U(n){return n=V(n)?sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function V(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function H(n){return!!n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==sn.call(n); +}function L(n){return typeof n=="string"||!kn(n)&&H(n)&&"[object String]"==sn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return n?u(n,Dn(n)):[]}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=b(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=b(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return jn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=w(this.__actions__)).push({ +func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"'`]/g,rn=RegExp(tn.source),en=typeof global=="object"&&global&&global.Object===Object&&global,un=typeof self=="object"&&self&&self.Object===Object&&self,on=en||un||Function("return this")(),un=(en=en&&typeof exports=="object"&&exports)&&typeof module=="object"&&module,cn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'", +"`":"`"}),fn=Array.prototype,an=Object.prototype,ln=an.hasOwnProperty,pn=0,sn=an.toString,hn=on._,vn=Object.create,bn=an.propertyIsEnumerable,yn=on.isFinite,gn=Object.keys,_n=Math.max;i.prototype=f(o.prototype),i.prototype.constructor=i;var jn=function(n,t){return function(r,e){if(null==r)return r;if(!P(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=_n(e+r,0));n:{for(t=j(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + var data = mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : spread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) + ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) + : func; + } + /** * Creates a clone of `object` by `path`. * @@ -390,12 +467,11 @@ return /******/ (function(modules) { // webpackBootstrap } /** - * Creates a function that invokes `func` with its first argument passed - * thru `transform`. + * Creates a function that invokes `func` with its first argument transformed. * * @private * @param {Function} func The function to wrap. - * @param {...Function} transform The functions to transform the first argument. + * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { @@ -435,42 +511,27 @@ return /******/ (function(modules) { // webpackBootstrap } else if (config.immutable) { if (mutateMap.array[name]) { - wrapped = immutWrap(func, cloneArray); + wrapped = wrapImmutable(func, cloneArray); } else if (mutateMap.object[name]) { - wrapped = immutWrap(func, createCloner(func)); + wrapped = wrapImmutable(func, createCloner(func)); } else if (mutateMap.set[name]) { - wrapped = immutWrap(func, cloneByPath); + wrapped = wrapImmutable(func, cloneByPath); } } each(aryMethodKeys, function(aryKey) { each(mapping.aryMethod[aryKey], function(otherName) { if (name == otherName) { - var aryN = !isLib && mapping.iterateeAry[name], - reargIndexes = mapping.iterateeRearg[name], - spreadStart = mapping.methodSpread[name]; + var spreadData = mapping.methodSpread[name], + afterRearg = spreadData && spreadData.afterRearg; - result = wrapped; - if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { - result = spreadStart === undefined - ? ary(result, aryKey) - : spread(result, spreadStart); - } - if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) { - result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]); - } - if (config.cap) { - if (reargIndexes) { - result = iterateeRearg(result, reargIndexes); - } else if (aryN) { - result = iterateeAry(result, aryN); - } - } - if (forceCurry || (config.curry && aryKey > 1)) { - forceCurry && console.log(forceCurry, name); - result = curry(result, aryKey); - } + result = afterRearg + ? castFixed(name, castRearg(name, wrapped, aryKey), aryKey) + : castRearg(name, castFixed(name, wrapped, aryKey), aryKey); + + result = castCap(name, result); + result = castCurry(name, result, aryKey); return false; } }); @@ -559,11 +620,20 @@ return /******/ (function(modules) { // webpackBootstrap 'entries': 'toPairs', 'entriesIn': 'toPairsIn', 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', 'extendWith': 'assignInWith', 'first': 'head', + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + // Ramda aliases. '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', 'all': 'every', 'allPass': 'overEvery', 'always': 'constant', @@ -577,8 +647,11 @@ return /******/ (function(modules) { // webpackBootstrap 'contains': 'includes', 'dissoc': 'unset', 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', 'equals': 'isEqual', 'identical': 'eq', + 'indexBy': 'keyBy', 'init': 'initial', 'invertObj': 'invert', 'juxt': 'over', @@ -595,36 +668,44 @@ return /******/ (function(modules) { // webpackBootstrap 'propEq': 'matchesProperty', 'propOr': 'getOr', 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', 'unapply': 'rest', 'unnest': 'flatten', 'useWith': 'overArgs', - 'whereEq': 'filter', + 'where': 'conformsTo', + 'whereEq': 'isMatch', 'zipObj': 'zipObject' }; /** Used to map ary to method names. */ exports.aryMethod = { '1': [ - 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', - 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', - 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', - 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', - 'uniqueId', 'words' + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', + 'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', + 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', + 'trimStart', 'uniqueId', 'words', 'zipAll' ], '2': [ - 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', - 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', - 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', - 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', - 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', - 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', - 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', - 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', - 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', - 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', - 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth', - 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', - 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', @@ -703,7 +784,9 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to map method names to rearg configs. */ exports.methodRearg = { + 'assignInAllWith': [1, 2, 0], 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 2, 0], 'assignWith': [1, 2, 0], 'differenceBy': [1, 2, 0], 'differenceWith': [1, 2, 0], @@ -712,6 +795,7 @@ return /******/ (function(modules) { // webpackBootstrap 'intersectionWith': [1, 2, 0], 'isEqualWith': [1, 2, 0], 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 2, 0], 'mergeWith': [1, 2, 0], 'padChars': [2, 1, 0], 'padCharsEnd': [2, 1, 0], @@ -731,11 +815,20 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to map method names to spread configs. */ exports.methodSpread = { - 'invokeArgs': 2, - 'invokeArgsMap': 2, - 'partial': 1, - 'partialRight': 1, - 'without': 1 + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'afterRearg': true, 'start': 1 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'afterRearg': true, 'start': 1 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'afterRearg': true, 'start': 1 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } }; /** Used to identify methods which mutate arrays or objects. */ @@ -752,13 +845,21 @@ return /******/ (function(modules) { // webpackBootstrap }, 'object': { 'assign': true, + 'assignAll': true, + 'assignAllWith': true, 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, 'assignInWith': true, 'assignWith': true, 'defaults': true, + 'defaultsAll': true, 'defaultsDeep': true, + 'defaultsDeepAll': true, 'merge': true, - 'mergeWith': true + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, }, 'set': { 'set': true, @@ -798,8 +899,14 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to map method names to other names. */ exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', 'curryN': 'curry', 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', 'findFrom': 'find', 'findIndexFrom': 'findIndex', 'findLastFrom': 'findLast', @@ -810,14 +917,18 @@ return /******/ (function(modules) { // webpackBootstrap 'invokeArgs': 'invoke', 'invokeArgsMap': 'invokeMap', 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', 'padChars': 'pad', 'padCharsEnd': 'padEnd', 'padCharsStart': 'padStart', + 'propertyOf': 'get', 'restFrom': 'rest', 'spreadFrom': 'spread', 'trimChars': 'trim', 'trimCharsEnd': 'trimEnd', - 'trimCharsStart': 'trimStart' + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' }; /** Used to track methods that skip fixing their arity. */ @@ -827,6 +938,7 @@ return /******/ (function(modules) { // webpackBootstrap 'flowRight': true, 'iteratee': true, 'mixin': true, + 'rearg': true, 'runInContext': true }; @@ -852,12 +964,14 @@ return /******/ (function(modules) { // webpackBootstrap 'overArgs': true, 'partial': true, 'partialRight': true, + 'propertyOf': true, 'random': true, 'range': true, 'rangeRight': true, 'subtract': true, 'zip': true, - 'zipObject': true + 'zipObject': true, + 'zipObjectDeep': true }; diff --git a/dist/lodash.fp.min.js b/dist/lodash.fp.min.js index 59affc318..e87ab1c60 100644 --- a/dist/lodash.fp.min.js +++ b/dist/lodash.fp.min.js @@ -1,17 +1,20 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&(_=n(_.runInContext())), -t.exports=n},function(t,e,r){function n(t,e){return 2==e?function(e,r){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}function i(t,e){return 2==e?function(e,r){return t(e,r)}:function(e){return t(e)}}function a(t){for(var e=t?t.length:0,r=Array(e);e--;)r[e]=t[e];return r}function o(t){return function(e){return t({},e)}}function s(t,e){return function(){var r=arguments.length;if(!r)return i;for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=e.apply(void 0,n);return t.apply(void 0,n), -i}}function u(t,e,r,c){function f(t,e){e=D(e);for(var r=-1,n=e.length,i=n-1,a=w(Object(t)),o=a;null!=o&&++r1&&(k||!p.skipRearg[t])&&(r=z(r,p.methodRearg[t]||p.aryRearg[e])),A.cap&&(o?r=g(r,o):a&&(r=m(r,a))),(O||A.curry&&e>1)&&(O&&console.log(O,t),r=L(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=O?L(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=B),r}var W,I="function"==typeof e,R=e===Object(e);if(R&&(c=r,r=e,e=void 0),null==r)throw new TypeError;c||(c={});var A={cap:"cap"in c?c.cap:!0,curry:"curry"in c?c.curry:!0,fixed:"fixed"in c?c.fixed:!0, -immutable:"immutable"in c?c.immutable:!0,rearg:"rearg"in c?c.rearg:!0},O="curry"in c&&c.curry,b="fixed"in c&&c.fixed,k="rearg"in c&&c.rearg,B=I?r:l,E=I?r.runInContext():void 0,F=I?r:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isFunction:t.isFunction,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,spread:t.spread,toPath:t.toPath},j=F.ary,C=F.assign,w=F.clone,L=F.curry,M=F.forEach,q=F.isArray,P=F.isFunction,S=F.keys,z=F.rearg,K=F.spread,D=F.toPath,T=S(p.aryMethod),_={ -castArray:function(t){return function(){var e=arguments[0];return q(e)?t(a(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],r=arguments[1],n=t(e,r),a=n.length;return A.cap&&"number"==typeof r?(r=r>2?r-2:1,a&&r>=a?n:i(n,r)):n}},mixin:function(t){return function(e){var r=this;if(!P(r))return t(r,Object(e));var n=[];return M(S(e),function(t){P(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),M(n,function(t){var e=t[1];P(e)?r.prototype[t[0]]=e:delete r.prototype[t[0]]; -}),r}},runInContext:function(e){return function(r){return u(t,e(r),c)}}};if(!R)return x(e,r);var N=r,V=[];return M(T,function(t){M(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),M(S(N),function(t){var e=N[t];if("function"==typeof e){for(var r=V.length;r--;)if(V[r][0]==t)return;e.convert=y(t,e),V.push([t,e])}}),M(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=B),M(S(N),function(t){M(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),d=p.mutate,l=r(3); -t.exports=u},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendWith:"assignInWith",first:"head",__:"placeholder",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",equals:"isEqual",identical:"eq",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit", -nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},e.aryMethod={1:["attempt","castArray","ceil","create","curry","curryRight","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"], -2:["add","after","ary","assign","assignIn","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"], +(function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()})(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&(_=n(_.runInContext())), +t.exports=n},function(t,e,r){function n(t,e){return 2==e?function(e,r){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}function i(t,e){return 2==e?function(e,r){return t(e,r)}:function(e){return t(e)}}function a(t){for(var e=t?t.length:0,r=Array(e);e--;)r[e]=t[e];return r}function o(t){return function(e){return t({},e)}}function s(t,e){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=e.apply(void 0,n);return t.apply(void 0,n), +i}}}function l(t,e,r,d){function c(t,e){if(B.cap){var r=u.iterateeRearg[t];if(r)return x(e,r);var n=!b&&u.iterateeAry[t];if(n)return W(e,n)}return e}function h(t,e,r){return E||B.curry&&r>1?q(e,r):e}function g(t,e,r){if(B.fixed&&(F||!u.skipFixed[t])){var n=u.methodSpread[t],i=n&&n.start;return void 0===i?M(e,r):N(e,i)}return e}function y(t,e,r){return B.rearg&&r>1&&(j||!u.skipRearg[t])?_(e,u.methodRearg[t]||u.aryRearg[r]):e}function m(t,e){e=V(e);for(var r=-1,n=e.length,i=n-1,a=z(Object(t)),o=a;null!=o&&++r2?r-2:1,a&&a<=r?n:i(n,r)):n}},mixin:function(t){return function(e){ +var r=this;if(!T(r))return t(r,Object(e));var n=[];return P(K(e),function(t){T(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),P(n,function(t){var e=t[1];T(e)?r.prototype[t[0]]=e:delete r.prototype[t[0]]}),r}},rearg:function(t){return function(e,r){var n=r?r.length:0;return q(t(e,r),n)}},runInContext:function(e){return function(r){return l(t,e(r),d)}}};if(!k)return R(e,r);var H=r,J=[];return P(U,function(t){P(u.aryMethod[t],function(t){var e=H[u.remap[t]||t];e&&J.push([t,R(t,e)])})}),P(K(H),function(t){ +var e=H[t];if("function"==typeof e){for(var r=J.length;r--;)if(J[r][0]==t)return;e.convert=A(t,e),J.push([t,e])}}),P(J,function(t){H[t[0]]=t[1]}),H.convert=v,O&&(H.placeholder=L),P(K(H),function(t){P(u.realToAlias[t]||[],function(e){H[e]=H[t]})}),H}var u=r(2),p=u.mutate,f=r(3);t.exports=l},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head", +conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty", +pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"], +2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"], 3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"], 4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1, -transform:2},e.iterateeRearg={mapKeys:[1]},e.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0], -zipWith:[1,2,0]},e.methodSpread={invokeArgs:2,invokeArgsMap:2,partial:1,partialRight:1,without:1},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,merge:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={}; -for(var i in r){var a=r[i];t.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),e.remap={curryN:"curry",curryRightN:"curryRight",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart" -},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0}},function(t,e){t.exports={}}])}); \ No newline at end of file +transform:2},e.iterateeRearg={mapKeys:[1]},e.methodRearg={assignInAllWith:[1,2,0],assignInWith:[1,2,0],assignAllWith:[1,2,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,2,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0], +unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{afterRearg:!0,start:1},assignInAll:{start:0},assignInAllWith:{afterRearg:!0,start:1},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{afterRearg:!0,start:1},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0, +pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={}; +for(var i in r){var a=r[i];t.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf", +mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0, +overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(t,e){t.exports={}}])}); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 5b5c703ba..8dd467299 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.13.1'; + var VERSION = '4.14.0'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -26,7 +26,7 @@ /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; - /** Used to compose bitmasks for wrapper metadata. */ + /** Used to compose bitmasks for function metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, @@ -66,6 +66,19 @@ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', ARY_FLAG], + ['bind', BIND_FLAG], + ['bindKey', BIND_KEY_FLAG], + ['curry', CURRY_FLAG], + ['curryRight', CURRY_RIGHT_FLAG], + ['flip', FLIP_FLAG], + ['partial', PARTIAL_FLAG], + ['partialRight', PARTIAL_RIGHT_FLAG], + ['rearg', REARG_FLAG] + ]; + /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', @@ -130,6 +143,11 @@ reTrimStart = /^\s+/, reTrimEnd = /\s+$/; + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + /** Used to match non-compound words composed of alphanumeric characters. */ var reBasicWord = /[a-zA-Z0-9]+/g; @@ -249,7 +267,7 @@ 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'isFinite', 'parseInt', 'setTimeout' + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ @@ -342,8 +360,17 @@ var freeParseFloat = parseFloat, freeParseInt = parseInt; + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports; + var freeExports = freeGlobal && typeof exports == 'object' && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module; @@ -351,17 +378,23 @@ /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(typeof global == 'object' && global); + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(typeof self == 'object' && self); + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} + }()); - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(typeof this == 'object' && this); - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ @@ -374,7 +407,7 @@ * @returns {Object} Returns `map`. */ function addMapEntry(map, pair) { - // Don't return `Map#set` because it doesn't return the map instance in IE 11. + // Don't return `map.set` because it's not chainable in IE 11. map.set(pair[0], pair[1]); return map; } @@ -388,6 +421,7 @@ * @returns {Object} Returns `set`. */ function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. set.add(value); return set; } @@ -403,8 +437,7 @@ * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { - var length = args.length; - switch (length) { + switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); @@ -721,7 +754,7 @@ */ function baseIndexOf(array, value, fromIndex) { if (value !== value) { - return indexOfNaN(array, fromIndex); + return baseFindIndex(array, baseIsNaN, fromIndex); } var index = fromIndex - 1, length = array.length; @@ -756,6 +789,17 @@ return -1; } + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. @@ -770,6 +814,32 @@ return length ? (baseSum(array, iteratee) / length) : NAN; } + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. @@ -870,7 +940,7 @@ } /** - * The base implementation of `_.unary` without support for storing wrapper metadata. + * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. @@ -943,17 +1013,6 @@ return index; } - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - /** * Gets the number of `placeholder` occurrences in `array`. * @@ -981,9 +1040,7 @@ * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } + var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. @@ -992,9 +1049,7 @@ * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } + var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. @@ -1019,28 +1074,6 @@ return object == null ? undefined : object[key]; } - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - /** * Checks if `value` is a host object in IE < 9. * @@ -1094,6 +1127,20 @@ return result; } + /** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. @@ -1189,9 +1236,7 @@ * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /*--------------------------------------------------------------------------*/ @@ -1235,7 +1280,8 @@ context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root; /** Built-in constructor references. */ - var Date = context.Date, + var Array = context.Array, + Date = context.Date, Error = context.Error, Math = context.Math, RegExp = context.RegExp, @@ -1289,19 +1335,22 @@ Symbol = context.Symbol, Uint8Array = context.Uint8Array, enumerate = Reflect ? Reflect.enumerate : undefined, - getOwnPropertySymbols = Object.getOwnPropertySymbols, - iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, - objectCreate = Object.create, + iteratorSymbol = Symbol ? Symbol.iterator : undefined, + objectCreate = context.Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** Built-in method references that are mockable. */ - var setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); }; + var clearTimeout = function(id) { return context.clearTimeout.call(root, id); }, + setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); }; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetPrototype = Object.getPrototypeOf, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = Object.keys, @@ -1319,7 +1368,15 @@ Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); + nativeCreate = getNative(context.Object, 'create'); + + /* Used to set `toString` methods. */ + var defineProperty = (function() { + var func = getNative(context.Object, 'defineProperty'), + name = getNative.name; + + return (name && name.length > 2) ? func : undefined; + }()); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; @@ -1410,16 +1467,16 @@ * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, - * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, - * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, - * `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`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `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`, @@ -2122,8 +2179,13 @@ */ function stackSet(key, value) { var cache = this.__data__; - if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { - cache = this.__data__ = new MapCache(cache.__data__); + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); } cache.set(key, value); return this; @@ -2260,7 +2322,7 @@ } /** - * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. @@ -2344,14 +2406,17 @@ if (!isArr) { var props = isFull ? getAllKeys(value) : keys(value); } - // Recursively populate clone (susceptible to call stack limits). arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } + // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); }); + if (!isFull) { + stack['delete'](value); + } return result; } @@ -2363,28 +2428,39 @@ * @returns {Function} Returns the new spec function. */ function baseConforms(source) { - var props = keys(source), - length = props.length; - + var props = keys(source); return function(object) { - if (object == null) { - return !length; - } - var index = length; - while (index--) { - var key = props[index], - predicate = source[key], - value = object[key]; - - if ((value === undefined && - !(key in Object(object))) || !predicate(value)) { - return false; - } - } - return true; + return baseConformsTo(object, source, props); }; } + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + var index = length; + while (index--) { + var key = props[index], + predicate = source[key], + value = object[key]; + + if ((value === undefined && + !(key in Object(object))) || !predicate(value)) { + return false; + } + } + return true; + } + /** * The base implementation of `_.create` without support for assigning * properties to the created object. @@ -2398,13 +2474,13 @@ } /** - * The base implementation of `_.delay` and `_.defer` which accepts an array - * of `func` arguments. + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments to provide to `func`. + * @param {Array} args The arguments to provide to `func`. * @returns {number} Returns the timer id. */ function baseDelay(func, wait, args) { @@ -2718,7 +2794,18 @@ } /** - * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString.call(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. @@ -2760,7 +2847,7 @@ } /** - * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. + * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. @@ -2873,6 +2960,28 @@ return func == null ? undefined : apply(func, object, args); } + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; + } + /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. @@ -2956,6 +3065,17 @@ return equalObjects(object, other, equalFunc, customizer, bitmask, stack); } + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * @@ -3026,6 +3146,40 @@ return pattern.test(toSource(value)); } + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + /** * The base implementation of `_.iteratee`. * @@ -3058,9 +3212,7 @@ * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } + var baseKeys = overArg(nativeKeys, Object); /** * The base implementation of `_.keysIn` which doesn't skip the constructor @@ -3088,7 +3240,7 @@ } /** - * The base implementation of `_.lt` which doesn't coerce arguments to numbers. + * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. @@ -3255,18 +3407,17 @@ isCommon = false; } } - stack.set(srcValue, newValue); - if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); } - stack['delete'](srcValue); assignMergeValue(object, key, newValue); } /** - * The base implementation of `_.nth` which doesn't coerce `n` to an integer. + * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. @@ -3318,12 +3469,9 @@ */ function basePick(object, props) { object = Object(object); - return arrayReduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); + return basePickBy(object, props, function(value, key) { + return key in object; + }); } /** @@ -3331,12 +3479,12 @@ * * @private * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick from. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ - function basePickBy(object, predicate) { + function basePickBy(object, props, predicate) { var index = -1, - props = getAllKeysIn(object), length = props.length, result = {}; @@ -3351,19 +3499,6 @@ return result; } - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - /** * A specialized version of `baseProperty` which supports deep paths. * @@ -3466,7 +3601,7 @@ /** * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments to numbers. + * coerce arguments. * * @private * @param {number} start The start of the range. @@ -3515,6 +3650,35 @@ return result; } + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + /** * The base implementation of `_.set`. * @@ -4294,9 +4458,9 @@ var newValue = customizer ? customizer(object[key], source[key], key, object, source) - : source[key]; + : undefined; - assignValue(object, key, newValue); + assignValue(object, key, newValue === undefined ? source[key] : newValue); } return object; } @@ -4326,7 +4490,7 @@ var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; - return func(collection, setter, getIteratee(iteratee), accumulator); + return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } @@ -4338,7 +4502,7 @@ * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return rest(function(object, sources) { + return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, @@ -4422,14 +4586,13 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ - function createBaseWrapper(func, bitmask, thisArg) { + function createBind(func, bitmask, thisArg) { var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); + Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; @@ -4486,7 +4649,7 @@ * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ - function createCtorWrapper(Ctor) { + function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist @@ -4516,13 +4679,12 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createCurryWrapper(func, bitmask, arity) { - var Ctor = createCtorWrapper(func); + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); function wrapper() { var length = arguments.length, @@ -4539,8 +4701,8 @@ length -= holders.length; if (length < arity) { - return createRecurryWrapper( - func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; @@ -4559,18 +4721,13 @@ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); - predicate = getIteratee(predicate, 3); if (!isArrayLike(collection)) { - var props = keys(collection); + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } - var index = findIndexFunc(props || collection, function(value, key) { - if (props) { - key = value; - value = iterable[key]; - } - return predicate(value, key, iterable); - }, fromIndex); - return index > -1 ? collection[props ? props[index] : index] : undefined; + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } @@ -4582,7 +4739,7 @@ * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { - return rest(function(funcs) { + return baseRest(function(funcs) { funcs = baseFlatten(funcs, 1); var length = funcs.length, @@ -4644,8 +4801,7 @@ * * @private * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. @@ -4658,13 +4814,13 @@ * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), isFlip = bitmask & FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtorWrapper(func); + Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, @@ -4687,8 +4843,8 @@ length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); - return createRecurryWrapper( - func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } @@ -4705,7 +4861,7 @@ args.length = ary; } if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(fn); + fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } @@ -4731,13 +4887,14 @@ * * @private * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ - function createMathOperation(operator) { + function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { - return 0; + return defaultValue; } if (value !== undefined) { result = value; @@ -4767,12 +4924,12 @@ * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { - return rest(function(iteratees) { + return baseRest(function(iteratees) { iteratees = (iteratees.length == 1 && isArray(iteratees[0])) ? arrayMap(iteratees[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee())); + : arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee())); - return rest(function(args) { + return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); @@ -4809,16 +4966,15 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ - function createPartialWrapper(func, bitmask, thisArg, partials) { + function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); + Ctor = createCtor(func); function wrapper() { var argsIndex = -1, @@ -4887,8 +5043,7 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. @@ -4900,7 +5055,7 @@ * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, @@ -4923,7 +5078,7 @@ setData(result, newData); } result.placeholder = placeholder; - return result; + return setWrapToString(result, func, bitmask); } /** @@ -4952,7 +5107,7 @@ } /** - * Creates a set of `values`. + * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. @@ -4988,7 +5143,7 @@ * * @private * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. + * @param {number} bitmask The bitmask flags. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -5008,7 +5163,7 @@ * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); @@ -5051,16 +5206,16 @@ bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == BIND_FLAG) { - var result = createBaseWrapper(func, bitmask, thisArg); + var result = createBind(func, bitmask, thisArg); } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { - result = createCurryWrapper(func, bitmask, arity); + result = createCurry(func, bitmask, arity); } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { - result = createPartialWrapper(func, bitmask, thisArg, partials); + result = createPartial(func, bitmask, thisArg, partials); } else { - result = createHybridWrapper.apply(undefined, newData); + result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; - return setter(result, newData); + return setWrapToString(setter(result, newData), func, bitmask); } /** @@ -5087,7 +5242,7 @@ } // Assume cyclic values are equal. var stacked = stack.get(array); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var index = -1, @@ -5095,6 +5250,7 @@ seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; stack.set(array, other); + stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { @@ -5173,18 +5329,14 @@ case boolTag: case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and - // booleans to `1` or `0` treating invalid dates coerced to `NaN` as - // not equal. - return +object == +other; + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, @@ -5208,10 +5360,12 @@ return stacked == other; } bitmask |= UNORDERED_COMPARE_FLAG; - stack.set(object, other); // Recursively compare objects (susceptible to call stack limits). - return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; case symbolTag: if (symbolValueOf) { @@ -5254,11 +5408,12 @@ } // Assume cyclic values are equal. var stacked = stack.get(object); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); + stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { @@ -5450,9 +5605,7 @@ * @param {*} value The value to query. * @returns {null|Object} Returns the `[[Prototype]]`. */ - function getPrototype(value) { - return nativeGetPrototype(Object(value)); - } + var getPrototype = overArg(nativeGetPrototype, Object); /** * Creates an array of the own enumerable symbol properties of `object`. @@ -5461,16 +5614,7 @@ * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - function getSymbols(object) { - // Coerce `object` to an object to avoid non-object errors in V8. - // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. - return getOwnPropertySymbols(Object(object)); - } - - // Fallback for IE < 11. - if (!getOwnPropertySymbols) { - getSymbols = stubArray; - } + var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; /** * Creates an array of the own and inherited enumerable symbol properties @@ -5480,7 +5624,7 @@ * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); @@ -5496,9 +5640,7 @@ * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ - function getTag(value) { - return objectToString.call(value); - } + var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11, // for data views in Edge, and promises in Node.js. @@ -5553,6 +5695,18 @@ return { 'start': start, 'end': end }; } + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + /** * Checks if `path` exists on `object`. * @@ -5682,6 +5836,23 @@ return null; } + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length, + lastIndex = length - 1; + + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + /** * Checks if `value` is a flattenable `arguments` object or array. * @@ -5690,19 +5861,8 @@ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArray(value) || isArguments(value); - } - - /** - * Checks if `value` is a flattenable array and not a `_.matchesProperty` - * iteratee shorthand. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenableIteratee(value) { - return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]) } /** @@ -5952,7 +6112,10 @@ */ function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { - baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); + stack['delete'](srcValue); } return objValue; } @@ -6025,6 +6188,25 @@ }; }()); + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) { + var source = (reference + ''); + return defineProperty(wrapper, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))) + }); + }; + /** * Converts `string` to a property path array. * @@ -6074,6 +6256,24 @@ return ''; } + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + /** * Creates a clone of `wrapper`. * @@ -6202,11 +6402,13 @@ } /** - * Creates an array of unique `array` values not included in the other given - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. The order of result values is determined by the * order they occur in the first array. * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -6220,7 +6422,7 @@ * _.difference([2, 1], [2, 3]); * // => [1] */ - var difference = rest(function(array, values) { + var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; @@ -6232,14 +6434,15 @@ * by which they're compared. Result values are chosen from the first array. * The iteratee is invoked with one argument: (value). * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * @@ -6250,13 +6453,13 @@ * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var differenceBy = rest(function(array, values) { + var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); @@ -6266,6 +6469,8 @@ * are chosen from the first array. The comparator is invoked with two arguments: * (arrVal, othVal). * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * * @static * @memberOf _ * @since 4.0.0 @@ -6281,7 +6486,7 @@ * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ - var differenceWith = rest(function(array, values) { + var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; @@ -6370,8 +6575,7 @@ * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * @@ -6412,7 +6616,7 @@ * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example @@ -6494,7 +6698,7 @@ * @since 1.1.0 * @category Array * @param {Array} array The array to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. @@ -6542,7 +6746,7 @@ * @since 2.0.0 * @category Array * @param {Array} array The array to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. @@ -6663,8 +6867,8 @@ * @returns {Object} Returns the new object. * @example * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, @@ -6770,7 +6974,7 @@ * _.intersection([2, 1], [2, 3]); * // => [2] */ - var intersection = rest(function(arrays) { + var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) @@ -6788,8 +6992,7 @@ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * @@ -6800,7 +7003,7 @@ * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ - var intersectionBy = rest(function(arrays) { + var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); @@ -6810,7 +7013,7 @@ mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee)) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); @@ -6835,7 +7038,7 @@ * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ - var intersectionWith = rest(function(arrays) { + var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); @@ -6923,7 +7126,7 @@ ) + 1; } if (value !== value) { - return indexOfNaN(array, index - 1, true); + return baseFindIndex(array, baseIsNaN, index - 1, true); } while (index--) { if (array[index] === value) { @@ -6981,7 +7184,7 @@ * console.log(array); * // => ['b', 'b'] */ - var pull = rest(pullAll); + var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. @@ -7022,7 +7225,7 @@ * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns `array`. * @example @@ -7035,7 +7238,7 @@ */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee)) + ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } @@ -7092,7 +7295,7 @@ * console.log(pulled); * // => ['b', 'd'] */ - var pullAt = rest(function(array, indexes) { + var pullAt = baseRest(function(array, indexes) { indexes = baseFlatten(indexes, 1); var length = array ? array.length : 0, @@ -7118,7 +7321,7 @@ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example @@ -7246,7 +7449,7 @@ * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. @@ -7262,7 +7465,7 @@ * // => 0 */ function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee)); + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** @@ -7325,7 +7528,7 @@ * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. @@ -7341,7 +7544,7 @@ * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee), true); + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** @@ -7410,7 +7613,7 @@ */ function sortedUniqBy(array, iteratee) { return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee)) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } @@ -7510,7 +7713,7 @@ * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example @@ -7552,7 +7755,7 @@ * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example @@ -7600,14 +7803,15 @@ * _.union([2], [1, 2]); * // => [2, 1] */ - var union = rest(function(arrays) { + var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. The iteratee is invoked with one argument: + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static @@ -7615,7 +7819,7 @@ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example @@ -7627,17 +7831,18 @@ * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ - var unionBy = rest(function(arrays) { + var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static @@ -7655,7 +7860,7 @@ * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var unionWith = rest(function(arrays) { + var unionWith = baseRest(function(arrays) { var comparator = last(arrays); if (isArrayLikeObject(comparator)) { comparator = undefined; @@ -7696,7 +7901,7 @@ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example @@ -7710,7 +7915,7 @@ */ function uniqBy(array, iteratee) { return (array && array.length) - ? baseUniq(array, getIteratee(iteratee)) + ? baseUniq(array, getIteratee(iteratee, 2)) : []; } @@ -7752,11 +7957,11 @@ * @returns {Array} Returns the new array of regrouped elements. * @example * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] + * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { @@ -7813,6 +8018,8 @@ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * + * **Note:** Unlike `_.pull`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -7826,7 +8033,7 @@ * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ - var without = rest(function(array, values) { + var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; @@ -7850,7 +8057,7 @@ * _.xor([2, 1], [2, 3]); * // => [1, 3] */ - var xor = rest(function(arrays) { + var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); @@ -7865,7 +8072,7 @@ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example @@ -7877,12 +8084,12 @@ * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var xorBy = rest(function(arrays) { + var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee)); + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** @@ -7905,7 +8112,7 @@ * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var xorWith = rest(function(arrays) { + var xorWith = baseRest(function(arrays) { var comparator = last(arrays); if (isArrayLikeObject(comparator)) { comparator = undefined; @@ -7926,10 +8133,10 @@ * @returns {Array} Returns the new array of grouped elements. * @example * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] */ - var zip = rest(unzip); + var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, @@ -7989,7 +8196,7 @@ * }); * // => [111, 222] */ - var zipWith = rest(function(arrays) { + var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; @@ -8105,7 +8312,7 @@ * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ - var wrapperAt = rest(function(paths) { + var wrapperAt = baseRest(function(paths) { paths = baseFlatten(paths, 1); var length = paths.length, start = length ? paths[0] : 0, @@ -8358,7 +8565,7 @@ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example @@ -8384,7 +8591,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, @@ -8424,12 +8631,14 @@ * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * + * **Note:** Unlike `_.remove`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject @@ -8470,7 +8679,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @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`. @@ -8508,7 +8717,7 @@ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. @@ -8531,7 +8740,7 @@ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example @@ -8556,7 +8765,7 @@ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example @@ -8581,7 +8790,7 @@ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. @@ -8671,7 +8880,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example @@ -8715,10 +8924,10 @@ * _.includes([1, 2, 3], 1, 2); * // => false * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * - * _.includes('pebbles', 'eb'); + * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { @@ -8737,8 +8946,8 @@ /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function, it's - * invoked for and `this` bound to, each element in `collection`. + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ @@ -8757,7 +8966,7 @@ * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ - var invokeMap = rest(function(collection, path, args) { + var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', isProp = isKey(path), @@ -8781,7 +8990,7 @@ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example @@ -8822,8 +9031,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * @@ -8905,8 +9113,7 @@ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * @@ -9017,8 +9224,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example @@ -9045,10 +9251,7 @@ */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getIteratee(predicate, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); + return func(collection, negate(getIteratee(predicate, 3))); } /** @@ -9181,8 +9384,7 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. @@ -9227,8 +9429,8 @@ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [iteratees=[_.identity]] The iteratees to sort by. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * @@ -9250,7 +9452,7 @@ * }); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ - var sortBy = rest(function(collection, iteratees) { + var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } @@ -9260,11 +9462,7 @@ } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } - iteratees = (iteratees.length == 1 && isArray(iteratees[0])) - ? iteratees[0] - : baseFlatten(iteratees, 1, isFlattenableIteratee); - - return baseOrderBy(collection, iteratees, []); + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ @@ -9347,7 +9545,7 @@ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; - return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); + return createWrap(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** @@ -9365,7 +9563,7 @@ * @example * * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list + * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; @@ -9404,9 +9602,9 @@ * @returns {Function} Returns the new bound function. * @example * - * var greet = function(greeting, punctuation) { + * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; - * }; + * } * * var object = { 'user': 'fred' }; * @@ -9419,13 +9617,13 @@ * bound('hi'); * // => 'hi fred!' */ - var bind = rest(function(func, thisArg, partials) { + var bind = baseRest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= PARTIAL_FLAG; } - return createWrapper(func, bitmask, thisArg, partials, holders); + return createWrap(func, bitmask, thisArg, partials, holders); }); /** @@ -9473,13 +9671,13 @@ * bound('hi'); * // => 'hiya fred!' */ - var bindKey = rest(function(object, key, partials) { + var bindKey = baseRest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= PARTIAL_FLAG; } - return createWrapper(key, bitmask, object, partials, holders); + return createWrap(key, bitmask, object, partials, holders); }); /** @@ -9525,7 +9723,7 @@ */ function curry(func, arity, guard) { arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + var result = createWrap(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } @@ -9570,7 +9768,7 @@ */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + var result = createWrap(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } @@ -9708,6 +9906,9 @@ } function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } @@ -9762,7 +9963,7 @@ * }, 'deferred'); * // => Logs 'deferred' after one or more milliseconds. */ - var defer = rest(function(func, args) { + var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); @@ -9785,7 +9986,7 @@ * }, 1000, 'later'); * // => Logs 'later' after one second. */ - var delay = rest(function(func, wait, args) { + var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); @@ -9808,7 +10009,7 @@ * // => ['d', 'c', 'b', 'a'] */ function flip(func) { - return createWrapper(func, FLIP_FLAG); + return createWrap(func, FLIP_FLAG); } /** @@ -9903,7 +10104,14 @@ throw new TypeError(FUNC_ERROR_TEXT); } return function() { - return !predicate.apply(this, arguments); + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); }; } @@ -9923,23 +10131,22 @@ * var initialize = _.once(createApplication); * initialize(); * initialize(); - * // `initialize` invokes `createApplication` once + * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** - * Creates a function that invokes `func` with arguments transformed by - * corresponding `transforms`. + * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [transforms[_.identity]] The functions to transform. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. * @returns {Function} Returns the new function. * @example * @@ -9961,13 +10168,13 @@ * func(10, 5); * // => [100, 10] */ - var overArgs = rest(function(func, transforms) { + var overArgs = baseRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee())); + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; - return rest(function(args) { + return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); @@ -9998,9 +10205,9 @@ * @returns {Function} Returns the new partially applied function. * @example * - * var greet = function(greeting, name) { + * function greet(greeting, name) { * return greeting + ' ' + name; - * }; + * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); @@ -10011,9 +10218,9 @@ * greetFred('hi'); * // => 'hi fred' */ - var partial = rest(function(func, partials) { + var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); - return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); + return createWrap(func, PARTIAL_FLAG, undefined, partials, holders); }); /** @@ -10035,9 +10242,9 @@ * @returns {Function} Returns the new partially applied function. * @example * - * var greet = function(greeting, name) { + * function greet(greeting, name) { * return greeting + ' ' + name; - * }; + * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); @@ -10048,9 +10255,9 @@ * sayHelloTo('fred'); * // => 'hello fred' */ - var partialRight = rest(function(func, partials) { + var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); + return createWrap(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** @@ -10075,8 +10282,8 @@ * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ - var rearg = rest(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); + var rearg = baseRest(function(func, indexes) { + return createWrap(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); }); /** @@ -10108,29 +10315,8 @@ if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); } /** @@ -10172,7 +10358,7 @@ throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? 0 : nativeMax(toInteger(start), 0); - return rest(function(args) { + return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); @@ -10262,10 +10448,10 @@ } /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. * * @static * @memberOf _ @@ -10450,6 +10636,32 @@ return baseClone(value, true, true, customizer); } + /** + * Checks if `object` conforms to `source` by invoking the predicate properties + * of `source` with the corresponding property values of `object`. This method + * is equivalent to a `_.conforms` function when `source` is partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -10464,8 +10676,8 @@ * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.eq(object, object); * // => true @@ -10546,7 +10758,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -10568,11 +10780,9 @@ * @static * @memberOf _ * @since 0.1.0 - * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); @@ -10597,8 +10807,7 @@ * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); @@ -10607,9 +10816,7 @@ * _.isArrayBuffer(new Array(2)); * // => false */ - function isArrayBuffer(value) { - return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; - } + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's @@ -10677,8 +10884,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); @@ -10709,9 +10915,7 @@ * _.isBuffer(new Uint8Array(2)); * // => false */ - var isBuffer = !Buffer ? stubFalse : function(value) { - return value instanceof Buffer; - }; + var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. @@ -10721,8 +10925,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); @@ -10731,9 +10934,7 @@ * _.isDate('Mon April 23 2012'); * // => false */ - function isDate(value) { - return isObjectLike(value) && objectToString.call(value) == dateTag; - } + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. @@ -10830,8 +11031,8 @@ * else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true @@ -10948,8 +11149,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -11094,8 +11294,7 @@ * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); @@ -11104,9 +11303,7 @@ * _.isMap(new WeakMap); * // => false */ - function isMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to @@ -11124,12 +11321,12 @@ * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * - * var object = { 'user': 'fred', 'age': 40 }; + * var object = { 'a': 1, 'b': 2 }; * - * _.isMatch(object, { 'age': 40 }); + * _.isMatch(object, { 'b': 2 }); * // => true * - * _.isMatch(object, { 'age': 36 }); + * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { @@ -11211,13 +11408,13 @@ /** * Checks if `value` is a pristine native function. * - * **Note:** This method can't reliably detect native functions in the - * presence of the `core-js` package because `core-js` circumvents this kind - * of detection. Despite multiple requests, the `core-js` maintainer has made - * it clear: any attempt to fix the detection will be obstructed. As a result, - * we're left with little choice but to throw an error. Unfortunately, this - * also affects packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on `core-js`. + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. * * @static * @memberOf _ @@ -11236,7 +11433,7 @@ */ function isNative(value) { if (isMaskable(value)) { - throw new Error('This method is not supported with `core-js`. Try https://github.com/es-shims.'); + throw new Error('This method is not supported with core-js. Try https://github.com/es-shims.'); } return baseIsNative(value); } @@ -11297,8 +11494,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); @@ -11369,8 +11565,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); @@ -11379,9 +11574,7 @@ * _.isRegExp('/abc/'); * // => false */ - function isRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; - } + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 @@ -11423,8 +11616,7 @@ * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); @@ -11433,9 +11625,7 @@ * _.isSet(new WeakSet); * // => false */ - function isSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. @@ -11445,8 +11635,7 @@ * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); @@ -11468,8 +11657,7 @@ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); @@ -11491,8 +11679,7 @@ * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); @@ -11501,10 +11688,7 @@ * _.isTypedArray([]); * // => false */ - function isTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. @@ -11535,8 +11719,7 @@ * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); @@ -11557,8 +11740,7 @@ * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); @@ -11907,18 +12089,18 @@ * @example * * function Foo() { - * this.c = 3; + * this.a = 1; * } * * function Bar() { - * this.e = 5; + * this.c = 3; * } * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { @@ -11950,18 +12132,18 @@ * @example * * function Foo() { - * this.b = 2; + * this.a = 1; * } * * function Bar() { - * this.d = 4; + * this.c = 3; * } * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { @@ -12055,7 +12237,7 @@ * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ - var at = rest(function(object, paths) { + var at = baseRest(function(object, paths) { return baseAt(object, baseFlatten(paths, 1)); }); @@ -12116,10 +12298,10 @@ * @see _.defaultsDeep * @example * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - var defaults = rest(function(args) { + var defaults = baseRest(function(args) { args.push(undefined, assignInDefaults); return apply(assignInWith, undefined, args); }); @@ -12140,11 +12322,10 @@ * @see _.defaults * @example * - * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); - * // => { 'user': { 'name': 'barney', 'age': 36 } } - * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } */ - var defaultsDeep = rest(function(args) { + var defaultsDeep = baseRest(function(args) { args.push(undefined, mergeDefaults); return apply(mergeWith, undefined, args); }); @@ -12158,8 +12339,7 @@ * @since 1.1.0 * @category Object * @param {Object} object The object to search. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example @@ -12198,8 +12378,7 @@ * @since 2.0.0 * @category Object * @param {Object} object The object to search. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example @@ -12413,7 +12592,7 @@ /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ @@ -12536,8 +12715,7 @@ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * @@ -12577,7 +12755,7 @@ * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ - var invoke = rest(baseInvoke); + var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. @@ -12681,8 +12859,7 @@ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example @@ -12713,8 +12890,7 @@ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example @@ -12761,16 +12937,16 @@ * @returns {Object} Returns `object`. * @example * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); @@ -12801,18 +12977,11 @@ * } * } * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); @@ -12837,7 +13006,7 @@ * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ - var omit = rest(function(object, props) { + var omit = baseRest(function(object, props) { if (object == null) { return {}; } @@ -12856,8 +13025,7 @@ * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per property. + * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -12867,10 +13035,7 @@ * // => { 'b': '2' } */ function omitBy(object, predicate) { - predicate = getIteratee(predicate); - return basePickBy(object, function(value, key) { - return !predicate(value, key); - }); + return pickBy(object, negate(getIteratee(predicate))); } /** @@ -12890,7 +13055,7 @@ * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = rest(function(object, props) { + var pick = baseRest(function(object, props) { return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey)); }); @@ -12903,8 +13068,7 @@ * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per property. + * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -12914,7 +13078,7 @@ * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, getIteratee(predicate)); + return object == null ? {} : basePickBy(object, getAllKeysIn(object), getIteratee(predicate)); } /** @@ -13539,8 +13703,9 @@ ? length : baseClamp(toInteger(position), 0, length); + var end = position; position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; + return position >= 0 && string.slice(position, end) == target; } /** @@ -13988,7 +14153,8 @@ function startsWith(string, target, position) { string = toString(string); position = baseClamp(toInteger(position), 0, string.length); - return string.lastIndexOf(baseToString(target), position) == position; + target = baseToString(target); + return string.slice(position, position + target.length) == target; } /** @@ -14571,7 +14737,7 @@ * elements = []; * } */ - var attempt = rest(function(func, args) { + var attempt = baseRest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { @@ -14596,16 +14762,16 @@ * * var view = { * 'label': 'docs', - * 'onClick': function() { + * 'click': function() { * console.log('clicked ' + this.label); * } * }; * - * _.bindAll(view, ['onClick']); - * jQuery(element).on('click', view.onClick); + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ - var bindAll = rest(function(object, methodNames) { + var bindAll = baseRest(function(object, methodNames) { arrayEach(baseFlatten(methodNames, 1), function(key) { key = toKey(key); object[key] = bind(object[key], object); @@ -14630,7 +14796,7 @@ * var func = _.cond([ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.constant(true), _.constant('no match')] + * [_.stubTrue, _.constant('no match')] * ]); * * func({ 'a': 1, 'b': 2 }); @@ -14653,7 +14819,7 @@ return [toIteratee(pair[0]), pair[1]]; }); - return rest(function(args) { + return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; @@ -14677,13 +14843,13 @@ * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } * ]; * - * _.filter(users, _.conforms({ 'age': function(n) { return n > 38; } })); - * // => [{ 'user': 'fred', 'age': 40 }] + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] */ function conforms(source) { return baseConforms(baseClone(source, true)); @@ -14714,6 +14880,30 @@ }; } + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ + function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; + } + /** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive @@ -14723,7 +14913,7 @@ * @memberOf _ * @since 3.0.0 * @category Util - * @param {...(Function|Function[])} [funcs] Functions to invoke. + * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flowRight * @example @@ -14746,7 +14936,7 @@ * @since 3.0.0 * @memberOf _ * @category Util - * @param {...(Function|Function[])} [funcs] Functions to invoke. + * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flow * @example @@ -14762,7 +14952,7 @@ var flowRight = createFlow(true); /** - * This method returns the first argument given to it. + * This method returns the first argument it receives. * * @static * @since 0.1.0 @@ -14772,7 +14962,7 @@ * @returns {*} Returns `value`. * @example * - * var object = { 'user': 'fred' }; + * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true @@ -14843,13 +15033,13 @@ * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } * ]; * - * _.filter(users, _.matches({ 'age': 40, 'active': false })); - * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, true)); @@ -14871,13 +15061,13 @@ * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } * ]; * - * _.find(users, _.matchesProperty('user', 'fred')); - * // => { 'user': 'fred' } + * _.find(objects, _.matchesProperty('a', 4)); + * // => { 'a': 4, 'b': 5, 'c': 6 } */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, true)); @@ -14907,7 +15097,7 @@ * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ - var method = rest(function(path, args) { + var method = baseRest(function(path, args) { return function(object) { return baseInvoke(object, path, args); }; @@ -14936,7 +15126,7 @@ * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ - var methodOf = rest(function(object, args) { + var methodOf = baseRest(function(object, args) { return function(path) { return baseInvoke(object, path, args); }; @@ -15035,7 +15225,7 @@ } /** - * A method that returns `undefined`. + * This method returns `undefined`. * * @static * @memberOf _ @@ -15072,7 +15262,7 @@ */ function nthArg(n) { n = toInteger(n); - return rest(function(args) { + return baseRest(function(args) { return baseNth(args, n); }); } @@ -15085,8 +15275,8 @@ * @memberOf _ * @since 4.0.0 * @category Util - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [iteratees=[_.identity]] The iteratees to invoke. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to invoke. * @returns {Function} Returns the new function. * @example * @@ -15105,8 +15295,8 @@ * @memberOf _ * @since 4.0.0 * @category Util - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [predicates=[_.identity]] The predicates to check. + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. * @returns {Function} Returns the new function. * @example * @@ -15131,8 +15321,8 @@ * @memberOf _ * @since 4.0.0 * @category Util - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [predicates=[_.identity]] The predicates to check. + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. * @returns {Function} Returns the new function. * @example * @@ -15284,7 +15474,7 @@ var rangeRight = createRange(true); /** - * A method that returns a new empty array. + * This method returns a new empty array. * * @static * @memberOf _ @@ -15306,7 +15496,7 @@ } /** - * A method that returns `false`. + * This method returns `false`. * * @static * @memberOf _ @@ -15323,7 +15513,7 @@ } /** - * A method that returns a new empty object. + * This method returns a new empty object. * * @static * @memberOf _ @@ -15345,7 +15535,7 @@ } /** - * A method that returns an empty string. + * This method returns an empty string. * * @static * @memberOf _ @@ -15362,7 +15552,7 @@ } /** - * A method that returns `true`. + * This method returns `true`. * * @static * @memberOf _ @@ -15480,7 +15670,7 @@ */ var add = createMathOperation(function(augend, addend) { return augend + addend; - }); + }, 0); /** * Computes `number` rounded up to `precision`. @@ -15522,7 +15712,7 @@ */ var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; - }); + }, 1); /** * Computes `number` rounded down to `precision`. @@ -15581,8 +15771,7 @@ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * @@ -15597,7 +15786,7 @@ */ function maxBy(array, iteratee) { return (array && array.length) - ? baseExtremum(array, getIteratee(iteratee), baseGt) + ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined; } @@ -15629,8 +15818,7 @@ * @since 4.7.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the mean. * @example * @@ -15644,7 +15832,7 @@ * // => 5 */ function meanBy(array, iteratee) { - return baseMean(array, getIteratee(iteratee)); + return baseMean(array, getIteratee(iteratee, 2)); } /** @@ -15681,8 +15869,7 @@ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * @@ -15697,7 +15884,7 @@ */ function minBy(array, iteratee) { return (array && array.length) - ? baseExtremum(array, getIteratee(iteratee), baseLt) + ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined; } @@ -15718,7 +15905,7 @@ */ var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; - }); + }, 1); /** * Computes `number` rounded to `precision`. @@ -15760,7 +15947,7 @@ */ var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; - }); + }, 0); /** * Computes the sum of the values in `array`. @@ -15792,8 +15979,7 @@ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * @@ -15808,7 +15994,7 @@ */ function sumBy(array, iteratee) { return (array && array.length) - ? baseSum(array, getIteratee(iteratee)) + ? baseSum(array, getIteratee(iteratee, 2)) : 0; } @@ -15987,7 +16173,9 @@ lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; + lodash.conformsTo = conformsTo; lodash.deburr = deburr; + lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; @@ -16228,7 +16416,7 @@ return this.reverse().find(predicate); }; - LazyWrapper.prototype.invokeMap = rest(function(path, args) { + LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { if (typeof path == 'function') { return new LazyWrapper(this); } @@ -16238,10 +16426,7 @@ }); LazyWrapper.prototype.reject = function(predicate) { - predicate = getIteratee(predicate, 3); - return this.filter(function(value) { - return !predicate(value); - }); + return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { @@ -16345,7 +16530,7 @@ } }); - realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ + realNames[createHybrid(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }]; @@ -16364,6 +16549,9 @@ lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + // Add lazy aliases. + lodash.prototype.first = lodash.prototype.head; + if (iteratorSymbol) { lodash.prototype[iteratorSymbol] = wrapperToIterator; } @@ -16375,22 +16563,21 @@ // Export lodash. var _ = runInContext(); - // Expose Lodash on the free variable `window` or `self` when available so it's - // globally accessible, even when bundled with Browserify, Webpack, etc. This - // also prevents errors in cases where Lodash is loaded by a script tag in the - // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch - // for more details. Use `_.noConflict` to remove Lodash from the global object. - (freeSelf || {})._ = _; - - // Some AMD build optimizers like r.js check for condition patterns like the following: + // Some AMD build optimizers, like r.js, check for condition patterns like: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = _; + // Define as an anonymous module so, through path mapping, it can be // referenced as the "underscore" module. define(function() { return _; }); } - // Check for `exports` after `define` in case a build optimizer adds an `exports` object. + // Check for `exports` after `define` in case a build optimizer adds it. else if (freeModule) { // Export for Node.js. (freeModule.exports = _)._ = _; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 018b6a766..0d129d44a 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,124 +4,127 @@ */ ;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t?t.length:0;++u=t?t:r),n!==T&&(t=t>=n?t:n)),t}function rn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==T)return c;if(!Ze(t))return t;if(o=yi(t)){if(c=Kr(t),!n)return lr(t,c)}else{var a=qr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(bi(t))return or(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=Gr(l?{}:t), -!n)return hr(t,Xt(c,t))}else{if(!Ct[a])return i?t:{};c=Jr(t,a,rn,n)}}if(f||(f=new qt),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?gn(t,iu,Tr):iu(t);return u(s||t,function(u,o){s&&(o=u,u=t[o]),Yt(c,o,rn(u,n,r,e,o,t,f))}),c}function en(t){var n=iu(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===T&&!(o in Object(e))||!i(f))return false}return true}}function un(t){return Ze(t)?Tu(t):{}}function on(t,n,r){if(typeof t!="function")throw new Au("Expected a function"); -return At(function(){t.apply(T,r)},n)}function fn(t,n,r,e){var u=-1,o=c,i=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,O(r))),e?(o=a,i=false):n.length>=200&&(o=E,i=false,n=new Zt(n));t:for(;++u0&&r(f)?n>1?sn(f,n-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function hn(t,n){return t&&ko(t,n,iu)}function pn(t,n){return t&&Eo(t,n,iu)}function _n(t,n){return f(n,function(n){return Fe(t[n])})}function vn(t,n){n=ne(n,t)?[n]:er(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[fe(n[r++])];return r&&r==e?t:T}function gn(t,n,r){ -return n=n(t),yi(t)?n:s(n,r(t))}function dn(t,n){return t>n}function yn(t,n){return null!=t&&(Wu.call(t,n)||typeof t=="object"&&n in t&&null===Ju(Object(t)))}function bn(t,n){return null!=t&&n in Object(t)}function xn(t,n,r){for(var e=r?a:c,u=t[0].length,o=t.length,i=o,f=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=l(p,O(n))),s=to(p.length,s),f[i]=!r&&(n||u>=120&&p.length>=120)?new Zt(i&&p):T}var p=t[0],_=-1,v=f[0];t:for(;++_h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!E(v,d):!e(h,d,r)){ -for(i=o;--i;){var y=f[i];if(y?!E(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function jn(t,n,r){var e={};return hn(t,function(t,u,o){n(e,r(t),u,o)}),e}function wn(t,n,e){return ne(n,t)||(n=er(n),t=ie(t,n),n=ve(n)),n=null==t?t:t[fe(n)],null==n?T:r(n,t,e)}function mn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Ze(t)&&!Te(n))n=t!==t&&n!==n;else t:{var o=yi(t),i=yi(n),f="[object Array]",c="[object Array]";o||(f=qr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=qr(n), -c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!C(t),i="[object Object]"==c&&!C(n);if((c=f==c)&&!a)u||(u=new qt),n=o||Ye(t)?zr(t,n,mn,r,e,u):Ur(t,n,f,mn,r,e,u);else{if(!(2&e)&&(o=a&&Wu.call(t,"__wrapped__"),f=i&&Wu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new qt),n=mn(t,n,r,e,u);break t}if(c)n:if(u||(u=new qt),o=2&e,f=iu(t),i=f.length,c=iu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:yn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{ -c=true,u.set(t,n);for(var s=o;++at}function In(t,n){var r=-1,e=Ue(t)?Array(t.length):[]; -return Ao(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function Rn(t){var n=Pr(t);return 1==n.length&&n[0][2]?ue(n[0][0],n[0][1]):function(r){return r===t||An(r,t,n)}}function Wn(t,n){return ne(t)&&n===n&&!Ze(n)?ue(fe(t),n):function(r){var e=uu(r,t);return e===T&&e===n?ou(r,t):mn(n,e,T,3)}}function Bn(t,n,r,e,o){if(t!==n){if(!yi(n)&&!Ye(n))var i=fu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),Ze(u)){o||(o=new qt);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Jt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):T,p=h===T;p&&(h=s, -yi(s)||Ye(s)?yi(l)?h=l:$e(l)?h=lr(l):(p=false,h=rn(s,true)):Ve(s)||ze(s)?ze(l)?h=ru(l):!Ze(l)||r&&Fe(l)?(p=false,h=rn(s,true)):h=l:p=false),a.set(s,h),p&&Bn(h,s,r,e,a),a["delete"](s),Jt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):T,c===T&&(c=u),Jt(t,f,c)})}}function Ln(t,n){var r=t.length;return r?(n+=0>n?r:0,Xr(n,r)?t[n]:T):void 0}function Mn(t,n,r){var e=-1;return n=l(n.length?n:[pu],O(Fr())),t=In(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t}}),j(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function Cn(t,n){return t=Object(t),h(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function zn(t,n){for(var r=-1,e=gn(t,fu,Bo),u=e.length,o={};++rn||n>9007199254740991)return r;do n%2&&(r+=t),(n=Gu(n/2))&&(t+=t);while(n);return r}function Zn(t,n,r,e){n=ne(n,t)?[n]:er(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++un&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e=u){for(;u>e;){var o=e+u>>>1,i=t[o];null!==i&&!Je(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u} -return Kn(t,n,pu,r)}function Kn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Je(n),a=n===T;o>u;){var l=Gu((u+o)/2),s=r(t[l]),h=s!==T,p=null===s,_=s===s,v=Je(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?n>=s:n>s)?u=l+1:o=l}return to(o,4294967294)}function Gn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r=200){if(u=n?null:Io(t))return D(u);i=false,u=E,l=new Zt}else l=n?[]:f;t:for(;++ee?n[e]:T);return i}function rr(t){return $e(t)?t:[]}function er(t){return yi(t)?t:Co(t)}function ur(t,n,r){var e=t.length;return r=r===T?e:r,!n&&r>=e?t:Tn(t,n,r)}function or(t,n){ -if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ir(t){var n=new t.constructor(t.byteLength);return new Fu(n).set(new Fu(t)),n}function fr(t,n){if(t!==n){var r=t!==T,e=null===t,u=t===t,o=Je(t),i=n!==T,f=null===n,c=n===n,a=Je(n);if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&n>t||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function cr(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Xu(o-i,0),l=Array(c+a);for(e=!e;++fu)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function ar(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Xu(o-f,0),s=Array(l+a);for(e=!e;++uu)&&(s[l+r[i]]=t[u++]);return s}function lr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r1?r[u-1]:T,i=u>2?r[2]:T,o=t.length>3&&typeof o=="function"?(u--,o):T;for(i&&te(r[0],r[1],i)&&(o=3>u?T:o,u=1),n=Object(n);++ei&&f[0]!==a&&f[i-1]!==a?[]:$(f,a), -i-=c.length,e>i?Br(t,n,Ar,u.placeholder,T,f,c,T,T,e-i):r(this&&this!==Kt&&this instanceof u?o:t,this,f)}var o=xr(t);return u}function wr(t){return function(n,r,e){var u=Object(n);if(r=Fr(r,3),!Ue(n))var o=iu(n);return e=t(o||n,function(t,n){return o&&(n=t,t=u[n]),r(t,n,u)},e),e>-1?n[o?o[e]:e]:T}}function mr(t){return Me(function(n){n=sn(n,1);var r=n.length,e=r,u=zt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new Au("Expected a function");if(u&&!i&&"wrapper"==$r(o))var i=new zt([],true); -}for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,t=r?n[u].apply(this,t):e;++ud)return j=$(y,j),Br(t,n,Ar,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[t]:t,d=y.length,f){x=y.length;for(var w=to(f.length,x),m=lr(y);w--;){var A=f[w];y[w]=Xr(A,x)?m[A]:T}}else v&&d>1&&y.reverse();return s&&d>c&&(y.length=c),this&&this!==Kt&&this instanceof l&&(b=g||xr(b)),b.apply(j,y)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?T:xr(t);return l}function Or(t,n){return function(r,e){return jn(r,t,n(e))}}function kr(t){return function(n,r){var e; -if(n===T&&r===T)return 0;if(n!==T&&(e=n),r!==T){if(e===T)return r;typeof n=="string"||typeof r=="string"?(n=Yn(n),r=Yn(r)):(n=Jn(n),r=Jn(r)),e=t(n,r)}return e}}function Er(t){return Me(function(n){return n=1==n.length&&yi(n[0])?l(n[0],O(Fr())):l(sn(n,1,Qr),O(Fr())),Me(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Sr(t,n){n=n===T?" ":Yn(n);var r=n.length;return 2>r?r?Pn(n,t):n:(r=Pn(n,Ku(t/N(n))),Wt.test(n)?ur(r.match(It),0,t).join(""):r.slice(0,t))}function Ir(t,n,e,u){ -function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Kt&&this instanceof o?f:t;++an?1:-1:nu(e)||0;var u=-1;r=Xu(Ku((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Wr(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=nu(n), -r=nu(r)),t(n,r)}}function Br(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:T;i=l?T:i;var h=l?o:T;return o=l?T:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(T,n),re(t)&&Mo(r,n),r.placeholder=e,r}function Lr(t){var n=wu[t];return function(t,r){if(t=nu(t),r=to(Xe(r),292)){var e=(eu(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(eu(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Mr(t){return function(n){var r=qr(n);return"[object Map]"==r?U(n):"[object Set]"==r?F(n):A(n,t(n)); -}}function Cr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new Au("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=T),i=i===T?i:Xu(Xe(i),0),f=f===T?f:Xe(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=T}var h=c?T:Ro(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?cr(e,r,h[4]):r,o[4]=e?$(o[3],"__lodash_placeholder__"):h[4]), -(r=h[5])&&(e=o[5],o[5]=e?ar(e,r,h[6]):r,o[6]=e?$(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:to(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Xu(o[9]-a,0),!f&&24&n&&(n&=-25),(h?So:Mo)(n&&1!=n?8==n||16==n?jr(t,n,f):32!=n&&33!=n||u.length?Ar.apply(T,o):Ir(t,n,r,e):dr(t,n,r),o)}function zr(t,n,r,e,u,o){var i=2&u,f=t.length,c=n.length;if(f!=c&&!(i&&c>f))return false;if(c=o.get(t))return c==n; -var c=-1,a=true,l=1&u?new Zt:T;for(o.set(t,n);++c-1&&0==t%1&&n>t}function te(t,n,r){if(!Ze(r))return false;var e=typeof n;return("number"==e?Ue(r)&&Xr(n,r.length):"string"==e&&n in r)?Ce(r[n],t):false}function ne(t,n){if(yi(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Je(t)?true:ut.test(t)||!et.test(t)||null!=n&&t in Object(n)}function re(t){ -var n=$r(t),r=Ot[n];return typeof r=="function"&&n in Ut.prototype?t===r?true:(n=Ro(r),!!n&&t===n[0]):false}function ee(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||ku)}function ue(t,n){return function(r){return null==r?false:r[t]===n&&(n!==T||t in Object(r))}}function oe(t,n,r,e,u,o){return Ze(t)&&Ze(n)&&Bn(t,n,T,oe,o.set(n,t)),t}function ie(t,n){return 1==n.length?t:vn(t,Tn(n,0,-1))}function fe(t){if(typeof t=="string"||Je(t))return t;var n=t+"";return"0"==n&&1/t==-q?"-0":n}function ce(t){ -if(null!=t){try{return Ru.call(t)}catch(n){}return t+""}return""}function ae(t){if(t instanceof Ut)return t.clone();var n=new zt(t.__wrapped__,t.__chain__);return n.__actions__=lr(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function le(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),Tn(t,0>n?0:n,e)):[]}function se(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),n=e-n,Tn(t,0,0>n?0:n)):[]}function he(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:Xe(r),0>r&&(r=Xu(e+r,0)), -g(t,Fr(n,3),r)):-1}function pe(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==T&&(u=Xe(r),u=0>r?Xu(e+u,0):to(u,e-1)),g(t,Fr(n,3),u,true)}function _e(t){return t&&t.length?t[0]:T}function ve(t){var n=t?t.length:0;return n?t[n-1]:T}function ge(t,n){return t&&t.length&&n&&n.length?Dn(t,n):t}function de(t){return t?uo.call(t):t}function ye(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){return $e(t)?(n=Xu(t.length,n),true):void 0}),m(n,function(n){return l(t,Un(n))})}function be(t,n){ -if(!t||!t.length)return[];var e=ye(t);return null==n?e:l(e,function(t){return r(n,T,t)})}function xe(t){return t=Ot(t),t.__chain__=true,t}function je(t,n){return n(t)}function we(){return this}function me(t,n){return(yi(t)?u:Ao)(t,Fr(n,3))}function Ae(t,n){return(yi(t)?o:Oo)(t,Fr(n,3))}function Oe(t,n){return(yi(t)?l:In)(t,Fr(n,3))}function ke(t,n,r){var e=-1,u=He(t),o=u.length,i=o-1;for(n=(r?te(t,n,r):n===T)?1:nn(Xe(n),0,o);++e=t&&(n=T),r}}function Re(t,n,r){return n=r?T:n,t=Cr(t,8,T,T,T,T,T,n),t.placeholder=Re.placeholder,t}function We(t,n,r){return n=r?T:n,t=Cr(t,16,T,T,T,T,T,n),t.placeholder=We.placeholder,t}function Be(t,n,r){function e(n){var r=c,e=a;return c=a=T,_=n,s=t.apply(e,r); -}function u(t){var r=t-p;return t-=_,p===T||r>=n||0>r||g&&t>=l}function o(){var t=Ee();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?to(t,l-r):t,h=At(o,r)}function i(t){return h=T,d&&c?e(t):(c=a=T,s)}function f(){var t=Ee(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===T)return _=t=p,h=At(o,n),v?e(t):s;if(g)return h=At(o,n),e(p)}return h===T&&(h=At(o,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Au("Expected a function");return n=nu(n)||0,Ze(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Xu(nu(r.maxWait)||0,n):l, -d="trailing"in r?!!r.trailing:d),f.cancel=function(){_=0,c=p=a=h=T},f.flush=function(){return h===T?s:i(Ee())},f}function Le(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new Au("Expected a function");return r.cache=new(Le.Cache||Pt),r}function Me(t,n){if(typeof t!="function")throw new Au("Expected a function");return n=Xu(n===T?t.length-1:Xe(n),0),function(){ -for(var e=arguments,u=-1,o=Xu(e.length-n,0),i=Array(o);++u-1&&0==t%1&&9007199254740991>=t}function Ze(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function Te(t){return!!t&&typeof t=="object"}function qe(t){return typeof t=="number"||Te(t)&&"[object Number]"==Mu.call(t); -}function Ve(t){return!Te(t)||"[object Object]"!=Mu.call(t)||C(t)?false:(t=Ju(Object(t)),null===t?true:(t=Wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&Ru.call(t)==Lu))}function Ke(t){return Ze(t)&&"[object RegExp]"==Mu.call(t)}function Ge(t){return typeof t=="string"||!yi(t)&&Te(t)&&"[object String]"==Mu.call(t)}function Je(t){return typeof t=="symbol"||Te(t)&&"[object Symbol]"==Mu.call(t)}function Ye(t){return Te(t)&&Pe(t.length)&&!!Mt[Mu.call(t)]}function He(t){if(!t)return[]; -if(Ue(t))return Ge(t)?t.match(It):lr(t);if(Zu&&t[Zu])return z(t[Zu]());var n=qr(t);return("[object Map]"==n?U:"[object Set]"==n?D:cu)(t)}function Qe(t){return t?(t=nu(t),t===q||t===-q?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function Xe(t){t=Qe(t);var n=t%1;return t===t?n?t-n:t:0}function tu(t){return t?nn(Xe(t),0,4294967295):0}function nu(t){if(typeof t=="number")return t;if(Je(t))return V;if(Ze(t)&&(t=Fe(t.valueOf)?t.valueOf():t,t=Ze(t)?t+"":t),typeof t!="string")return 0===t?t:+t; -t=t.replace(ct,"");var n=dt.test(t);return n||bt.test(t)?Nt(t.slice(2),n?2:8):gt.test(t)?V:+t}function ru(t){return sr(t,fu(t))}function eu(t){return null==t?"":Yn(t)}function uu(t,n,r){return t=null==t?T:vn(t,n),t===T?r:t}function ou(t,n){return null!=t&&Vr(t,n,bn)}function iu(t){var n=ee(t);if(!n&&!Ue(t))return Qu(Object(t));var r,e=Yr(t),u=!!e,e=e||[],o=e.length;for(r in t)!yn(t,r)||u&&("length"==r||Xr(r,o))||n&&"constructor"==r||e.push(r);return e}function fu(t){for(var n=-1,r=ee(t),e=En(t),u=e.length,o=Yr(t),i=!!o,o=o||[],f=o.length;++nt?false:(t==n.length-1?n.pop():Vu.call(n,t,1),true)},Dt.prototype.get=function(t){ -var n=this.__data__;return t=Ht(n,t),0>t?T:n[t][1]},Dt.prototype.has=function(t){return-1e?r.push([t,n]):r[e][1]=n,this},Pt.prototype.clear=function(){this.__data__={hash:new $t,map:new(fo||Dt),string:new $t}},Pt.prototype["delete"]=function(t){return Nr(this,t)["delete"](t)},Pt.prototype.get=function(t){return Nr(this,t).get(t)},Pt.prototype.has=function(t){return Nr(this,t).has(t)},Pt.prototype.set=function(t,n){ -return Nr(this,t).set(t,n),this},Zt.prototype.add=Zt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Zt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.clear=function(){this.__data__=new Dt},qt.prototype["delete"]=function(t){return this.__data__["delete"](t)},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,n){var r=this.__data__;return r instanceof Dt&&200==r.__data__.length&&(r=this.__data__=new Pt(r.__data__)), -r.set(t,n),this};var Ao=vr(hn),Oo=vr(pn,true),ko=gr(),Eo=gr(true);Nu&&!qu.call({valueOf:1},"valueOf")&&(En=function(t){return z(Nu(t))});var So=ho?function(t,n){return ho.set(t,n),t}:pu,Io=ao&&1/D(new ao([,-0]))[1]==q?function(t){return new ao(t)}:gu,Ro=ho?function(t){return ho.get(t)}:gu,Wo=Un("length");Pu||(Tr=yu);var Bo=Pu?function(t){for(var n=[];t;)s(n,Tr(t)),t=Ju(Object(t));return n}:Tr;(io&&"[object DataView]"!=qr(new io(new ArrayBuffer(1)))||fo&&"[object Map]"!=qr(new fo)||co&&"[object Promise]"!=qr(co.resolve())||ao&&"[object Set]"!=qr(new ao)||lo&&"[object WeakMap]"!=qr(new lo))&&(qr=function(t){ -var n=Mu.call(t);if(t=(t="[object Object]"==n?t.constructor:T)?ce(t):T)switch(t){case vo:return"[object DataView]";case go:return"[object Map]";case yo:return"[object Promise]";case bo:return"[object Set]";case xo:return"[object WeakMap]"}return n});var Lo=Su?Fe:bu,Mo=function(){var t=0,n=0;return function(r,e){var u=Ee(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return So(r,e)}}(),Co=Le(function(t){var n=[];return eu(t).replace(ot,function(t,r,e,u){n.push(e?u.replace(ht,"$1"):r||t)}), -n}),zo=Me(function(t,n){return $e(t)?fn(t,sn(n,1,$e,true)):[]}),Uo=Me(function(t,n){var r=ve(n);return $e(r)&&(r=T),$e(t)?fn(t,sn(n,1,$e,true),Fr(r)):[]}),$o=Me(function(t,n){var r=ve(n);return $e(r)&&(r=T),$e(t)?fn(t,sn(n,1,$e,true),T,r):[]}),Do=Me(function(t){var n=l(t,rr);return n.length&&n[0]===t[0]?xn(n):[]}),Fo=Me(function(t){var n=ve(t),r=l(t,rr);return n===ve(r)?n=T:r.pop(),r.length&&r[0]===t[0]?xn(r,Fr(n)):[]}),No=Me(function(t){var n=ve(t),r=l(t,rr);return n===ve(r)?n=T:r.pop(),r.length&&r[0]===t[0]?xn(r,T,n):[]; -}),Po=Me(ge),Zo=Me(function(t,n){n=sn(n,1);var r=t?t.length:0,e=tn(t,n);return Fn(t,l(n,function(t){return Xr(t,r)?+t:t}).sort(fr)),e}),To=Me(function(t){return Hn(sn(t,1,$e,true))}),qo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),Hn(sn(t,1,$e,true),Fr(n))}),Vo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),Hn(sn(t,1,$e,true),T,n)}),Ko=Me(function(t,n){return $e(t)?fn(t,n):[]}),Go=Me(function(t){return tr(f(t,$e))}),Jo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),tr(f(t,$e),Fr(n))}),Yo=Me(function(t){ -var n=ve(t);return $e(n)&&(n=T),tr(f(t,$e),T,n)}),Ho=Me(ye),Qo=Me(function(t){var n=t.length,n=n>1?t[n-1]:T,n=typeof n=="function"?(t.pop(),n):T;return be(t,n)}),Xo=Me(function(t){function n(n){return tn(n,t)}t=sn(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof Ut&&Xr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:je,args:[n],thisArg:T}),new zt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(T),t})):this.thru(n)}),ti=pr(function(t,n,r){ -Wu.call(t,r)?++t[r]:t[r]=1}),ni=wr(he),ri=wr(pe),ei=pr(function(t,n,r){Wu.call(t,r)?t[r].push(n):t[r]=[n]}),ui=Me(function(t,n,e){var u=-1,o=typeof n=="function",i=ne(n),f=Ue(t)?Array(t.length):[];return Ao(t,function(t){var c=o?n:i&&null!=t?t[n]:T;f[++u]=c?r(c,t,e):wn(t,n,e)}),f}),oi=pr(function(t,n,r){t[r]=n}),ii=pr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),fi=Me(function(t,n){if(null==t)return[];var r=n.length;return r>1&&te(t,n[0],n[1])?n=[]:r>2&&te(n[0],n[1],n[2])&&(n=[n[0]]), -n=1==n.length&&yi(n[0])?n[0]:sn(n,1,Qr),Mn(t,n,[])}),ci=Me(function(t,n,r){var e=1;if(r.length)var u=$(r,Dr(ci)),e=32|e;return Cr(t,e,n,r,u)}),ai=Me(function(t,n,r){var e=3;if(r.length)var u=$(r,Dr(ai)),e=32|e;return Cr(n,e,t,r,u)}),li=Me(function(t,n){return on(t,1,n)}),si=Me(function(t,n,r){return on(t,nu(n)||0,r)});Le.Cache=Pt;var hi=Me(function(t,n){n=1==n.length&&yi(n[0])?l(n[0],O(Fr())):l(sn(n,1,Qr),O(Fr()));var e=n.length;return Me(function(u){for(var o=-1,i=to(u.length,e);++o=n}),yi=Array.isArray,bi=Uu?function(t){return t instanceof Uu}:bu,xi=Wr(Sn),ji=Wr(function(t,n){return n>=t}),wi=_r(function(t,n){if(po||ee(n)||Ue(n))sr(n,iu(n),t);else for(var r in n)Wu.call(n,r)&&Yt(t,r,n[r])}),mi=_r(function(t,n){if(po||ee(n)||Ue(n))sr(n,fu(n),t);else for(var r in n)Yt(t,r,n[r]); -}),Ai=_r(function(t,n,r,e){sr(n,fu(n),t,e)}),Oi=_r(function(t,n,r,e){sr(n,iu(n),t,e)}),ki=Me(function(t,n){return tn(t,sn(n,1))}),Ei=Me(function(t){return t.push(T,Vt),r(Ai,T,t)}),Si=Me(function(t){return t.push(T,oe),r(Li,T,t)}),Ii=Or(function(t,n,r){t[n]=r},hu(pu)),Ri=Or(function(t,n,r){Wu.call(t,n)?t[n].push(r):t[n]=[r]},Fr),Wi=Me(wn),Bi=_r(function(t,n,r){Bn(t,n,r)}),Li=_r(function(t,n,r,e){Bn(t,n,r,e)}),Mi=Me(function(t,n){return null==t?{}:(n=l(sn(n,1),fe),Cn(t,fn(gn(t,fu,Bo),n)))}),Ci=Me(function(t,n){ -return null==t?{}:Cn(t,l(sn(n,1),fe))}),zi=Mr(iu),Ui=Mr(fu),$i=br(function(t,n,r){return n=n.toLowerCase(),t+(r?au(n):n)}),Di=br(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),Fi=br(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Ni=yr("toLowerCase"),Pi=br(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Zi=br(function(t,n,r){return t+(r?" ":"")+qi(n)}),Ti=br(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),qi=yr("toUpperCase"),Vi=Me(function(t,n){try{return r(t,T,n)}catch(e){ -return De(e)?e:new ju(e)}}),Ki=Me(function(t,n){return u(sn(n,1),function(n){n=fe(n),t[n]=ci(t[n],t)}),t}),Gi=mr(),Ji=mr(true),Yi=Me(function(t,n){return function(r){return wn(r,t,n)}}),Hi=Me(function(t,n){return function(r){return wn(t,r,n)}}),Qi=Er(l),Xi=Er(i),tf=Er(_),nf=Rr(),rf=Rr(true),ef=kr(function(t,n){return t+n}),uf=Lr("ceil"),of=kr(function(t,n){return t/n}),ff=Lr("floor"),cf=kr(function(t,n){return t*n}),af=Lr("round"),lf=kr(function(t,n){return t-n});return Ot.after=function(t,n){if(typeof n!="function")throw new Au("Expected a function"); -return t=Xe(t),function(){return 1>--t?n.apply(this,arguments):void 0}},Ot.ary=Se,Ot.assign=wi,Ot.assignIn=mi,Ot.assignInWith=Ai,Ot.assignWith=Oi,Ot.at=ki,Ot.before=Ie,Ot.bind=ci,Ot.bindAll=Ki,Ot.bindKey=ai,Ot.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return yi(t)?t:[t]},Ot.chain=xe,Ot.chunk=function(t,n,r){if(n=(r?te(t,n,r):n===T)?1:Xu(Xe(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Ku(r/n));r>e;)o[u++]=Tn(t,e,e+=n);return o},Ot.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++nr&&(r=-r>u?0:u+r),e=e===T||e>u?u:Xe(e),0>e&&(e+=u),e=r>e?0:tu(e);e>r;)t[r++]=n;return t},Ot.filter=function(t,n){return(yi(t)?f:ln)(t,Fr(n,3))},Ot.flatMap=function(t,n){return sn(Oe(t,n),1)},Ot.flatMapDeep=function(t,n){return sn(Oe(t,n),q)},Ot.flatMapDepth=function(t,n,r){return r=r===T?1:Xe(r),sn(Oe(t,n),r)},Ot.flatten=function(t){return t&&t.length?sn(t,1):[]},Ot.flattenDeep=function(t){return t&&t.length?sn(t,q):[]},Ot.flattenDepth=function(t,n){return t&&t.length?(n=n===T?1:Xe(n),sn(t,n)):[]; -},Ot.flip=function(t){return Cr(t,512)},Ot.flow=Gi,Ot.flowRight=Ji,Ot.fromPairs=function(t){for(var n=-1,r=t?t.length:0,e={};++n>>0,r?(t=eu(t))&&(typeof n=="string"||null!=n&&!Ke(n))&&(n=Yn(n),""==n&&Wt.test(t))?ur(t.match(It),0,r):oo.call(t,n,r):[]},Ot.spread=function(t,n){if(typeof t!="function")throw new Au("Expected a function");return n=n===T?0:Xu(Xe(n),0),Me(function(e){var u=e[n];return e=ur(e,0,n),u&&s(e,u),r(t,this,e)})},Ot.tail=function(t){return le(t,1)},Ot.take=function(t,n,r){return t&&t.length?(n=r||n===T?1:Xe(n), -Tn(t,0,0>n?0:n)):[]},Ot.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),n=e-n,Tn(t,0>n?0:n,e)):[]},Ot.takeRightWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),false,true):[]},Ot.takeWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3)):[]},Ot.tap=function(t,n){return n(t),t},Ot.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Au("Expected a function");return Ze(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Be(t,n,{leading:e,maxWait:n, -trailing:u})},Ot.thru=je,Ot.toArray=He,Ot.toPairs=zi,Ot.toPairsIn=Ui,Ot.toPath=function(t){return yi(t)?l(t,fe):Je(t)?[t]:lr(Co(t))},Ot.toPlainObject=ru,Ot.transform=function(t,n,r){var e=yi(t)||Ye(t);if(n=Fr(n,4),null==r)if(e||Ze(t)){var o=t.constructor;r=e?yi(t)?new o:[]:Fe(o)?un(Ju(Object(t))):{}}else r={};return(e?u:hn)(t,function(t,e,u){return n(r,t,e,u)}),r},Ot.unary=function(t){return Se(t,1)},Ot.union=To,Ot.unionBy=qo,Ot.unionWith=Vo,Ot.uniq=function(t){return t&&t.length?Hn(t):[]},Ot.uniqBy=function(t,n){ -return t&&t.length?Hn(t,Fr(n)):[]},Ot.uniqWith=function(t,n){return t&&t.length?Hn(t,T,n):[]},Ot.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=ne(e,r)?[e]:er(e);r=ie(r,e),e=fe(ve(e)),r=!(null!=r&&yn(r,e))||delete r[e]}return r},Ot.unzip=ye,Ot.unzipWith=be,Ot.update=function(t,n,r){return null==t?t:Zn(t,n,(typeof r=="function"?r:pu)(vn(t,n)),void 0)},Ot.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null!=t&&(t=Zn(t,n,(typeof r=="function"?r:pu)(vn(t,n)),e)),t},Ot.values=cu, -Ot.valuesIn=function(t){return null==t?[]:k(t,fu(t))},Ot.without=Ko,Ot.words=su,Ot.wrap=function(t,n){return n=null==n?pu:n,pi(n,t)},Ot.xor=Go,Ot.xorBy=Jo,Ot.xorWith=Yo,Ot.zip=Ho,Ot.zipObject=function(t,n){return nr(t||[],n||[],Yt)},Ot.zipObjectDeep=function(t,n){return nr(t||[],n||[],Zn)},Ot.zipWith=Qo,Ot.entries=zi,Ot.entriesIn=Ui,Ot.extend=mi,Ot.extendWith=Ai,vu(Ot,Ot),Ot.add=ef,Ot.attempt=Vi,Ot.camelCase=$i,Ot.capitalize=au,Ot.ceil=uf,Ot.clamp=function(t,n,r){return r===T&&(r=n,n=T),r!==T&&(r=nu(r), -r=r===r?r:0),n!==T&&(n=nu(n),n=n===n?n:0),nn(nu(t),n,r)},Ot.clone=function(t){return rn(t,false,true)},Ot.cloneDeep=function(t){return rn(t,true,true)},Ot.cloneDeepWith=function(t,n){return rn(t,true,true,n)},Ot.cloneWith=function(t,n){return rn(t,false,true,n)},Ot.deburr=lu,Ot.divide=of,Ot.endsWith=function(t,n,r){t=eu(t),n=Yn(n);var e=t.length;return r=r===T?e:nn(Xe(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},Ot.eq=Ce,Ot.escape=function(t){return(t=eu(t))&&X.test(t)?t.replace(H,B):t},Ot.escapeRegExp=function(t){ -return(t=eu(t))&&ft.test(t)?t.replace(it,"\\$&"):t},Ot.every=function(t,n,r){var e=yi(t)?i:cn;return r&&te(t,n,r)&&(n=T),e(t,Fr(n,3))},Ot.find=ni,Ot.findIndex=he,Ot.findKey=function(t,n){return v(t,Fr(n,3),hn)},Ot.findLast=ri,Ot.findLastIndex=pe,Ot.findLastKey=function(t,n){return v(t,Fr(n,3),pn)},Ot.floor=ff,Ot.forEach=me,Ot.forEachRight=Ae,Ot.forIn=function(t,n){return null==t?t:ko(t,Fr(n,3),fu)},Ot.forInRight=function(t,n){return null==t?t:Eo(t,Fr(n,3),fu)},Ot.forOwn=function(t,n){return t&&hn(t,Fr(n,3)); -},Ot.forOwnRight=function(t,n){return t&&pn(t,Fr(n,3))},Ot.get=uu,Ot.gt=gi,Ot.gte=di,Ot.has=function(t,n){return null!=t&&Vr(t,n,yn)},Ot.hasIn=ou,Ot.head=_e,Ot.identity=pu,Ot.includes=function(t,n,r,e){return t=Ue(t)?t:cu(t),r=r&&!e?Xe(r):0,e=t.length,0>r&&(r=Xu(e+r,0)),Ge(t)?e>=r&&-1r&&(r=Xu(e+r,0)),d(t,n,r)):-1},Ot.inRange=function(t,n,r){return n=nu(n)||0,r===T?(r=n,n=0):r=nu(r)||0,t=nu(t), -t>=to(n,r)&&t=-9007199254740991&&9007199254740991>=t; -},Ot.isSet=function(t){return Te(t)&&"[object Set]"==qr(t)},Ot.isString=Ge,Ot.isSymbol=Je,Ot.isTypedArray=Ye,Ot.isUndefined=function(t){return t===T},Ot.isWeakMap=function(t){return Te(t)&&"[object WeakMap]"==qr(t)},Ot.isWeakSet=function(t){return Te(t)&&"[object WeakSet]"==Mu.call(t)},Ot.join=function(t,n){return t?Hu.call(t,n):""},Ot.kebabCase=Di,Ot.last=ve,Ot.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==T&&(u=Xe(r),u=(0>u?Xu(e+u,0):to(u,e-1))+1),n!==n)return M(t,u-1,true); -for(;u--;)if(t[u]===n)return u;return-1},Ot.lowerCase=Fi,Ot.lowerFirst=Ni,Ot.lt=xi,Ot.lte=ji,Ot.max=function(t){return t&&t.length?an(t,pu,dn):T},Ot.maxBy=function(t,n){return t&&t.length?an(t,Fr(n),dn):T},Ot.mean=function(t){return b(t,pu)},Ot.meanBy=function(t,n){return b(t,Fr(n))},Ot.min=function(t){return t&&t.length?an(t,pu,Sn):T},Ot.minBy=function(t,n){return t&&t.length?an(t,Fr(n),Sn):T},Ot.stubArray=yu,Ot.stubFalse=bu,Ot.stubObject=function(){return{}},Ot.stubString=function(){return""},Ot.stubTrue=function(){ -return true},Ot.multiply=cf,Ot.nth=function(t,n){return t&&t.length?Ln(t,Xe(n)):T},Ot.noConflict=function(){return Kt._===this&&(Kt._=Cu),this},Ot.noop=gu,Ot.now=Ee,Ot.pad=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return!n||e>=n?t:(n=(n-e)/2,Sr(Gu(n),r)+t+Sr(Ku(n),r))},Ot.padEnd=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return n&&n>e?t+Sr(n-e,r):t},Ot.padStart=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return n&&n>e?Sr(n-e,r)+t:t},Ot.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n), -t=eu(t).replace(ct,""),no(t,n||(vt.test(t)?16:10))},Ot.random=function(t,n,r){if(r&&typeof r!="boolean"&&te(t,n,r)&&(n=r=T),r===T&&(typeof n=="boolean"?(r=n,n=T):typeof t=="boolean"&&(r=t,t=T)),t===T&&n===T?(t=0,n=1):(t=nu(t)||0,n===T?(n=t,t=0):n=nu(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=ro(),to(t+r*(n-t+Ft("1e-"+((r+"").length-1))),n)):Nn(t,n)},Ot.reduce=function(t,n,r){var e=yi(t)?h:x,u=3>arguments.length;return e(t,Fr(n,4),r,u,Ao)},Ot.reduceRight=function(t,n,r){var e=yi(t)?p:x,u=3>arguments.length; -return e(t,Fr(n,4),r,u,Oo)},Ot.repeat=function(t,n,r){return n=(r?te(t,n,r):n===T)?1:Xe(n),Pn(eu(t),n)},Ot.replace=function(){var t=arguments,n=eu(t[0]);return 3>t.length?n:eo.call(n,t[1],t[2])},Ot.result=function(t,n,r){n=ne(n,t)?[n]:er(n);var e=-1,u=n.length;for(u||(t=T,u=1);++e0?t[Nn(0,n-1)]:T},Ot.size=function(t){if(null==t)return 0; -if(Ue(t)){var n=t.length;return n&&Ge(t)?N(t):n}return Te(t)&&(n=qr(t),"[object Map]"==n||"[object Set]"==n)?t.size:iu(t).length},Ot.snakeCase=Pi,Ot.some=function(t,n,r){var e=yi(t)?_:qn;return r&&te(t,n,r)&&(n=T),e(t,Fr(n,3))},Ot.sortedIndex=function(t,n){return Vn(t,n)},Ot.sortedIndexBy=function(t,n,r){return Kn(t,n,Fr(r))},Ot.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Vn(t,n);if(r>e&&Ce(t[e],n))return e}return-1},Ot.sortedLastIndex=function(t,n){return Vn(t,n,true)},Ot.sortedLastIndexBy=function(t,n,r){ -return Kn(t,n,Fr(r),true)},Ot.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Vn(t,n,true)-1;if(Ce(t[r],n))return r}return-1},Ot.startCase=Zi,Ot.startsWith=function(t,n,r){return t=eu(t),r=nn(Xe(r),0,t.length),t.lastIndexOf(Yn(n),r)==r},Ot.subtract=lf,Ot.sum=function(t){return t&&t.length?w(t,pu):0},Ot.sumBy=function(t,n){return t&&t.length?w(t,Fr(n)):0},Ot.template=function(t,n,r){var e=Ot.templateSettings;r&&te(t,n,r)&&(n=T),t=eu(t),n=Ai({},n,e,Vt),r=Ai({},n.imports,e.imports,Vt);var u,o,i=iu(r),f=k(r,i),c=0; -r=n.interpolate||wt;var a="__p+='";r=mu((n.escape||wt).source+"|"+r.source+"|"+(r===rt?pt:wt).source+"|"+(n.evaluate||wt).source+"|$","g");var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){return e||(e=i),a+=t.slice(c,l).replace(mt,L),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(K,""):a).replace(G,"$1").replace(J,"$1;"), -a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",n=Vi(function(){return Function(i,l+"return "+a).apply(T,f)}),n.source=a,De(n))throw n;return n},Ot.times=function(t,n){if(t=Xe(t),1>t||t>9007199254740991)return[];var r=4294967295,e=to(t,4294967295);for(n=Fr(n),t-=4294967295,e=m(e,n);++r=o)return t;if(o=r-N(e),1>o)return e;if(r=i?ur(i,0,o).join(""):t.slice(0,o),u===T)return r+e;if(i&&(o+=r.length-o),Ke(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=mu(u.source,eu(_t.exec(u))+"g")), -u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===T?o:c)}}else t.indexOf(Yn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},Ot.unescape=function(t){return(t=eu(t))&&Q.test(t)?t.replace(Y,P):t},Ot.uniqueId=function(t){var n=++Bu;return eu(t)+n},Ot.upperCase=Ti,Ot.upperFirst=qi,Ot.each=me,Ot.eachRight=Ae,Ot.first=_e,vu(Ot,function(){var t={};return hn(Ot,function(n,r){Wu.call(Ot.prototype,r)||(t[r]=n)}),t}(),{chain:false}),Ot.VERSION="4.13.1",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){ -Ot[t].placeholder=Ot}),u(["drop","take"],function(t,n){Ut.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Ut(this);r=r===T?1:Xu(Xe(r),0);var u=this.clone();return e?u.__takeCount__=to(r,u.__takeCount__):u.__views__.push({size:to(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Ut.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Ut.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({ -iteratee:Fr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Ut.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");Ut.prototype[t]=function(){return this.__filtered__?new Ut(this):this[r](1)}}),Ut.prototype.compact=function(){return this.filter(pu)},Ut.prototype.find=function(t){return this.filter(t).head()},Ut.prototype.findLast=function(t){return this.reverse().find(t); -},Ut.prototype.invokeMap=Me(function(t,n){return typeof t=="function"?new Ut(this):this.map(function(r){return wn(r,t,n)})}),Ut.prototype.reject=function(t){return t=Fr(t,3),this.filter(function(n){return!t(n)})},Ut.prototype.slice=function(t,n){t=Xe(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Ut(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==T&&(n=Xe(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Ut.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ut.prototype.toArray=function(){ -return this.take(4294967295)},hn(Ut.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Ot[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(Ot.prototype[n]=function(){function n(t){return t=u.apply(Ot,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Ut,a=f[0],l=c||yi(i);l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&l?(i=c?i:new Ut(this), -i=t.apply(i,f),i.__actions__.push({func:je,args:[n],thisArg:T}),new zt(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=Ou[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Ot.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(yi(u)?u:[],t)}return this[r](function(r){return n.apply(yi(r)?r:[],t)})}}),hn(Ut.prototype,function(t,n){ -var r=Ot[n];if(r){var e=r.name+"";(_o[e]||(_o[e]=[])).push({name:n,func:r})}}),_o[Ar(T,2).name]=[{name:"wrapper",func:T}],Ut.prototype.clone=function(){var t=new Ut(this.__wrapped__);return t.__actions__=lr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=lr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=lr(this.__views__),t},Ut.prototype.reverse=function(){if(this.__filtered__){var t=new Ut(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(), -t.__dir__*=-1;return t},Ut.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=yi(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==t&&a==t)return Xn(n,this.__actions__);e=[]; -t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o=this.__values__.length,n=t?T:this.__values__[this.__index__++];return{done:t,value:n}},Ot.prototype.plant=function(t){ -for(var n,r=this;r instanceof kt;){var e=ae(r);e.__index__=0,e.__values__=T,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Ot.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Ut?(this.__actions__.length&&(t=new Ut(this)),t=t.reverse(),t.__actions__.push({func:je,args:[de],thisArg:T}),new zt(t,this.__chain__)):this.thru(de)},Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=function(){return Xn(this.__wrapped__,this.__actions__)},Zu&&(Ot.prototype[Zu]=we), -Ot}var T,q=1/0,V=NaN,K=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,J=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/&(?:amp|lt|gt|quot|#39|#96);/g,H=/[&<>"'`]/g,Q=RegExp(Y.source),X=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,nt=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(it.source),ct=/^\s+|\s+$/g,at=/^\s+/,lt=/\s+$/,st=/[a-zA-Z0-9]+/g,ht=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,vt=/^0x/i,gt=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,jt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,wt=/($^)/,mt=/['\n\r\u2028\u2029\\]/g,At="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",Ot="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+At,kt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",Et=RegExp("['\u2019]","g"),St=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),It=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kt+At,"g"),Rt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",Ot].join("|"),"g"),Wt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lt="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ isFinite parseInt setTimeout".split(" "),Mt={}; -Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=true,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=false; -var Ct={};Ct["[object Arguments]"]=Ct["[object Array]"]=Ct["[object ArrayBuffer]"]=Ct["[object DataView]"]=Ct["[object Boolean]"]=Ct["[object Date]"]=Ct["[object Float32Array]"]=Ct["[object Float64Array]"]=Ct["[object Int8Array]"]=Ct["[object Int16Array]"]=Ct["[object Int32Array]"]=Ct["[object Map]"]=Ct["[object Number]"]=Ct["[object Object]"]=Ct["[object RegExp]"]=Ct["[object Set]"]=Ct["[object String]"]=Ct["[object Symbol]"]=Ct["[object Uint8Array]"]=Ct["[object Uint8ClampedArray]"]=Ct["[object Uint16Array]"]=Ct["[object Uint32Array]"]=true, -Ct["[object Error]"]=Ct["[object Function]"]=Ct["[object WeakMap]"]=false;var zt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O", -"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ut={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$t={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Dt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ft=parseFloat,Nt=parseInt,Pt=typeof exports=="object"&&exports,Zt=Pt&&typeof module=="object"&&module,Tt=Zt&&Zt.exports===Pt,qt=R(typeof self=="object"&&self),Vt=R(typeof this=="object"&&this),Kt=R(typeof global=="object"&&global)||qt||Vt||Function("return this")(),Gt=Z(); -(qt||{})._=Gt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Gt}):Zt?((Zt.exports=Gt)._=Gt,Pt._=Gt):Kt._=Gt}).call(this); \ No newline at end of file +var u=-1,o=t?t.length:0;for(e&&o&&(r=t[++u]);++u=n?t:n)),t}function gn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==P)return c;if(!fu(t))return t;if(o=Pi(t)){if(c=se(t),!n)return Ir(t,c)}else{var a=Et(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(qi(t))return Or(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=he(l?{}:t), +!n)return Br(t,pn(c,t))}else{if(!Dt[a])return i?t:{};c=pe(t,a,gn,n)}}if(f||(f=new fn),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?In(t,wu,ni):wu(t);return u(s||t,function(u,o){s&&(o=u,u=t[o]),ln(c,o,gn(u,n,r,e,o,t,f))}),r||f.delete(t),c}function dn(t){var n=wu(t);return function(r){return yn(r,t,n)}}function yn(t,n,r){var e=r.length;if(null==t)return!e;for(;e--;){var u=r[e],o=n[u],i=t[u];if(i===P&&!(u in Object(t))||!o(i))return false}return true}function bn(t){return fu(t)?fo(t):{}}function xn(t,n,r){ +if(typeof t!="function")throw new Nu("Expected a function");return St(function(){t.apply(P,r)},n)}function jn(t,n,r,e){var u=-1,o=c,i=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,S(r))),e?(o=a,i=false):200<=n.length&&(o=I,i=false,n=new Jt(n));t:for(;++un}function Bn(t,n){return null!=t&&(Ju.call(t,n)||typeof t=="object"&&n in t&&null===ti(t))}function Mn(t,n){return null!=t&&n in Object(t)}function Cn(t,n,r){for(var e=r?a:c,u=t[0].length,o=t.length,i=o,f=Uu(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=l(p,S(n))),s=jo(p.length,s),f[i]=!r&&(n||120<=u&&120<=p.length)?new Jt(i&&p):P}var p=t[0],_=-1,v=f[0];t:for(;++_n?r:0,ge(n,r)?t[n]:P}function tr(t,n,r){var e=-1;return n=l(n.length?n:[Iu],S(ie())),t=Jn(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t}}),A(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function nr(t,n){ +return t=Object(t),rr(t,n,function(n,r){return r in t})}function rr(t,n,r){for(var e=-1,u=n.length,o={};++en||9007199254740991n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Uu(u);++e=u){for(;e>>1,i=t[o];null!==i&&!hu(i)&&(r?i<=n:i=e?t:lr(t,n,r)}function Or(t,n){ +if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function kr(t){var n=new t.constructor(t.byteLength);return new uo(n).set(new uo(t)),n}function Er(t,n){if(t!==n){var r=t!==P,e=null===t,u=t===t,o=hu(t),i=n!==P,f=null===n,c=n===n,a=hu(n);if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&tu?P:o,u=1),n=Object(n);++ei&&f[0]!==a&&f[i-1]!==a?[]:D(f,a), +i-=c.length,ir?r?fr(n,t):n:(r=fr(n,so(t/T(n))),Ct.test(n)?Ar(r.match(Bt),0,t).join(""):r.slice(0,t))}function Jr(t,n,e,u){ +function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Uu(l+c),h=this&&this!==qt&&this instanceof o?f:t;++an||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?Sr(e,r,h[4]):r,o[4]=e?D(o[3],"__lodash_placeholder__"):h[4]), +(r=h[5])&&(e=o[5],o[5]=e?Rr(e,r,h[6]):r,o[6]=e?D(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:jo(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:xo(o[9]-a,0),!f&&24&n&&(n&=-25),oi((h?Yo:ui)(n&&1!=n?8==n||16==n?Tr(t,n,f):32!=n&&33!=n||u.length?Zr.apply(P,o):Jr(t,n,r,e):Ur(t,n,r),o),t,n)}function re(t,n,r,e,u,o){var i=2&u,f=t.length,c=n.length;if(f!=c&&!(i&&c>f))return false;if((c=o.get(t))&&o.get(n))return c==n; +var c=-1,a=true,l=1&u?new Jt:P;for(o.set(t,n),o.set(n,t);++cn?0:n,e)):[]}function Re(t,n,r){var e=t?t.length:0;return e?(n=r||n===P?1:vu(n),n=e-n,lr(t,0,0>n?0:n)):[]}function Ie(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:vu(r), +0>r&&(r=xo(e+r,0)),g(t,ie(n,3),r)):-1}function We(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==P&&(u=vu(r),u=0>r?xo(e+u,0):jo(u,e-1)),g(t,ie(n,3),u,true)}function Be(t){return t&&t.length?t[0]:P}function Me(t){var n=t?t.length:0;return n?t[n-1]:P}function Ce(t,n){return t&&t.length&&n&&n.length?ur(t,n):t}function Le(t){return t?Oo.call(t):t}function ze(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){if(ru(t))return n=xo(t.length,n),true}),k(n,function(n){return l(t,j(n)); +})}function Ue(t,n){if(!t||!t.length)return[];var e=ze(t);return null==n?e:l(e,function(t){return r(n,P,t)})}function De(t){return t=Rt(t),t.__chain__=true,t}function $e(t,n){return n(t)}function Fe(){return this}function Te(t,n){return(Pi(t)?u:qo)(t,ie(n,3))}function Ne(t,n){return(Pi(t)?o:Vo)(t,ie(n,3))}function Pe(t,n){return(Pi(t)?l:Jn)(t,ie(n,3))}function Ze(t,n,r){var e=-1,u=pu(t),o=u.length,i=o-1;for(n=(r?de(t,n,r):n===P)?1:vn(vu(n),0,o);++e=t&&(n=P),r}}function Ge(t,n,r){return n=r?P:n,t=ne(t,8,P,P,P,P,P,n),t.placeholder=Ge.placeholder,t}function Je(t,n,r){return n=r?P:n,t=ne(t,16,P,P,P,P,P,n),t.placeholder=Je.placeholder,t}function Ye(t,n,r){function e(n){var r=c,e=a;return c=a=P, +_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,p===P||r>=n||0>r||g&&t>=l}function o(){var t=qe();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?jo(t,l-r):t,h=St(o,r)}function i(t){return h=P,d&&c?e(t):(c=a=P,s)}function f(){var t=qe(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===P)return _=t=p,h=St(o,n),v?e(t):s;if(g)return h=St(o,n),e(p)}return h===P&&(h=St(o,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Nu("Expected a function");return n=du(n)||0,fu(r)&&(v=!!r.leading, +l=(g="maxWait"in r)?xo(du(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==P&&w.clearTimeout.call(qt,h),_=0,c=p=a=h=P},f.flush=function(){return h===P?s:i(qe())},f}function He(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new Nu("Expected a function");return r.cache=new(He.Cache||Kt),r}function Qe(t){if(typeof t!="function")throw new Nu("Expected a function"); +return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function Xe(t,n){return t===n||t!==t&&n!==n}function tu(t){return ru(t)&&Ju.call(t,"callee")&&(!co.call(t,"callee")||"[object Arguments]"==Qu.call(t))}function nu(t){return null!=t&&iu(Xo(t))&&!uu(t)}function ru(t){return cu(t)&&nu(t)}function eu(t){return!!cu(t)&&("[object Error]"==Qu.call(t)||typeof t.message=="string"&&typeof t.name=="string"); +}function uu(t){return t=fu(t)?Qu.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function ou(t){return typeof t=="number"&&t==vu(t)}function iu(t){return typeof t=="number"&&-1=t}function fu(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function cu(t){return!!t&&typeof t=="object"}function au(t){return typeof t=="number"||cu(t)&&"[object Number]"==Qu.call(t)}function lu(t){return!(!cu(t)||"[object Object]"!=Qu.call(t)||C(t))&&(t=ti(t),null===t||(t=Ju.call(t,"constructor")&&t.constructor, +typeof t=="function"&&t instanceof t&&Gu.call(t)==Hu))}function su(t){return typeof t=="string"||!Pi(t)&&cu(t)&&"[object String]"==Qu.call(t)}function hu(t){return typeof t=="symbol"||cu(t)&&"[object Symbol]"==Qu.call(t)}function pu(t){if(!t)return[];if(nu(t))return su(t)?t.match(Bt):Ir(t);if(io&&t[io])return L(t[io]());var n=Et(t);return("[object Map]"==n?z:"[object Set]"==n?$:Ou)(t)}function _u(t){return t?(t=du(t),t===Z||t===-Z?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function vu(t){ +t=_u(t);var n=t%1;return t===t?n?t-n:t:0}function gu(t){return t?vn(vu(t),0,4294967295):0}function du(t){if(typeof t=="number")return t;if(hu(t))return q;if(fu(t)&&(t=uu(t.valueOf)?t.valueOf():t,t=fu(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ct,"");var n=xt.test(t);return n||wt.test(t)?Nt(t.slice(2),n?2:8):bt.test(t)?q:+t}function yu(t){return Wr(t,mu(t))}function bu(t){return null==t?"":gr(t)}function xu(t,n,r){return t=null==t?P:Rn(t,n),t===P?r:t}function ju(t,n){return null!=t&&le(t,n,Mn); +}function wu(t){var n=xe(t);if(!n&&!nu(t))return Jo(t);var r,e=_e(t),u=!!e,e=e||[],o=e.length;for(r in t)!Bn(t,r)||u&&("length"==r||ge(r,o))||n&&"constructor"==r||e.push(r);return e}function mu(t){for(var n=-1,r=xe(t),e=Kn(t),u=e.length,o=_e(t),i=!!o,o=o||[],f=o.length;++nt)&&(t==n.length-1?n.pop():ao.call(n,t,1),true)},Vt.prototype.get=function(t){var n=this.__data__;return t=sn(n,t),0>t?P:n[t][1]},Vt.prototype.has=function(t){return-1e?r.push([t,n]):r[e][1]=n,this},Kt.prototype.clear=function(){this.__data__={hash:new Zt,map:new(So||Vt),string:new Zt}},Kt.prototype.delete=function(t){return fe(this,t).delete(t)},Kt.prototype.get=function(t){return fe(this,t).get(t); +},Kt.prototype.has=function(t){return fe(this,t).has(t)},Kt.prototype.set=function(t,n){return fe(this,t).set(t,n),this},Jt.prototype.add=Jt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Jt.prototype.has=function(t){return this.__data__.has(t)},fn.prototype.clear=function(){this.__data__=new Vt},fn.prototype.delete=function(t){return this.__data__.delete(t)},fn.prototype.get=function(t){return this.__data__.get(t)},fn.prototype.has=function(t){return this.__data__.has(t); +},fn.prototype.set=function(t,n){var r=this.__data__;if(r instanceof Vt){if(r=r.__data__,!So||199>r.length)return r.push([t,n]),this;r=this.__data__=new Kt(r)}return r.set(t,n),this};var qo=Lr(kn),Vo=Lr(En,true),Ko=zr(),Go=zr(true),Jo=U(bo);oo&&!co.call({valueOf:1},"valueOf")&&(Kn=function(t){return L(oo(t))});var Yo=Co?function(t,n){return Co.set(t,n),t}:Iu,Ho=Io&&1/$(new Io([,-0]))[1]==Z?function(t){return new Io(t)}:Mu,Qo=Co?function(t){return Co.get(t)}:Mu,Xo=j("length"),ti=U(po),ni=_o?U(_o):Lu,ri=_o?function(t){ +for(var n=[];t;)s(n,ni(t)),t=ti(t);return n}:ni;(Eo&&"[object DataView]"!=Et(new Eo(new ArrayBuffer(1)))||So&&"[object Map]"!=Et(new So)||Ro&&"[object Promise]"!=Et(Ro.resolve())||Io&&"[object Set]"!=Et(new Io)||Wo&&"[object WeakMap]"!=Et(new Wo))&&(Et=function(t){var n=Qu.call(t);if(t=(t="[object Object]"==n?t.constructor:P)?Oe(t):P)switch(t){case Uo:return"[object DataView]";case Do:return"[object Map]";case $o:return"[object Promise]";case Fo:return"[object Set]";case To:return"[object WeakMap]"; +}return n});var ei=Vu?uu:zu,ui=function(){var t=0,n=0;return function(r,e){var u=qe(),o=16-(u-n);if(n=u,0=n}),Pi=Uu.isArray,Zi=Yt?S(Yt):Un,qi=vo||zu,Vi=Ht?S(Ht):Dn,Ki=Qt?S(Qt):Fn,Gi=Xt?S(Xt):Pn,Ji=tn?S(tn):Zn,Yi=nn?S(nn):qn,Hi=Hr(Gn),Qi=Hr(function(t,n){return t<=n}),Xi=Cr(function(t,n){if(Lo||xe(n)||nu(n))Wr(n,wu(n),t);else for(var r in n)Ju.call(n,r)&&ln(t,r,n[r])}),tf=Cr(function(t,n){ +if(Lo||xe(n)||nu(n))Wr(n,mu(n),t);else for(var r in n)ln(t,r,n[r])}),nf=Cr(function(t,n,r,e){Wr(n,mu(n),t,e)}),rf=Cr(function(t,n,r,e){Wr(n,wu(n),t,e)}),ef=cr(function(t,n){return _n(t,On(n,1))}),uf=cr(function(t){return t.push(P,cn),r(nf,P,t)}),of=cr(function(t){return t.push(P,we),r(sf,P,t)}),ff=qr(function(t,n,r){t[n]=r},Ru(Iu)),cf=qr(function(t,n,r){Ju.call(t,n)?t[n].push(r):t[n]=[r]},ie),af=cr(zn),lf=Cr(function(t,n,r){Qn(t,n,r)}),sf=Cr(function(t,n,r,e){Qn(t,n,r,e)}),hf=cr(function(t,n){return null==t?{}:(n=l(On(n,1),Ae), +nr(t,jn(In(t,mu,ri),n)))}),pf=cr(function(t,n){return null==t?{}:nr(t,l(On(n,1),Ae))}),_f=te(wu),vf=te(mu),gf=$r(function(t,n,r){return n=n.toLowerCase(),t+(r?ku(n):n)}),df=$r(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),yf=$r(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),bf=Dr("toLowerCase"),xf=$r(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),jf=$r(function(t,n,r){return t+(r?" ":"")+mf(n)}),wf=$r(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),mf=Dr("toUpperCase"),Af=cr(function(t,n){ +try{return r(t,P,n)}catch(t){return eu(t)?t:new $u(t)}}),Of=cr(function(t,n){return u(On(n,1),function(n){n=Ae(n),t[n]=Mi(t[n],t)}),t}),kf=Pr(),Ef=Pr(true),Sf=cr(function(t,n){return function(r){return zn(r,t,n)}}),Rf=cr(function(t,n){return function(r){return zn(t,r,n)}}),If=Kr(l),Wf=Kr(i),Bf=Kr(_),Mf=Yr(),Cf=Yr(true),Lf=Vr(function(t,n){return t+n},0),zf=Xr("ceil"),Uf=Vr(function(t,n){return t/n},1),Df=Xr("floor"),$f=Vr(function(t,n){return t*n},1),Ff=Xr("round"),Tf=Vr(function(t,n){return t-n},0);return Rt.after=function(t,n){ +if(typeof n!="function")throw new Nu("Expected a function");return t=vu(t),function(){if(1>--t)return n.apply(this,arguments)}},Rt.ary=Ve,Rt.assign=Xi,Rt.assignIn=tf,Rt.assignInWith=nf,Rt.assignWith=rf,Rt.at=ef,Rt.before=Ke,Rt.bind=Mi,Rt.bindAll=Of,Rt.bindKey=Ci,Rt.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Pi(t)?t:[t]},Rt.chain=De,Rt.chunk=function(t,n,r){if(n=(r?de(t,n,r):n===P)?1:xo(vu(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Uu(so(r/n));er&&(r=-r>u?0:u+r),e=e===P||e>u?u:vu(e),0>e&&(e+=u),e=r>e?0:gu(e);r>>0,r?(t=bu(t))&&(typeof n=="string"||null!=n&&!Gi(n))&&(n=gr(n),""==n&&Ct.test(t))?Ar(t.match(Bt),0,r):ko.call(t,n,r):[]},Rt.spread=function(t,n){if(typeof t!="function")throw new Nu("Expected a function");return n=n===P?0:xo(vu(n),0),cr(function(e){var u=e[n];return e=Ar(e,0,n),u&&s(e,u),r(t,this,e)})},Rt.tail=function(t){return Se(t,1)},Rt.take=function(t,n,r){return t&&t.length?(n=r||n===P?1:vu(n), +lr(t,0,0>n?0:n)):[]},Rt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===P?1:vu(n),n=e-n,lr(t,0>n?0:n,e)):[]},Rt.takeRightWhile=function(t,n){return t&&t.length?yr(t,ie(n,3),false,true):[]},Rt.takeWhile=function(t,n){return t&&t.length?yr(t,ie(n,3)):[]},Rt.tap=function(t,n){return n(t),t},Rt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Nu("Expected a function");return fu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Ye(t,n,{leading:e,maxWait:n, +trailing:u})},Rt.thru=$e,Rt.toArray=pu,Rt.toPairs=_f,Rt.toPairsIn=vf,Rt.toPath=function(t){return Pi(t)?l(t,Ae):hu(t)?[t]:Ir(ii(t))},Rt.toPlainObject=yu,Rt.transform=function(t,n,r){var e=Pi(t)||Yi(t);if(n=ie(n,4),null==r)if(e||fu(t)){var o=t.constructor;r=e?Pi(t)?new o:[]:uu(o)?bn(ti(t)):{}}else r={};return(e?u:kn)(t,function(t,e,u){return n(r,t,e,u)}),r},Rt.unary=function(t){return Ve(t,1)},Rt.union=vi,Rt.unionBy=gi,Rt.unionWith=di,Rt.uniq=function(t){return t&&t.length?dr(t):[]},Rt.uniqBy=function(t,n){ +return t&&t.length?dr(t,ie(n,2)):[]},Rt.uniqWith=function(t,n){return t&&t.length?dr(t,P,n):[]},Rt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=ye(e,r)?[e]:mr(e);r=me(r,e),e=Ae(Me(e)),r=!(null!=r&&Bn(r,e))||delete r[e]}return r},Rt.unzip=ze,Rt.unzipWith=Ue,Rt.update=function(t,n,r){return null==t?t:ar(t,n,(typeof r=="function"?r:Iu)(Rn(t,n)),void 0)},Rt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:P,null!=t&&(t=ar(t,n,(typeof r=="function"?r:Iu)(Rn(t,n)),e)),t},Rt.values=Ou, +Rt.valuesIn=function(t){return null==t?[]:R(t,mu(t))},Rt.without=yi,Rt.words=Su,Rt.wrap=function(t,n){return n=null==n?Iu:n,Di(n,t)},Rt.xor=bi,Rt.xorBy=xi,Rt.xorWith=ji,Rt.zip=wi,Rt.zipObject=function(t,n){return jr(t||[],n||[],ln)},Rt.zipObjectDeep=function(t,n){return jr(t||[],n||[],ar)},Rt.zipWith=mi,Rt.entries=_f,Rt.entriesIn=vf,Rt.extend=tf,Rt.extendWith=nf,Bu(Rt,Rt),Rt.add=Lf,Rt.attempt=Af,Rt.camelCase=gf,Rt.capitalize=ku,Rt.ceil=zf,Rt.clamp=function(t,n,r){return r===P&&(r=n,n=P),r!==P&&(r=du(r), +r=r===r?r:0),n!==P&&(n=du(n),n=n===n?n:0),vn(du(t),n,r)},Rt.clone=function(t){return gn(t,false,true)},Rt.cloneDeep=function(t){return gn(t,true,true)},Rt.cloneDeepWith=function(t,n){return gn(t,true,true,n)},Rt.cloneWith=function(t,n){return gn(t,false,true,n)},Rt.conformsTo=function(t,n){return null==n||yn(t,n,wu(n))},Rt.deburr=Eu,Rt.defaultTo=function(t,n){return null==t||t!==t?n:t},Rt.divide=Uf,Rt.endsWith=function(t,n,r){t=bu(t),n=gr(n);var e=t.length,e=r=r===P?e:vn(vu(r),0,e);return r-=n.length,0<=r&&t.slice(r,e)==n; +},Rt.eq=Xe,Rt.escape=function(t){return(t=bu(t))&&X.test(t)?t.replace(H,en):t},Rt.escapeRegExp=function(t){return(t=bu(t))&&ft.test(t)?t.replace(it,"\\$&"):t},Rt.every=function(t,n,r){var e=Pi(t)?i:wn;return r&&de(t,n,r)&&(n=P),e(t,ie(n,3))},Rt.find=ki,Rt.findIndex=Ie,Rt.findKey=function(t,n){return v(t,ie(n,3),kn)},Rt.findLast=Ei,Rt.findLastIndex=We,Rt.findLastKey=function(t,n){return v(t,ie(n,3),En)},Rt.floor=Df,Rt.forEach=Te,Rt.forEachRight=Ne,Rt.forIn=function(t,n){return null==t?t:Ko(t,ie(n,3),mu); +},Rt.forInRight=function(t,n){return null==t?t:Go(t,ie(n,3),mu)},Rt.forOwn=function(t,n){return t&&kn(t,ie(n,3))},Rt.forOwnRight=function(t,n){return t&&En(t,ie(n,3))},Rt.get=xu,Rt.gt=Ti,Rt.gte=Ni,Rt.has=function(t,n){return null!=t&&le(t,n,Bn)},Rt.hasIn=ju,Rt.head=Be,Rt.identity=Iu,Rt.includes=function(t,n,r,e){return t=nu(t)?t:Ou(t),r=r&&!e?vu(r):0,e=t.length,0>r&&(r=xo(e+r,0)),su(t)?r<=e&&-1r&&(r=xo(e+r,0)),d(t,n,r)):-1},Rt.inRange=function(t,n,r){return n=du(n)||0,r===P?(r=n,n=0):r=du(r)||0,t=du(t),t>=jo(n,r)&&t=t},Rt.isSet=Ji,Rt.isString=su, +Rt.isSymbol=hu,Rt.isTypedArray=Yi,Rt.isUndefined=function(t){return t===P},Rt.isWeakMap=function(t){return cu(t)&&"[object WeakMap]"==Et(t)},Rt.isWeakSet=function(t){return cu(t)&&"[object WeakSet]"==Qu.call(t)},Rt.join=function(t,n){return t?yo.call(t,n):""},Rt.kebabCase=df,Rt.last=Me,Rt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==P&&(u=vu(r),u=(0>u?xo(e+u,0):jo(u,e-1))+1),n!==n)return g(t,b,u-1,true);for(;u--;)if(t[u]===n)return u;return-1},Rt.lowerCase=yf,Rt.lowerFirst=bf, +Rt.lt=Hi,Rt.lte=Qi,Rt.max=function(t){return t&&t.length?mn(t,Iu,Wn):P},Rt.maxBy=function(t,n){return t&&t.length?mn(t,ie(n,2),Wn):P},Rt.mean=function(t){return x(t,Iu)},Rt.meanBy=function(t,n){return x(t,ie(n,2))},Rt.min=function(t){return t&&t.length?mn(t,Iu,Gn):P},Rt.minBy=function(t,n){return t&&t.length?mn(t,ie(n,2),Gn):P},Rt.stubArray=Lu,Rt.stubFalse=zu,Rt.stubObject=function(){return{}},Rt.stubString=function(){return""},Rt.stubTrue=function(){return true},Rt.multiply=$f,Rt.nth=function(t,n){ +return t&&t.length?Xn(t,vu(n)):P},Rt.noConflict=function(){return qt._===this&&(qt._=Xu),this},Rt.noop=Mu,Rt.now=qe,Rt.pad=function(t,n,r){t=bu(t);var e=(n=vu(n))?T(t):0;return!n||e>=n?t:(n=(n-e)/2,Gr(ho(n),r)+t+Gr(so(n),r))},Rt.padEnd=function(t,n,r){t=bu(t);var e=(n=vu(n))?T(t):0;return n&&en){var e=t;t=n,n=e}return r||t%1||n%1?(r=mo(),jo(t+r*(n-t+Tt("1e-"+((r+"").length-1))),n)):ir(t,n)},Rt.reduce=function(t,n,r){var e=Pi(t)?h:m,u=3>arguments.length;return e(t,ie(n,4),r,u,qo)},Rt.reduceRight=function(t,n,r){var e=Pi(t)?p:m,u=3>arguments.length;return e(t,ie(n,4),r,u,Vo)},Rt.repeat=function(t,n,r){ +return n=(r?de(t,n,r):n===P)?1:vu(n),fr(bu(t),n)},Rt.replace=function(){var t=arguments,n=bu(t[0]);return 3>t.length?n:Ao.call(n,t[1],t[2])},Rt.result=function(t,n,r){n=ye(n,t)?[n]:mr(n);var e=-1,u=n.length;for(u||(t=P,u=1);++et||9007199254740991=o)return t;if(o=r-T(e),1>o)return e;if(r=i?Ar(i,0,o).join(""):t.slice(0,o),u===P)return r+e;if(i&&(o+=r.length-o),Gi(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=Tu(u.source,bu(dt.exec(u))+"g")), +u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===P?o:c)}}else t.indexOf(gr(u),o)!=o&&(u=r.lastIndexOf(u),-1u.__dir__?"Right":"")}),u},Pt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Pt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({ +iteratee:ie(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Pt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");Pt.prototype[t]=function(){return this.__filtered__?new Pt(this):this[r](1)}}),Pt.prototype.compact=function(){return this.filter(Iu)},Pt.prototype.find=function(t){return this.filter(t).head()},Pt.prototype.findLast=function(t){return this.reverse().find(t); +},Pt.prototype.invokeMap=cr(function(t,n){return typeof t=="function"?new Pt(this):this.map(function(r){return zn(r,t,n)})}),Pt.prototype.reject=function(t){return this.filter(Qe(ie(t)))},Pt.prototype.slice=function(t,n){t=vu(t);var r=this;return r.__filtered__&&(0n)?new Pt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==P&&(n=vu(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Pt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Pt.prototype.toArray=function(){return this.take(4294967295); +},kn(Pt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Rt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(Rt.prototype[n]=function(){function n(t){return t=u.apply(Rt,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Pt,a=f[0],l=c||Pi(i);l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&l?(i=c?i:new Pt(this),i=t.apply(i,f),i.__actions__.push({ +func:$e,args:[n],thisArg:P}),new Ft(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=Pu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Rt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(Pi(u)?u:[],t)}return this[r](function(r){return n.apply(Pi(r)?r:[],t)})}}),kn(Pt.prototype,function(t,n){var r=Rt[n];if(r){var e=r.name+""; +(zo[e]||(zo[e]=[])).push({name:n,func:r})}}),zo[Zr(P,2).name]=[{name:"wrapper",func:P}],Pt.prototype.clone=function(){var t=new Pt(this.__wrapped__);return t.__actions__=Ir(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ir(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ir(this.__views__),t},Pt.prototype.reverse=function(){if(this.__filtered__){var t=new Pt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t; +},Pt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=Pi(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==t&&a==t)return br(n,this.__actions__);e=[];t:for(;t--&&c=this.__values__.length,n=t?P:this.__values__[this.__index__++];return{done:t,value:n}},Rt.prototype.plant=function(t){ +for(var n,r=this;r instanceof $t;){var e=Ee(r);e.__index__=0,e.__values__=P,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Rt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Pt?(this.__actions__.length&&(t=new Pt(this)),t=t.reverse(),t.__actions__.push({func:$e,args:[Le],thisArg:P}),new Ft(t,this.__chain__)):this.thru(Le)},Rt.prototype.toJSON=Rt.prototype.valueOf=Rt.prototype.value=function(){return br(this.__wrapped__,this.__actions__)},Rt.prototype.first=Rt.prototype.head, +io&&(Rt.prototype[io]=Fe),Rt}var P,Z=1/0,q=NaN,V=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],K=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,J=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/&(?:amp|lt|gt|quot|#39|#96);/g,H=/[&<>"'`]/g,Q=RegExp(Y.source),X=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,nt=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(it.source),ct=/^\s+|\s+$/g,at=/^\s+/,lt=/\s+$/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ht=/\{\n\/\* \[wrapped with (.+)\] \*/,pt=/,? & /,_t=/[a-zA-Z0-9]+/g,vt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,yt=/^0x/i,bt=/^[-+]0x[0-9a-f]+$/i,xt=/^0b[01]+$/i,jt=/^\[object .+?Constructor\]$/,wt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,At=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ot=/($^)/,kt=/['\n\r\u2028\u2029\\]/g,Et="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",St="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+Et,Rt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",It=RegExp("['\u2019]","g"),Wt=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),Bt=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+Rt+Et,"g"),Mt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",St].join("|"),"g"),Ct=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zt="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Ut={}; +Ut["[object Float32Array]"]=Ut["[object Float64Array]"]=Ut["[object Int8Array]"]=Ut["[object Int16Array]"]=Ut["[object Int32Array]"]=Ut["[object Uint8Array]"]=Ut["[object Uint8ClampedArray]"]=Ut["[object Uint16Array]"]=Ut["[object Uint32Array]"]=true,Ut["[object Arguments]"]=Ut["[object Array]"]=Ut["[object ArrayBuffer]"]=Ut["[object Boolean]"]=Ut["[object DataView]"]=Ut["[object Date]"]=Ut["[object Error]"]=Ut["[object Function]"]=Ut["[object Map]"]=Ut["[object Number]"]=Ut["[object Object]"]=Ut["[object RegExp]"]=Ut["[object Set]"]=Ut["[object String]"]=Ut["[object WeakMap]"]=false; +var Dt={};Dt["[object Arguments]"]=Dt["[object Array]"]=Dt["[object ArrayBuffer]"]=Dt["[object DataView]"]=Dt["[object Boolean]"]=Dt["[object Date]"]=Dt["[object Float32Array]"]=Dt["[object Float64Array]"]=Dt["[object Int8Array]"]=Dt["[object Int16Array]"]=Dt["[object Int32Array]"]=Dt["[object Map]"]=Dt["[object Number]"]=Dt["[object Object]"]=Dt["[object RegExp]"]=Dt["[object Set]"]=Dt["[object String]"]=Dt["[object Symbol]"]=Dt["[object Uint8Array]"]=Dt["[object Uint8ClampedArray]"]=Dt["[object Uint16Array]"]=Dt["[object Uint32Array]"]=true, +Dt["[object Error]"]=Dt["[object Function]"]=Dt["[object WeakMap]"]=false;var $t,Ft={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tt=parseFloat,Nt=parseInt,Pt=typeof global=="object"&&global&&global.Object===Object&&global,Zt=typeof self=="object"&&self&&self.Object===Object&&self,qt=Pt||Zt||Function("return this")(),Vt=Pt&&typeof exports=="object"&&exports,Kt=Vt&&typeof module=="object"&&module,Gt=Kt&&Kt.exports===Vt,Jt=Gt&&Pt.h;t:{try{$t=Jt&&Jt.f("util");break t}catch(t){} +$t=void 0}var Yt=$t&&$t.isArrayBuffer,Ht=$t&&$t.isDate,Qt=$t&&$t.isMap,Xt=$t&&$t.isRegExp,tn=$t&&$t.isSet,nn=$t&&$t.isTypedArray,rn=w({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n", +"\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"}),en=w({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),un=w({"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"}),on=N();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(qt._=on, +define(function(){return on})):Kt?((Kt.exports=on)._=on,Vt._=on):qt._=on}).call(this); \ No newline at end of file diff --git a/dist/mapping.fp.js b/dist/mapping.fp.js index abf71920f..4d9c62b03 100644 --- a/dist/mapping.fp.js +++ b/dist/mapping.fp.js @@ -63,11 +63,20 @@ return /******/ (function(modules) { // webpackBootstrap 'entries': 'toPairs', 'entriesIn': 'toPairsIn', 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', 'extendWith': 'assignInWith', 'first': 'head', + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + // Ramda aliases. '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', 'all': 'every', 'allPass': 'overEvery', 'always': 'constant', @@ -81,8 +90,11 @@ return /******/ (function(modules) { // webpackBootstrap 'contains': 'includes', 'dissoc': 'unset', 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', 'equals': 'isEqual', 'identical': 'eq', + 'indexBy': 'keyBy', 'init': 'initial', 'invertObj': 'invert', 'juxt': 'over', @@ -99,36 +111,44 @@ return /******/ (function(modules) { // webpackBootstrap 'propEq': 'matchesProperty', 'propOr': 'getOr', 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', 'unapply': 'rest', 'unnest': 'flatten', 'useWith': 'overArgs', - 'whereEq': 'filter', + 'where': 'conformsTo', + 'whereEq': 'isMatch', 'zipObj': 'zipObject' }; /** Used to map ary to method names. */ exports.aryMethod = { '1': [ - 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', - 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', - 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', - 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', - 'uniqueId', 'words' + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', + 'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', + 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', + 'trimStart', 'uniqueId', 'words', 'zipAll' ], '2': [ - 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', - 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', - 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', - 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', - 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', - 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', - 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', - 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', - 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', - 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', - 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth', - 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', - 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', @@ -207,7 +227,9 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to map method names to rearg configs. */ exports.methodRearg = { + 'assignInAllWith': [1, 2, 0], 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 2, 0], 'assignWith': [1, 2, 0], 'differenceBy': [1, 2, 0], 'differenceWith': [1, 2, 0], @@ -216,6 +238,7 @@ return /******/ (function(modules) { // webpackBootstrap 'intersectionWith': [1, 2, 0], 'isEqualWith': [1, 2, 0], 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 2, 0], 'mergeWith': [1, 2, 0], 'padChars': [2, 1, 0], 'padCharsEnd': [2, 1, 0], @@ -235,11 +258,20 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to map method names to spread configs. */ exports.methodSpread = { - 'invokeArgs': 2, - 'invokeArgsMap': 2, - 'partial': 1, - 'partialRight': 1, - 'without': 1 + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'afterRearg': true, 'start': 1 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'afterRearg': true, 'start': 1 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'afterRearg': true, 'start': 1 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } }; /** Used to identify methods which mutate arrays or objects. */ @@ -256,13 +288,21 @@ return /******/ (function(modules) { // webpackBootstrap }, 'object': { 'assign': true, + 'assignAll': true, + 'assignAllWith': true, 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, 'assignInWith': true, 'assignWith': true, 'defaults': true, + 'defaultsAll': true, 'defaultsDeep': true, + 'defaultsDeepAll': true, 'merge': true, - 'mergeWith': true + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, }, 'set': { 'set': true, @@ -302,8 +342,14 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to map method names to other names. */ exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', 'curryN': 'curry', 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', 'findFrom': 'find', 'findIndexFrom': 'findIndex', 'findLastFrom': 'findLast', @@ -314,14 +360,18 @@ return /******/ (function(modules) { // webpackBootstrap 'invokeArgs': 'invoke', 'invokeArgsMap': 'invokeMap', 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', 'padChars': 'pad', 'padCharsEnd': 'padEnd', 'padCharsStart': 'padStart', + 'propertyOf': 'get', 'restFrom': 'rest', 'spreadFrom': 'spread', 'trimChars': 'trim', 'trimCharsEnd': 'trimEnd', - 'trimCharsStart': 'trimStart' + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' }; /** Used to track methods that skip fixing their arity. */ @@ -331,6 +381,7 @@ return /******/ (function(modules) { // webpackBootstrap 'flowRight': true, 'iteratee': true, 'mixin': true, + 'rearg': true, 'runInContext': true }; @@ -356,12 +407,14 @@ return /******/ (function(modules) { // webpackBootstrap 'overArgs': true, 'partial': true, 'partialRight': true, + 'propertyOf': true, 'random': true, 'range': true, 'rangeRight': true, 'subtract': true, 'zip': true, - 'zipObject': true + 'zipObject': true, + 'zipObjectDeep': true }; diff --git a/doc/README.md b/doc/README.md index 7f201043c..a77dc6e09 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,4 +1,4 @@ -# lodash v4.13.1 +# lodash v4.14.0 @@ -131,7 +131,7 @@ * `_.memoize` * `_.negate` * `_.once` -* `_.overArgs` +* `_.overArgs` * `_.partial` * `_.partialRight` * `_.rearg` @@ -151,6 +151,7 @@ * `_.cloneDeep` * `_.cloneDeepWith` * `_.cloneWith` +* `_.conformsTo` * `_.eq` * `_.gt` * `_.gte` @@ -351,6 +352,7 @@ * `_.cond` * `_.conforms` * `_.constant` +* `_.defaultTo` * `_.flow` * `_.flowRight` * `_.identity` @@ -413,7 +415,7 @@ ### `_.chunk(array, [size=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6118 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") +[#](#_chunkarray-size1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6318 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") [Ⓣ][1] Creates an array of elements split into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining @@ -436,14 +438,14 @@ _.chunk(['a', 'b', 'c', 'd'], 2); _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']] ``` -* * * +--- ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6153 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") +[#](#_compactarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6353 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") [Ⓣ][1] Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are falsey. @@ -461,14 +463,14 @@ Creates an array with all falsey values removed. The values `false`, `null`, _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3] ``` -* * * +--- ### `_.concat(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6190 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") +[#](#_concatarray-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6390 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") [Ⓣ][1] Creates a new array concatenating `array` with any additional arrays and/or values. @@ -493,19 +495,22 @@ console.log(other); console.log(array); // => [1] ``` -* * * +--- ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6223 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") +[#](#_differencearray-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6425 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") [Ⓣ][1] -Creates an array of unique `array` values not included in the other given -arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) +Creates an array of `array` values not included in the other given arrays +using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons. The order of result values is determined by the order they occur in the first array. +
+
+**Note:** Unlike `_.pullAll`, this method returns a new array. #### Since 0.1.0 @@ -521,26 +526,29 @@ order they occur in the first array. _.difference([2, 1], [2, 3]); // => [1] ``` -* * * +--- ### `_.differenceBy(array, [values], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6253 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") +[#](#_differencebyarray-values-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6456 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") [Ⓣ][1] This method is like `_.difference` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion by which they're compared. Result values are chosen from the first array. The iteratee is invoked with one argument: *(value)*. +
+
+**Note:** Unlike `_.pullAllBy`, this method returns a new array. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[values]` *(...Array)*: The values to exclude. -3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of filtered values. @@ -554,19 +562,22 @@ _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); // => [{ 'x': 2 }] ``` -* * * +--- ### `_.differenceWith(array, [values], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6284 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") +[#](#_differencewitharray-values-comparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6489 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") [Ⓣ][1] This method is like `_.difference` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. Result values are chosen from the first array. The comparator is invoked with two arguments:
*(arrVal, othVal)*. +
+
+**Note:** Unlike `_.pullAllWith`, this method returns a new array. #### Since 4.0.0 @@ -585,14 +596,14 @@ var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); // => [{ 'x': 2, 'y': 1 }] ``` -* * * +--- ### `_.drop(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6319 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") +[#](#_droparray-n1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6524 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements dropped from the beginning. @@ -619,14 +630,14 @@ _.drop([1, 2, 3], 5); _.drop([1, 2, 3], 0); // => [1, 2, 3] ``` -* * * +--- ### `_.dropRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6353 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") +[#](#_droprightarray-n1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6558 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements dropped from the end. @@ -653,14 +664,14 @@ _.dropRight([1, 2, 3], 5); _.dropRight([1, 2, 3], 0); // => [1, 2, 3] ``` -* * * +--- ### `_.dropRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6399 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") +[#](#_droprightwhilearray-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6603 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") [Ⓣ][1] Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is @@ -670,7 +681,7 @@ invoked with three arguments: *(value, index, array)*. 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. @@ -698,14 +709,14 @@ _.dropRightWhile(users, ['active', false]); _.dropRightWhile(users, 'active'); // => objects for ['barney', 'fred', 'pebbles'] ``` -* * * +--- ### `_.dropWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6441 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") +[#](#_dropwhilearray-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6645 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") [Ⓣ][1] Creates a slice of `array` excluding elements dropped from the beginning. Elements are dropped until `predicate` returns falsey. The predicate is @@ -715,7 +726,7 @@ invoked with three arguments: *(value, index, array)*. 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. @@ -743,14 +754,14 @@ _.dropWhile(users, ['active', false]); _.dropWhile(users, 'active'); // => objects for ['barney', 'fred', 'pebbles'] ``` -* * * +--- ### `_.fill(array, value, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6476 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") +[#](#_fillarray-value-start0-endarraylength) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6680 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") [Ⓣ][1] Fills elements of `array` with `value` from `start` up to, but not including, `end`. @@ -783,14 +794,14 @@ _.fill(Array(3), 2); _.fill([4, 6, 8, 10], '*', 1, 3); // => [4, '*', '*', 10] ``` -* * * +--- ### `_.findIndex(array, [predicate=_.identity], [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6524 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") +[#](#_findindexarray-predicate_identity-fromindex0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6728 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") [Ⓣ][1] This method is like `_.find` except that it returns the index of the first element `predicate` returns truthy for instead of the element itself. @@ -799,7 +810,7 @@ element `predicate` returns truthy for instead of the element itself. 1.1.0 #### Arguments 1. `array` *(Array)*: The array to search. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=0]` *(number)*: The index to search from. #### Returns @@ -828,14 +839,14 @@ _.findIndex(users, ['active', false]); _.findIndex(users, 'active'); // => 2 ``` -* * * +--- ### `_.findLastIndex(array, [predicate=_.identity], [fromIndex=array.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6572 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") +[#](#_findlastindexarray-predicate_identity-fromindexarraylength-1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6776 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") [Ⓣ][1] This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. @@ -844,7 +855,7 @@ of `collection` from right to left. 2.0.0 #### Arguments 1. `array` *(Array)*: The array to search. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=array.length-1]` *(number)*: The index to search from. #### Returns @@ -873,14 +884,14 @@ _.findLastIndex(users, ['active', false]); _.findLastIndex(users, 'active'); // => 0 ``` -* * * +--- ### `_.flatten(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6601 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") +[#](#_flattenarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6805 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") [Ⓣ][1] Flattens `array` a single level deep. @@ -897,14 +908,14 @@ Flattens `array` a single level deep. _.flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5] ``` -* * * +--- ### `_.flattenDeep(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6620 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") +[#](#_flattendeeparray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6824 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") [Ⓣ][1] Recursively flattens `array`. @@ -921,14 +932,14 @@ Recursively flattens `array`. _.flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5] ``` -* * * +--- ### `_.flattenDepth(array, [depth=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6645 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package") +[#](#_flattendeptharray-depth1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6849 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package") [Ⓣ][1] Recursively flatten `array` up to `depth` times. @@ -951,14 +962,14 @@ _.flattenDepth(array, 1); _.flattenDepth(array, 2); // => [1, 2, 3, [4], 5] ``` -* * * +--- ### `_.fromPairs(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6669 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") +[#](#_frompairspairs) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6873 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") [Ⓣ][1] The inverse of `_.toPairs`; this method returns an object composed from key-value `pairs`. @@ -973,17 +984,17 @@ from key-value `pairs`. #### Example ```js -_.fromPairs([['fred', 30], ['barney', 40]]); -// => { 'fred': 30, 'barney': 40 } +_.fromPairs([['a', 1], ['b', 2]]); +// => { 'a': 1, 'b': 2 } ``` -* * * +--- ### `_.head(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6699 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") +[#](#_headarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6903 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") [Ⓣ][1] Gets the first element of `array`. @@ -1006,14 +1017,14 @@ _.head([1, 2, 3]); _.head([]); // => undefined ``` -* * * +--- ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6726 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") +[#](#_indexofarray-value-fromindex0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6930 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") [Ⓣ][1] Gets the index at which the first occurrence of `value` is found in `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1039,14 +1050,14 @@ _.indexOf([1, 2, 1, 2], 2); _.indexOf([1, 2, 1, 2], 2, 2); // => 3 ``` -* * * +--- ### `_.initial(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") +[#](#_initialarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6956 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") [Ⓣ][1] Gets all but the last element of `array`. @@ -1063,14 +1074,14 @@ Gets all but the last element of `array`. _.initial([1, 2, 3]); // => [1, 2] ``` -* * * +--- ### `_.intersection([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6773 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") +[#](#_intersectionarrays) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L6977 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") [Ⓣ][1] Creates an array of unique values that are included in all given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1090,14 +1101,14 @@ order they occur in the first array. _.intersection([2, 1], [2, 3]); // => [2] ``` -* * * +--- ### `_.intersectionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6803 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") +[#](#_intersectionbyarrays-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7006 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") [Ⓣ][1] This method is like `_.intersection` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion @@ -1108,7 +1119,7 @@ The iteratee is invoked with one argument: *(value)*. 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of intersecting values. @@ -1122,14 +1133,14 @@ _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }] ``` -* * * +--- ### `_.intersectionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6838 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") +[#](#_intersectionwitharrays-comparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7041 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") [Ⓣ][1] This method is like `_.intersection` except that it accepts `comparator` which is invoked to compare elements of `arrays`. Result values are chosen @@ -1153,14 +1164,14 @@ var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.intersectionWith(objects, others, _.isEqual); // => [{ 'x': 1, 'y': 2 }] ``` -* * * +--- ### `_.join(array, [separator=','])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6867 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") +[#](#_joinarray-separator-) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7070 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") [Ⓣ][1] Converts all elements in `array` into a string separated by `separator`. @@ -1178,14 +1189,14 @@ Converts all elements in `array` into a string separated by `separator`. _.join(['a', 'b', 'c'], '~'); // => 'a~b~c' ``` -* * * +--- ### `_.last(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6885 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") +[#](#_lastarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7088 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") [Ⓣ][1] Gets the last element of `array`. @@ -1202,14 +1213,14 @@ Gets the last element of `array`. _.last([1, 2, 3]); // => 3 ``` -* * * +--- ### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6911 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") +[#](#_lastindexofarray-value-fromindexarraylength-1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7114 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") [Ⓣ][1] This method is like `_.indexOf` except that it iterates over elements of `array` from right to left. @@ -1233,14 +1244,14 @@ _.lastIndexOf([1, 2, 1, 2], 2); _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1 ``` -* * * +--- ### `_.nth(array, [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6957 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.nth "See the npm package") +[#](#_ntharray-n0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7160 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.nth "See the npm package") [Ⓣ][1] Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. @@ -1264,14 +1275,14 @@ _.nth(array, 1); _.nth(array, -2); // => 'c'; ``` -* * * +--- ### `_.pull(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L6984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") +[#](#_pullarray-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7187 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") [Ⓣ][1] Removes all given values from `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1298,14 +1309,14 @@ _.pull(array, 'a', 'c'); console.log(array); // => ['b', 'b'] ``` -* * * +--- ### `_.pullAll(array, values)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7006 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") +[#](#_pullallarray-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7209 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") [Ⓣ][1] This method is like `_.pull` except that it accepts an array of values to remove.
@@ -1329,14 +1340,14 @@ _.pullAll(array, ['a', 'c']); console.log(array); // => ['b', 'b'] ``` -* * * +--- ### `_.pullAllBy(array, values, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7036 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") +[#](#_pullallbyarray-values-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7239 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") [Ⓣ][1] This method is like `_.pullAll` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion @@ -1350,7 +1361,7 @@ by which they're compared. The iteratee is invoked with one argument: *(value)*. #### Arguments 1. `array` *(Array)*: The array to modify. 2. `values` *(Array)*: The values to remove. -3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns `array`. @@ -1363,14 +1374,14 @@ _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); console.log(array); // => [{ 'x': 2 }] ``` -* * * +--- ### `_.pullAllWith(array, values, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7065 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallwith "See the npm package") +[#](#_pullallwitharray-values-comparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7268 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullallwith "See the npm package") [Ⓣ][1] This method is like `_.pullAll` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. The comparator is @@ -1397,14 +1408,14 @@ _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); console.log(array); // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] ``` -* * * +--- ### `_.pullAt(array, [indexes])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7095 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") +[#](#_pullatarray-indexes) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7298 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") [Ⓣ][1] Removes elements from `array` corresponding to `indexes` and returns an array of removed elements. @@ -1432,14 +1443,14 @@ console.log(array); console.log(pulled); // => ['b', 'd'] ``` -* * * +--- ### `_.remove(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7137 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") +[#](#_removearray-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7340 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") [Ⓣ][1] Removes all elements from `array` that `predicate` returns truthy for and returns an array of the removed elements. The predicate is invoked @@ -1453,7 +1464,7 @@ to pull elements from an array by value. 2.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new array of removed elements. @@ -1471,14 +1482,14 @@ console.log(array); console.log(evens); // => [2, 4] ``` -* * * +--- ### `_.reverse(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") +[#](#_reversearray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7384 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") [Ⓣ][1] Reverses `array` so that the first element becomes the last, the second element becomes the second to last, and so on. @@ -1505,14 +1516,14 @@ _.reverse(array); console.log(array); // => [3, 2, 1] ``` -* * * +--- ### `_.slice(array, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7201 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") +[#](#_slicearray-start0-endarraylength) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7404 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") [Ⓣ][1] Creates a slice of `array` from `start` up to, but not including, `end`.
@@ -1531,14 +1542,14 @@ returned. #### Returns *(Array)*: Returns the slice of `array`. -* * * +--- ### `_.sortedIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") +[#](#_sortedindexarray-value) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7437 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") [Ⓣ][1] Uses a binary search to determine the lowest index at which `value` should be inserted into `array` in order to maintain its sort order. @@ -1557,14 +1568,14 @@ should be inserted into `array` in order to maintain its sort order. _.sortedIndex([30, 50], 40); // => 1 ``` -* * * +--- ### `_.sortedIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7264 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") +[#](#_sortedindexbyarray-value-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7467 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") [Ⓣ][1] This method is like `_.sortedIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1575,7 +1586,7 @@ sort ranking. The iteratee is invoked with one argument: *(value)*. #### Arguments 1. `array` *(Array)*: The sorted array to inspect. 2. `value` *(*)*: The value to evaluate. -3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the index at which `value` should be inserted into `array`. @@ -1591,14 +1602,14 @@ _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); _.sortedIndexBy(objects, { 'x': 4 }, 'x'); // => 0 ``` -* * * +--- ### `_.sortedIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7284 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") +[#](#_sortedindexofarray-value) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7487 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") [Ⓣ][1] This method is like `_.indexOf` except that it performs a binary search on a sorted `array`. @@ -1617,14 +1628,14 @@ search on a sorted `array`. _.sortedIndexOf([4, 5, 5, 5, 6], 5); // => 1 ``` -* * * +--- ### `_.sortedLastIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7313 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") +[#](#_sortedlastindexarray-value) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7516 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") [Ⓣ][1] This method is like `_.sortedIndex` except that it returns the highest index at which `value` should be inserted into `array` in order to @@ -1644,14 +1655,14 @@ maintain its sort order. _.sortedLastIndex([4, 5, 5, 5, 6], 5); // => 4 ``` -* * * +--- ### `_.sortedLastIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7343 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") +[#](#_sortedlastindexbyarray-value-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7546 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") [Ⓣ][1] This method is like `_.sortedLastIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1662,7 +1673,7 @@ sort ranking. The iteratee is invoked with one argument: *(value)*. #### Arguments 1. `array` *(Array)*: The sorted array to inspect. 2. `value` *(*)*: The value to evaluate. -3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the index at which `value` should be inserted into `array`. @@ -1678,14 +1689,14 @@ _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); // => 1 ``` -* * * +--- ### `_.sortedLastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7363 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") +[#](#_sortedlastindexofarray-value) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7566 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") [Ⓣ][1] This method is like `_.lastIndexOf` except that it performs a binary search on a sorted `array`. @@ -1704,14 +1715,14 @@ search on a sorted `array`. _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); // => 3 ``` -* * * +--- ### `_.sortedUniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7389 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") +[#](#_sorteduniqarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7592 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") [Ⓣ][1] This method is like `_.uniq` except that it's designed and optimized for sorted arrays. @@ -1729,14 +1740,14 @@ for sorted arrays. _.sortedUniq([1, 1, 2]); // => [1, 2] ``` -* * * +--- ### `_.sortedUniqBy(array, [iteratee])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7411 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") +[#](#_sorteduniqbyarray-iteratee) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7614 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") [Ⓣ][1] This method is like `_.uniqBy` except that it's designed and optimized for sorted arrays. @@ -1755,14 +1766,14 @@ for sorted arrays. _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); // => [1.1, 2.3] ``` -* * * +--- ### `_.tail(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") +[#](#_tailarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7634 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") [Ⓣ][1] Gets all but the first element of `array`. @@ -1779,14 +1790,14 @@ Gets all but the first element of `array`. _.tail([1, 2, 3]); // => [2, 3] ``` -* * * +--- ### `_.take(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7460 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") +[#](#_takearray-n1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7663 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements taken from the beginning. @@ -1813,14 +1824,14 @@ _.take([1, 2, 3], 5); _.take([1, 2, 3], 0); // => [] ``` -* * * +--- ### `_.takeRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7493 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") +[#](#_takerightarray-n1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7696 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements taken from the end. @@ -1847,14 +1858,14 @@ _.takeRight([1, 2, 3], 5); _.takeRight([1, 2, 3], 0); // => [] ``` -* * * +--- ### `_.takeRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7539 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") +[#](#_takerightwhilearray-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7742 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") [Ⓣ][1] Creates a slice of `array` with elements taken from the end. Elements are taken until `predicate` returns falsey. The predicate is invoked with @@ -1864,7 +1875,7 @@ three arguments: *(value, index, array)*. 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. @@ -1892,14 +1903,14 @@ _.takeRightWhile(users, ['active', false]); _.takeRightWhile(users, 'active'); // => [] ``` -* * * +--- ### `_.takeWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7581 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") +[#](#_takewhilearray-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7784 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") [Ⓣ][1] Creates a slice of `array` with elements taken from the beginning. Elements are taken until `predicate` returns falsey. The predicate is invoked with @@ -1909,7 +1920,7 @@ three arguments: *(value, index, array)*. 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. @@ -1937,14 +1948,14 @@ _.takeWhile(users, ['active', false]); _.takeWhile(users, 'active'); // => [] ``` -* * * +--- ### `_.union([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7603 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") +[#](#_unionarrays) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7806 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") [Ⓣ][1] Creates an array of unique values, in order, from all given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1963,25 +1974,26 @@ for equality comparisons. _.union([2], [1, 2]); // => [2, 1] ``` -* * * +--- ### `_.unionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") +[#](#_unionbyarrays-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7834 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") [Ⓣ][1] This method is like `_.union` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by -which uniqueness is computed. The iteratee is invoked with one argument:
+which uniqueness is computed. Result values are chosen from the first +array in which the value occurs. The iteratee is invoked with one argument:
*(value)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of combined values. @@ -1995,17 +2007,18 @@ _.unionBy([2.1], [1.2, 2.3], Math.floor); _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }] ``` -* * * +--- ### `_.unionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7658 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") +[#](#_unionwitharrays-comparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7863 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") [Ⓣ][1] This method is like `_.union` except that it accepts `comparator` which -is invoked to compare elements of `arrays`. The comparator is invoked +is invoked to compare elements of `arrays`. Result values are chosen from +the first array in which the value occurs. The comparator is invoked with two arguments: *(arrVal, othVal)*. #### Since @@ -2025,14 +2038,14 @@ var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.unionWith(objects, others, _.isEqual); // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] ``` -* * * +--- ### `_.uniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7683 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") +[#](#_uniqarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7888 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") [Ⓣ][1] Creates a duplicate-free version of an array, using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -2052,14 +2065,14 @@ element is kept. _.uniq([2, 1, 2]); // => [2, 1] ``` -* * * +--- ### `_.uniqBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7711 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") +[#](#_uniqbyarray-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7916 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") [Ⓣ][1] This method is like `_.uniq` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -2069,7 +2082,7 @@ uniqueness is computed. The iteratee is invoked with one argument: *(value)*. 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new duplicate free array. @@ -2083,14 +2096,14 @@ _.uniqBy([2.1, 1.2, 2.3], Math.floor); _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }] ``` -* * * +--- ### `_.uniqWith(array, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7736 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") +[#](#_uniqwitharray-comparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7941 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") [Ⓣ][1] This method is like `_.uniq` except that it accepts `comparator` which is invoked to compare elements of `array`. The comparator is invoked with @@ -2112,14 +2125,14 @@ var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.uniqWith(objects, _.isEqual); // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] ``` -* * * +--- ### `_.unzip(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7761 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") +[#](#_unziparray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L7966 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") [Ⓣ][1] This method is like `_.zip` except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip @@ -2135,20 +2148,20 @@ configuration. #### Example ```js -var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); -// => [['fred', 30, true], ['barney', 40, false]] +var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); +// => [['a', 1, true], ['b', 2, false]] _.unzip(zipped); -// => [['fred', 'barney'], [30, 40], [true, false]] +// => [['a', 'b'], [1, 2], [true, false]] ``` -* * * +--- ### `_.unzipWith(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7798 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") +[#](#_unzipwitharray-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8003 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") [Ⓣ][1] This method is like `_.unzip` except that it accepts `iteratee` to specify how regrouped values should be combined. The iteratee is invoked with the @@ -2171,18 +2184,21 @@ var zipped = _.zip([1, 2], [10, 20], [100, 200]); _.unzipWith(zipped, _.add); // => [3, 30, 300] ``` -* * * +--- ### `_.without(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7829 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") +[#](#_withoutarray-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8036 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") [Ⓣ][1] Creates an array excluding all given values using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons. +
+
+**Note:** Unlike `_.pull`, this method returns a new array. #### Since 0.1.0 @@ -2198,14 +2214,14 @@ for equality comparisons. _.without([2, 1, 2, 3], 1, 2); // => [3] ``` -* * * +--- ### `_.xor([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7853 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") +[#](#_xorarrays) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8060 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") [Ⓣ][1] Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) @@ -2225,14 +2241,14 @@ they occur in the arrays. _.xor([2, 1], [2, 3]); // => [1, 3] ``` -* * * +--- ### `_.xorBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7880 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") +[#](#_xorbyarrays-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8087 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") [Ⓣ][1] This method is like `_.xor` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by @@ -2243,7 +2259,7 @@ which by which they're compared. The iteratee is invoked with one argument:
4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of filtered values. @@ -2257,14 +2273,14 @@ _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 2 }] ``` -* * * +--- ### `_.xorWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7908 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") +[#](#_xorwitharrays-comparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8115 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") [Ⓣ][1] This method is like `_.xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked with @@ -2287,14 +2303,14 @@ var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.xorWith(objects, others, _.isEqual); // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] ``` -* * * +--- ### `_.zip([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7932 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") +[#](#_ziparrays) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8139 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") [Ⓣ][1] Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the @@ -2310,17 +2326,17 @@ second elements of the given arrays, and so on. #### Example ```js -_.zip(['fred', 'barney'], [30, 40], [true, false]); -// => [['fred', 30, true], ['barney', 40, false]] +_.zip(['a', 'b'], [1, 2], [true, false]); +// => [['a', 1, true], ['b', 2, false]] ``` -* * * +--- ### `_.zipObject([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7950 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") +[#](#_zipobjectprops-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8157 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") [Ⓣ][1] This method is like `_.fromPairs` except that it accepts two arrays, one of property identifiers and one of corresponding values. @@ -2339,14 +2355,14 @@ one of property identifiers and one of corresponding values. _.zipObject(['a', 'b'], [1, 2]); // => { 'a': 1, 'b': 2 } ``` -* * * +--- ### `_.zipObjectDeep([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7969 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") +[#](#_zipobjectdeepprops-values) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8176 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") [Ⓣ][1] This method is like `_.zipObject` except that it supports property paths. @@ -2364,14 +2380,14 @@ This method is like `_.zipObject` except that it supports property paths. _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } ``` -* * * +--- ### `_.zipWith([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L7992 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") +[#](#_zipwitharrays-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8199 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") [Ⓣ][1] This method is like `_.zip` except that it accepts `iteratee` to specify how grouped values should be combined. The iteratee is invoked with the @@ -2393,7 +2409,7 @@ _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { }); // => [111, 222] ``` -* * * +--- @@ -2406,7 +2422,7 @@ _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { ### `_.countBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") +[#](#_countbycollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8580 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The corresponding value of @@ -2417,7 +2433,7 @@ iteratee is invoked with one argument: *(value)*. 0.5.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys. +2. `[iteratee=_.identity]` *(Function)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. @@ -2431,14 +2447,14 @@ _.countBy([6.1, 4.2, 6.3], Math.floor); _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 } ``` -* * * +--- ### `_.every(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8414 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") +[#](#_everycollection-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8621 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") [Ⓣ][1] Checks if `predicate` returns truthy for **all** elements of `collection`. Iteration is stopped once `predicate` returns falsey. The predicate is @@ -2448,7 +2464,7 @@ invoked with three arguments: *(value, index|key, collection)*. 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(boolean)*: Returns `true` if all elements pass the predicate check, else `false`. @@ -2475,24 +2491,27 @@ _.every(users, ['active', false]); _.every(users, 'active'); // => false ``` -* * * +--- ### `_.filter(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8458 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") +[#](#_filtercollection-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8667 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") [Ⓣ][1] Iterates over elements of `collection`, returning an array of all elements `predicate` returns truthy for. The predicate is invoked with three arguments: *(value, index|key, collection)*. +
+
+**Note:** Unlike `_.remove`, this method returns a new array. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new filtered array. @@ -2519,14 +2538,14 @@ _.filter(users, ['active', false]); _.filter(users, 'active'); // => objects for ['barney'] ``` -* * * +--- ### `_.find(collection, [predicate=_.identity], [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8500 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") +[#](#_findcollection-predicate_identity-fromindex0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8709 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") [Ⓣ][1] Iterates over elements of `collection`, returning the first element `predicate` returns truthy for. The predicate is invoked with three @@ -2536,7 +2555,7 @@ arguments: *(value, index|key, collection)*. 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to search. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=0]` *(number)*: The index to search from. #### Returns @@ -2565,14 +2584,14 @@ _.find(users, ['active', false]); _.find(users, 'active'); // => object for 'barney' ``` -* * * +--- ### `_.findLast(collection, [predicate=_.identity], [fromIndex=collection.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8522 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") +[#](#_findlastcollection-predicate_identity-fromindexcollectionlength-1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8731 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") [Ⓣ][1] This method is like `_.find` except that it iterates over elements of `collection` from right to left. @@ -2581,7 +2600,7 @@ This method is like `_.find` except that it iterates over elements of 2.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to search. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=collection.length-1]` *(number)*: The index to search from. #### Returns @@ -2594,14 +2613,14 @@ _.findLast([1, 2, 3, 4], function(n) { }); // => 3 ``` -* * * +--- ### `_.flatMap(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8546 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") +[#](#_flatmapcollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8755 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") [Ⓣ][1] Creates a flattened array of values by running each element in `collection` thru `iteratee` and flattening the mapped results. The iteratee is invoked @@ -2611,7 +2630,7 @@ with three arguments: *(value, index|key, collection)*. 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new flattened array. @@ -2625,14 +2644,14 @@ function duplicate(n) { _.flatMap([1, 2], duplicate); // => [1, 1, 2, 2] ``` -* * * +--- ### `_.flatMapDeep(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package") +[#](#_flatmapdeepcollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8780 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package") [Ⓣ][1] This method is like `_.flatMap` except that it recursively flattens the mapped results. @@ -2641,7 +2660,7 @@ mapped results. 4.7.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new flattened array. @@ -2655,14 +2674,14 @@ function duplicate(n) { _.flatMapDeep([1, 2], duplicate); // => [1, 1, 2, 2] ``` -* * * +--- ### `_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8597 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package") +[#](#_flatmapdepthcollection-iteratee_identity-depth1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8806 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package") [Ⓣ][1] This method is like `_.flatMap` except that it recursively flattens the mapped results up to `depth` times. @@ -2671,7 +2690,7 @@ mapped results up to `depth` times. 4.7.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. 3. `[depth=1]` *(number)*: The maximum recursion depth. #### Returns @@ -2686,14 +2705,14 @@ function duplicate(n) { _.flatMapDepth([1, 2], duplicate, 2); // => [[1, 1], [2, 2]] ``` -* * * +--- ### `_.forEach(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8632 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") +[#](#_foreachcollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8841 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") [Ⓣ][1] Iterates over elements of `collection` and invokes `iteratee` for each element. The iteratee is invoked with three arguments: *(value, index|key, collection)*. @@ -2728,14 +2747,14 @@ _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { }); // => Logs 'a' then 'b' (iteration order is not guaranteed). ``` -* * * +--- ### `_.forEachRight(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8657 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") +[#](#_foreachrightcollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8866 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") [Ⓣ][1] This method is like `_.forEach` except that it iterates over elements of `collection` from right to left. @@ -2759,14 +2778,14 @@ _.forEachRight([1, 2], function(value) { }); // => Logs `2` then `1`. ``` -* * * +--- ### `_.groupBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8686 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") +[#](#_groupbycollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8895 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The order of grouped values @@ -2778,7 +2797,7 @@ key. The iteratee is invoked with one argument: *(value)*. 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys. +2. `[iteratee=_.identity]` *(Function)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. @@ -2792,14 +2811,14 @@ _.groupBy([6.1, 4.2, 6.3], Math.floor); _.groupBy(['one', 'two', 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] } ``` -* * * +--- ### `_.includes(collection, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8724 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") +[#](#_includescollection-value-fromindex0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8933 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") [Ⓣ][1] Checks if `value` is in `collection`. If `collection` is a string, it's checked for a substring of `value`, otherwise @@ -2825,25 +2844,25 @@ _.includes([1, 2, 3], 1); _.includes([1, 2, 3], 1, 2); // => false -_.includes({ 'user': 'fred', 'age': 40 }, 'fred'); +_.includes({ 'a': 1, 'b': 2 }, 1); // => true -_.includes('pebbles', 'eb'); +_.includes('abcd', 'bc'); // => true ``` -* * * +--- ### `_.invokeMap(collection, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8760 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") +[#](#_invokemapcollection-path-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8969 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") [Ⓣ][1] Invokes the method at `path` of each element in `collection`, returning an array of the results of each invoked method. Any additional arguments -are provided to each invoked method. If `methodName` is a function, it's -invoked for and `this` bound to, each element in `collection`. +are provided to each invoked method. If `path` is a function, it's invoked +for, and `this` bound to, each element in `collection`. #### Since 4.0.0 @@ -2863,14 +2882,14 @@ _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); _.invokeMap([123, 456], String.prototype.split, ''); // => [['1', '2', '3'], ['4', '5', '6']] ``` -* * * +--- ### `_.keyBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8802 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") +[#](#_keybycollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9011 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The corresponding value of @@ -2881,7 +2900,7 @@ iteratee is invoked with one argument: *(value)*. 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys. +2. `[iteratee=_.identity]` *(Function)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. @@ -2901,14 +2920,14 @@ _.keyBy(array, function(o) { _.keyBy(array, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } ``` -* * * +--- ### `_.map(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8849 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") +[#](#_mapcollection-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9057 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") [Ⓣ][1] Creates an array of values by running each element in `collection` thru `iteratee`. The iteratee is invoked with three arguments:
@@ -2929,7 +2948,7 @@ The guarded methods are:
0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new mapped array. @@ -2955,14 +2974,14 @@ var users = [ _.map(users, 'user'); // => ['barney', 'fred'] ``` -* * * +--- ### `_.orderBy(collection, [iteratees=[_.identity]], [orders])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8883 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") +[#](#_orderbycollection-iteratees_identity-orders) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9091 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") [Ⓣ][1] This method is like `_.sortBy` except that it allows specifying the sort orders of the iteratees to sort by. If `orders` is unspecified, all values @@ -2992,14 +3011,14 @@ var users = [ _.orderBy(users, ['user', 'age'], ['asc', 'desc']); // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] ``` -* * * +--- ### `_.partition(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8934 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") +[#](#_partitioncollection-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9141 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") [Ⓣ][1] Creates an array of elements split into two groups, the first of which contains elements `predicate` returns truthy for, the second of which @@ -3010,7 +3029,7 @@ invoked with one argument: *(value)*. 3.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the array of grouped elements. @@ -3038,14 +3057,14 @@ _.partition(users, ['active', false]); _.partition(users, 'active'); // => objects for [['fred'], ['barney', 'pebbles']] ``` -* * * +--- ### `_.reduce(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8975 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") +[#](#_reducecollection-iteratee_identity-accumulator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9182 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") [Ⓣ][1] Reduces `collection` to a value which is the accumulated result of running each element in `collection` thru `iteratee`, where each successive @@ -3086,14 +3105,14 @@ _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { }, {}); // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) ``` -* * * +--- ### `_.reduceRight(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9004 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") +[#](#_reducerightcollection-iteratee_identity-accumulator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9211 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") [Ⓣ][1] This method is like `_.reduce` except that it iterates over elements of `collection` from right to left. @@ -3117,14 +3136,14 @@ _.reduceRight(array, function(flattened, other) { }, []); // => [4, 5, 2, 3, 0, 1] ``` -* * * +--- ### `_.reject(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9046 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") +[#](#_rejectcollection-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9252 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") [Ⓣ][1] The opposite of `_.filter`; this method returns the elements of `collection` that `predicate` does **not** return truthy for. @@ -3133,7 +3152,7 @@ that `predicate` does **not** return truthy for. 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new filtered array. @@ -3160,14 +3179,14 @@ _.reject(users, ['active', false]); _.reject(users, 'active'); // => objects for ['barney'] ``` -* * * +--- ### `_.sample(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9068 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") +[#](#_samplecollection) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9271 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") [Ⓣ][1] Gets a random element from `collection`. @@ -3184,14 +3203,14 @@ Gets a random element from `collection`. _.sample([1, 2, 3, 4]); // => 2 ``` -* * * +--- ### `_.sampleSize(collection, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9095 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") +[#](#_samplesizecollection-n1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9298 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") [Ⓣ][1] Gets `n` random elements at unique keys from `collection` up to the size of `collection`. @@ -3213,14 +3232,14 @@ _.sampleSize([1, 2, 3], 2); _.sampleSize([1, 2, 3], 4); // => [2, 3, 1] ``` -* * * +--- ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9132 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") +[#](#_shufflecollection) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9335 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") [Ⓣ][1] Creates an array of shuffled values, using a version of the [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). @@ -3238,14 +3257,14 @@ Creates an array of shuffled values, using a version of the _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2] ``` -* * * +--- ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9157 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") +[#](#_sizecollection) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9360 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") [Ⓣ][1] Gets the size of `collection` by returning its length for array-like values or the number of own enumerable string keyed properties for objects. @@ -3269,14 +3288,14 @@ _.size({ 'a': 1, 'b': 2 }); _.size('pebbles'); // => 7 ``` -* * * +--- ### `_.some(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9211 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") +[#](#_somecollection-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9413 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") [Ⓣ][1] Checks if `predicate` returns truthy for **any** element of `collection`. Iteration is stopped once `predicate` returns truthy. The predicate is @@ -3286,7 +3305,7 @@ invoked with three arguments: *(value, index|key, collection)*. 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(boolean)*: Returns `true` if any element passes the predicate check, else `false`. @@ -3313,14 +3332,14 @@ _.some(users, ['active', false]); _.some(users, 'active'); // => true ``` -* * * +--- ### `_.sortBy(collection, [iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9253 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") +[#](#_sortbycollection-iteratees_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9455 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method @@ -3331,7 +3350,7 @@ equal elements. The iteratees are invoked with one argument: *(value)*. 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratees=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The iteratees to sort by. +2. `[iteratees=[_.identity]]` *(...(Function|Function[]))*: The iteratees to sort by. #### Returns *(Array)*: Returns the new sorted array. @@ -3356,7 +3375,7 @@ _.sortBy(users, 'user', function(o) { }); // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] ``` -* * * +--- @@ -3369,7 +3388,7 @@ _.sortBy(users, 'user', function(o) { ### `_.now()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9288 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") +[#](#_now) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9486 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") [Ⓣ][1] Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. @@ -3386,7 +3405,7 @@ _.defer(function(stamp) { }, _.now()); // => Logs the number of milliseconds it took for the deferred invocation. ``` -* * * +--- @@ -3399,7 +3418,7 @@ _.defer(function(stamp) { ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9318 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") +[#](#_aftern-func) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9516 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") [Ⓣ][1] The opposite of `_.before`; this method creates a function that invokes `func` once it's called `n` or more times. @@ -3426,14 +3445,14 @@ _.forEach(saves, function(type) { }); // => Logs 'done saving!' after the two async saves have completed. ``` -* * * +--- ### `_.ary(func, [n=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9347 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") +[#](#_aryfunc-nfunclength) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9545 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") [Ⓣ][1] Creates a function that invokes `func`, with up to `n` arguments, ignoring any additional arguments. @@ -3452,14 +3471,14 @@ ignoring any additional arguments. _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10] ``` -* * * +--- ### `_.before(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9370 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") +[#](#_beforen-func) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9568 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") [Ⓣ][1] Creates a function that invokes `func`, with the `this` binding and arguments of the created function, while it's called less than `n` times. Subsequent @@ -3477,16 +3496,16 @@ calls to the created function return the result of the last `func` invocation. #### Example ```js jQuery(element).on('click', _.before(5, addContactToList)); -// => allows adding up to 4 contacts to the list +// => Allows adding up to 4 contacts to the list. ``` -* * * +--- ### `_.bind(func, thisArg, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9422 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") +[#](#_bindfunc-thisarg-partials) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9620 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of `thisArg` and `partials` prepended to the arguments it receives. @@ -3511,9 +3530,9 @@ property of bound functions. #### Example ```js -var greet = function(greeting, punctuation) { +function greet(greeting, punctuation) { return greeting + ' ' + this.user + punctuation; -}; +} var object = { 'user': 'fred' }; @@ -3526,14 +3545,14 @@ var bound = _.bind(greet, object, _, '!'); bound('hi'); // => 'hi fred!' ``` -* * * +--- ### `_.bindKey(object, key, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9476 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") +[#](#_bindkeyobject-key-partials) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9674 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") [Ⓣ][1] Creates a function that invokes the method at `object[key]` with `partials` prepended to the arguments it receives. @@ -3583,14 +3602,14 @@ var bound = _.bindKey(object, 'greet', _, '!'); bound('hi'); // => 'hiya fred!' ``` -* * * +--- ### `_.curry(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9526 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") +[#](#_curryfunc-arityfunclength) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9724 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") [Ⓣ][1] Creates a function that accepts arguments of `func` and either invokes `func` returning its result, if at least `arity` number of arguments have @@ -3635,14 +3654,14 @@ curried(1, 2, 3); curried(1)(_, 3)(2); // => [1, 2, 3] ``` -* * * +--- ### `_.curryRight(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") +[#](#_curryrightfunc-arityfunclength) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9769 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") [Ⓣ][1] This method is like `_.curry` except that arguments are applied to `func` in the manner of `_.partialRight` instead of `_.partial`. @@ -3684,14 +3703,14 @@ curried(1, 2, 3); curried(3)(1, _)(2); // => [1, 2, 3] ``` -* * * +--- ### `_.debounce(func, [wait=0], [options={}], [options.leading=false], [options.maxWait], [options.trailing=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9628 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") +[#](#_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9826 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") [Ⓣ][1] Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was @@ -3743,14 +3762,14 @@ jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel); ``` -* * * +--- ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9765 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") +[#](#_deferfunc-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9966 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") [Ⓣ][1] Defers invoking the `func` until the current call stack has cleared. Any additional arguments are provided to `func` when it's invoked. @@ -3771,14 +3790,14 @@ _.defer(function(text) { }, 'deferred'); // => Logs 'deferred' after one or more milliseconds. ``` -* * * +--- ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9788 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") +[#](#_delayfunc-wait-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L9989 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") [Ⓣ][1] Invokes `func` after `wait` milliseconds. Any additional arguments are provided to `func` when it's invoked. @@ -3800,14 +3819,14 @@ _.delay(function(text) { }, 1000, 'later'); // => Logs 'later' after one second. ``` -* * * +--- ### `_.flip(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9810 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") +[#](#_flipfunc) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10011 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with arguments reversed. @@ -3828,14 +3847,14 @@ var flipped = _.flip(function() { flipped('a', 'b', 'c', 'd'); // => ['d', 'c', 'b', 'a'] ``` -* * * +--- ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9858 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") +[#](#_memoizefunc-resolver) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10059 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is provided, it determines the cache key for storing the result based on the @@ -3883,14 +3902,14 @@ values(object); // Replace `_.memoize.Cache`. _.memoize.Cache = WeakMap; ``` -* * * +--- ### `_.negate(predicate)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9901 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") +[#](#_negatepredicate) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10102 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") [Ⓣ][1] Creates a function that negates the result of the predicate `func`. The `func` predicate is invoked with the `this` binding and arguments of the @@ -3913,14 +3932,14 @@ function isEven(n) { _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5] ``` -* * * +--- ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9928 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") +[#](#_oncefunc) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10136 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") [Ⓣ][1] Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first invocation. The `func` is @@ -3939,24 +3958,24 @@ invoked with the `this` binding and arguments of the created function. var initialize = _.once(createApplication); initialize(); initialize(); -// `initialize` invokes `createApplication` once +// => `createApplication` is invoked once ``` -* * * +--- -### `_.overArgs(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L9964 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") +### `_.overArgs(func, [transforms=[_.identity]])` +[#](#_overargsfunc-transforms_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10171 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") [Ⓣ][1] -Creates a function that invokes `func` with arguments transformed by -corresponding `transforms`. +Creates a function that invokes `func` with its arguments transformed. #### Since 4.0.0 #### Arguments 1. `func` *(Function)*: The function to wrap. +2. `[transforms=[_.identity]]` *(...(Function|Function[]))*: The argument transforms. #### Returns *(Function)*: Returns the new function. @@ -3981,14 +4000,14 @@ func(9, 3); func(10, 5); // => [100, 10] ``` -* * * +--- ### `_.partial(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10014 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") +[#](#_partialfunc-partials) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10221 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with `partials` prepended to the arguments it receives. This method is like `_.bind` except it does **not** @@ -4013,9 +4032,9 @@ applied functions. #### Example ```js -var greet = function(greeting, name) { +function greet(greeting, name) { return greeting + ' ' + name; -}; +} var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); @@ -4026,14 +4045,14 @@ var greetFred = _.partial(greet, _, 'fred'); greetFred('hi'); // => 'hi fred' ``` -* * * +--- ### `_.partialRight(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10051 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") +[#](#_partialrightfunc-partials) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10258 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") [Ⓣ][1] This method is like `_.partial` except that partially applied arguments are appended to the arguments it receives. @@ -4057,9 +4076,9 @@ applied functions. #### Example ```js -var greet = function(greeting, name) { +function greet(greeting, name) { return greeting + ' ' + name; -}; +} var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); @@ -4070,14 +4089,14 @@ var sayHelloTo = _.partialRight(greet, 'hello', _); sayHelloTo('fred'); // => 'hello fred' ``` -* * * +--- ### `_.rearg(func, indexes)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10078 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") +[#](#_reargfunc-indexes) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10285 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with arguments arranged according to the specified `indexes` where the argument value at the first index is @@ -4102,14 +4121,14 @@ var rearged = _.rearg(function(a, b, c) { rearged('b', 'c', 'a') // => ['a', 'b', 'c'] ``` -* * * +--- ### `_.rest(func, [start=func.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10107 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") +[#](#_restfunc-startfunclength-1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10314 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of the created function and arguments from `start` and beyond provided as @@ -4138,14 +4157,14 @@ var say = _.rest(function(what, names) { say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, & pebbles' ``` -* * * +--- ### `_.spread(func, [start=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10170 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") +[#](#_spreadfunc-start0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10356 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of the create function and an array of arguments much like @@ -4183,14 +4202,14 @@ numbers.then(_.spread(function(x, y) { })); // => a Promise of 76 ``` -* * * +--- ### `_.throttle(func, [wait=0], [options={}], [options.leading=true], [options.trailing=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10227 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") +[#](#_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10413 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") [Ⓣ][1] Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds. The throttled function comes with a `cancel` @@ -4234,14 +4253,14 @@ jQuery(element).on('click', throttled); // Cancel the trailing throttled invocation. jQuery(window).on('popstate', throttled.cancel); ``` -* * * +--- ### `_.unary(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10260 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") +[#](#_unaryfunc) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10446 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") [Ⓣ][1] Creates a function that accepts up to one argument, ignoring any additional arguments. @@ -4259,19 +4278,19 @@ additional arguments. _.map(['6', '8', '10'], _.unary(parseInt)); // => [6, 8, 10] ``` -* * * +--- ### `_.wrap(value, [wrapper=identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10286 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") +[#](#_wrapvalue-wrapperidentity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10472 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") [Ⓣ][1] -Creates a function that provides `value` to the wrapper function as its -first argument. Any additional arguments provided to the function are -appended to those provided to the wrapper function. The wrapper is invoked -with the `this` binding of the created function. +Creates a function that provides `value` to `wrapper` as its first +argument. Any additional arguments provided to the function are appended +to those provided to the `wrapper`. The wrapper is invoked with the `this` +binding of the created function. #### Since 0.1.0 @@ -4291,7 +4310,7 @@ var p = _.wrap(_.escape, function(func, text) { p('fred, barney, & pebbles'); // => '

fred, barney, & pebbles

' ``` -* * * +--- @@ -4304,7 +4323,7 @@ p('fred, barney, & pebbles'); ### `_.castArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10326 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package") +[#](#_castarrayvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10512 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package") [Ⓣ][1] Casts `value` as an array if it's not one. @@ -4340,14 +4359,14 @@ var array = [1, 2, 3]; console.log(_.castArray(array) === array); // => true ``` -* * * +--- ### `_.clone(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") +[#](#_clonevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10546 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") [Ⓣ][1] Creates a shallow clone of `value`.
@@ -4376,14 +4395,14 @@ var shallow = _.clone(objects); console.log(shallow[0] === objects[0]); // => true ``` -* * * +--- ### `_.cloneDeep(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10417 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") +[#](#_clonedeepvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10603 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") [Ⓣ][1] This method is like `_.clone` except that it recursively clones `value`. @@ -4403,14 +4422,14 @@ var deep = _.cloneDeep(objects); console.log(deep[0] === objects[0]); // => false ``` -* * * +--- ### `_.cloneDeepWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10449 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") +[#](#_clonedeepwithvalue-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10635 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") [Ⓣ][1] This method is like `_.cloneWith` except that it recursively clones `value`. @@ -4440,14 +4459,14 @@ console.log(el.nodeName); console.log(el.childNodes.length); // => 20 ``` -* * * +--- ### `_.cloneWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10395 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") +[#](#_clonewithvalue-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10581 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") [Ⓣ][1] This method is like `_.clone` except that it accepts `customizer` which is invoked to produce the cloned value. If `customizer` returns `undefined`, @@ -4480,14 +4499,46 @@ console.log(el.nodeName); console.log(el.childNodes.length); // => 0 ``` -* * * +--- + + + + + +### `_.conformsTo(object, source)` +[#](#_conformstoobject-source) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10661 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.conformsto "See the npm package") [Ⓣ][1] + +Checks if `object` conforms to `source` by invoking the predicate properties +of `source` with the corresponding property values of `object`. This method +is equivalent to a `_.conforms` function when `source` is partially applied. + +#### Since +4.14.0 +#### Arguments +1. `object` *(Object)*: The object to inspect. +2. `source` *(Object)*: The object of property predicates to conform to. + +#### Returns +*(boolean)*: Returns `true` if `object` conforms, else `false`. + +#### Example +```js +var object = { 'a': 1, 'b': 2 }; + +_.conformsTo(object, { 'b': function(n) { return n > 1; } }); +// => true + +_.conformsTo(object, { 'b': function(n) { return n > 2; } }); +// => false +``` +--- ### `_.eq(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10485 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") +[#](#_eqvalue-other) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10697 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") [Ⓣ][1] Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -4504,8 +4555,8 @@ comparison between two values to determine if they are equivalent. #### Example ```js -var object = { 'user': 'fred' }; -var other = { 'user': 'fred' }; +var object = { 'a': 1 }; +var other = { 'a': 1 }; _.eq(object, object); // => true @@ -4522,14 +4573,14 @@ _.eq('a', Object('a')); _.eq(NaN, NaN); // => true ``` -* * * +--- ### `_.gt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10512 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") +[#](#_gtvalue-other) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10724 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") [Ⓣ][1] Checks if `value` is greater than `other`. @@ -4553,14 +4604,14 @@ _.gt(3, 3); _.gt(1, 3); // => false ``` -* * * +--- ### `_.gte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10537 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") +[#](#_gtevalue-other) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10749 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") [Ⓣ][1] Checks if `value` is greater than or equal to `other`. @@ -4584,14 +4635,14 @@ _.gte(3, 3); _.gte(1, 3); // => false ``` -* * * +--- ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10559 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") +[#](#_isargumentsvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10771 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") [Ⓣ][1] Checks if `value` is likely an `arguments` object. @@ -4601,7 +4652,7 @@ Checks if `value` is likely an `arguments` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is an `arguments` object, else `false`. #### Example ```js @@ -4611,14 +4662,14 @@ _.isArguments(function() { return arguments; }()); _.isArguments([1, 2, 3]); // => false ``` -* * * +--- ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10590 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") +[#](#_isarrayvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10800 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") [Ⓣ][1] Checks if `value` is classified as an `Array` object. @@ -4628,7 +4679,7 @@ Checks if `value` is classified as an `Array` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is an array, else `false`. #### Example ```js @@ -4644,14 +4695,14 @@ _.isArray('abc'); _.isArray(_.noop); // => false ``` -* * * +--- ### `_.isArrayBuffer(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10610 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package") +[#](#_isarraybuffervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10819 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package") [Ⓣ][1] Checks if `value` is classified as an `ArrayBuffer` object. @@ -4661,7 +4712,7 @@ Checks if `value` is classified as an `ArrayBuffer` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is an array buffer, else `false`. #### Example ```js @@ -4671,14 +4722,14 @@ _.isArrayBuffer(new ArrayBuffer(2)); _.isArrayBuffer(new Array(2)); // => false ``` -* * * +--- ### `_.isArrayLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10639 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") +[#](#_isarraylikevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10846 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") [Ⓣ][1] Checks if `value` is array-like. A value is considered array-like if it's not a function and has a `value.length` that's an integer greater than or @@ -4706,14 +4757,14 @@ _.isArrayLike('abc'); _.isArrayLike(_.noop); // => false ``` -* * * +--- ### `_.isArrayLikeObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10668 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") +[#](#_isarraylikeobjectvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10875 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") [Ⓣ][1] This method is like `_.isArrayLike` except that it also checks if `value` is an object. @@ -4740,14 +4791,14 @@ _.isArrayLikeObject('abc'); _.isArrayLikeObject(_.noop); // => false ``` -* * * +--- ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10690 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") +[#](#_isbooleanvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10896 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") [Ⓣ][1] Checks if `value` is classified as a boolean primitive or object. @@ -4757,7 +4808,7 @@ Checks if `value` is classified as a boolean primitive or object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a boolean, else `false`. #### Example ```js @@ -4767,14 +4818,14 @@ _.isBoolean(false); _.isBoolean(null); // => false ``` -* * * +--- ### `_.isBuffer(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10712 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package") +[#](#_isbuffervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10918 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package") [Ⓣ][1] Checks if `value` is a buffer. @@ -4794,14 +4845,14 @@ _.isBuffer(new Buffer(2)); _.isBuffer(new Uint8Array(2)); // => false ``` -* * * +--- ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10734 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") +[#](#_isdatevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10937 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Date` object. @@ -4811,7 +4862,7 @@ Checks if `value` is classified as a `Date` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a date object, else `false`. #### Example ```js @@ -4821,14 +4872,14 @@ _.isDate(new Date); _.isDate('Mon April 23 2012'); // => false ``` -* * * +--- ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10756 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") +[#](#_iselementvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10957 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") [Ⓣ][1] Checks if `value` is likely a DOM element. @@ -4848,14 +4899,14 @@ _.isElement(document.body); _.isElement(''); // => false ``` -* * * +--- ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") +[#](#_isemptyvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L10994 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") [Ⓣ][1] Checks if `value` is an empty object, collection, map, or set.
@@ -4893,14 +4944,14 @@ _.isEmpty([1, 2, 3]); _.isEmpty({ 'a': 1 }); // => false ``` -* * * +--- ### `_.isEqual(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10842 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") +[#](#_isequalvalue-other) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11043 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent. @@ -4923,8 +4974,8 @@ nodes are **not** supported. #### Example ```js -var object = { 'user': 'fred' }; -var other = { 'user': 'fred' }; +var object = { 'a': 1 }; +var other = { 'a': 1 }; _.isEqual(object, other); // => true @@ -4932,14 +4983,14 @@ _.isEqual(object, other); object === other; // => false ``` -* * * +--- ### `_.isEqualWith(value, other, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10879 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") +[#](#_isequalwithvalue-other-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11080 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") [Ⓣ][1] This method is like `_.isEqual` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined`, comparisons @@ -4974,14 +5025,14 @@ var other = ['hi', 'goodbye']; _.isEqualWith(array, other, customizer); // => true ``` -* * * +--- ### `_.isError(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10904 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") +[#](#_iserrorvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11105 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") [Ⓣ][1] Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object. @@ -5002,14 +5053,14 @@ _.isError(new Error); _.isError(Error); // => false ``` -* * * +--- ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10939 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") +[#](#_isfinitevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11140 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") [Ⓣ][1] Checks if `value` is a finite primitive number.
@@ -5039,14 +5090,14 @@ _.isFinite(Infinity); _.isFinite('3'); // => false ``` -* * * +--- ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10961 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") +[#](#_isfunctionvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11161 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Function` object. @@ -5056,7 +5107,7 @@ Checks if `value` is classified as a `Function` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a function, else `false`. #### Example ```js @@ -5066,14 +5117,14 @@ _.isFunction(_); _.isFunction(/abc/); // => false ``` -* * * +--- ### `_.isInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L10995 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") +[#](#_isintegervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11195 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") [Ⓣ][1] Checks if `value` is an integer.
@@ -5103,14 +5154,14 @@ _.isInteger(Infinity); _.isInteger('3'); // => false ``` -* * * +--- ### `_.isLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11026 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") +[#](#_islengthvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11226 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") [Ⓣ][1] Checks if `value` is a valid array-like length.
@@ -5140,14 +5191,14 @@ _.isLength(Infinity); _.isLength('3'); // => false ``` -* * * +--- ### `_.isMap(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11107 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package") +[#](#_ismapvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11306 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Map` object. @@ -5157,7 +5208,7 @@ Checks if `value` is classified as a `Map` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a map, else `false`. #### Example ```js @@ -5167,14 +5218,14 @@ _.isMap(new Map); _.isMap(new WeakMap); // => false ``` -* * * +--- ### `_.isMatch(object, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11135 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") +[#](#_ismatchobject-source) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11332 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") [Ⓣ][1] Performs a partial deep comparison between `object` and `source` to determine if `object` contains equivalent property values. This method is @@ -5194,22 +5245,22 @@ equivalent to a `_.matches` function when `source` is partially applied. #### Example ```js -var object = { 'user': 'fred', 'age': 40 }; +var object = { 'a': 1, 'b': 2 }; -_.isMatch(object, { 'age': 40 }); +_.isMatch(object, { 'b': 2 }); // => true -_.isMatch(object, { 'age': 36 }); +_.isMatch(object, { 'b': 1 }); // => false ``` -* * * +--- ### `_.isMatchWith(object, source, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11171 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") +[#](#_ismatchwithobject-source-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11368 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") [Ⓣ][1] This method is like `_.isMatch` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined`, comparisons @@ -5244,14 +5295,14 @@ var source = { 'greeting': 'hi' }; _.isMatchWith(object, source, customizer); // => true ``` -* * * +--- ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11204 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") +[#](#_isnanvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11401 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") [Ⓣ][1] Checks if `value` is `NaN`.
@@ -5283,25 +5334,25 @@ isNaN(undefined); _.isNaN(undefined); // => false ``` -* * * +--- ### `_.isNative(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11237 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") +[#](#_isnativevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11434 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") [Ⓣ][1] Checks if `value` is a pristine native function.

-**Note:** This method can't reliably detect native functions in the -presence of the `core-js` package because `core-js` circumvents this kind -of detection. Despite multiple requests, the `core-js` maintainer has made -it clear: any attempt to fix the detection will be obstructed. As a result, -we're left with little choice but to throw an error. Unfortunately, this -also affects packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), -which rely on `core-js`. +**Note:** This method can't reliably detect native functions in the presence +of the core-js package because core-js circumvents this kind of detection. +Despite multiple requests, the core-js maintainer has made it clear: any +attempt to fix the detection will be obstructed. As a result, we're left +with little choice but to throw an error. Unfortunately, this also affects +packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), +which rely on core-js. #### Since 3.0.0 @@ -5319,14 +5370,14 @@ _.isNative(Array.prototype.push); _.isNative(_); // => false ``` -* * * +--- ### `_.isNil(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11285 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") +[#](#_isnilvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11482 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") [Ⓣ][1] Checks if `value` is `null` or `undefined`. @@ -5349,14 +5400,14 @@ _.isNil(void 0); _.isNil(NaN); // => false ``` -* * * +--- ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11261 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") +[#](#_isnullvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11458 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") [Ⓣ][1] Checks if `value` is `null`. @@ -5376,14 +5427,14 @@ _.isNull(null); _.isNull(void 0); // => false ``` -* * * +--- ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11316 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") +[#](#_isnumbervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11512 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Number` primitive or object.
@@ -5397,7 +5448,7 @@ classified as numbers, use the `_.isFinite` method. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a number, else `false`. #### Example ```js @@ -5413,14 +5464,14 @@ _.isNumber(Infinity); _.isNumber('3'); // => false ``` -* * * +--- ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11056 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") +[#](#_isobjectvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11256 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") [Ⓣ][1] Checks if `value` is the [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) @@ -5448,14 +5499,14 @@ _.isObject(_.noop); _.isObject(null); // => false ``` -* * * +--- ### `_.isObjectLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11085 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") +[#](#_isobjectlikevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11285 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") [Ⓣ][1] Checks if `value` is object-like. A value is object-like if it's not `null` and has a `typeof` result of "object". @@ -5482,14 +5533,14 @@ _.isObjectLike(_.noop); _.isObjectLike(null); // => false ``` -* * * +--- ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11350 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") +[#](#_isplainobjectvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11546 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") [Ⓣ][1] Checks if `value` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`. @@ -5520,14 +5571,14 @@ _.isPlainObject({ 'x': 0, 'y': 0 }); _.isPlainObject(Object.create(null)); // => true ``` -* * * +--- ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11382 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") +[#](#_isregexpvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11577 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `RegExp` object. @@ -5537,7 +5588,7 @@ Checks if `value` is classified as a `RegExp` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a regexp, else `false`. #### Example ```js @@ -5547,14 +5598,14 @@ _.isRegExp(/abc/); _.isRegExp('/abc/'); // => false ``` -* * * +--- ### `_.isSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11414 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") +[#](#_issafeintegervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11607 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") [Ⓣ][1] Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer. @@ -5585,14 +5636,14 @@ _.isSafeInteger(Infinity); _.isSafeInteger('3'); // => false ``` -* * * +--- ### `_.isSet(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11436 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package") +[#](#_issetvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11628 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Set` object. @@ -5602,7 +5653,7 @@ Checks if `value` is classified as a `Set` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a set, else `false`. #### Example ```js @@ -5612,14 +5663,14 @@ _.isSet(new Set); _.isSet(new WeakSet); // => false ``` -* * * +--- ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11458 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") +[#](#_isstringvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11647 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `String` primitive or object. @@ -5629,7 +5680,7 @@ Checks if `value` is classified as a `String` primitive or object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a string, else `false`. #### Example ```js @@ -5639,14 +5690,14 @@ _.isString('abc'); _.isString(1); // => false ``` -* * * +--- ### `_.isSymbol(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11481 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") +[#](#_issymbolvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11669 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Symbol` primitive or object. @@ -5656,7 +5707,7 @@ Checks if `value` is classified as a `Symbol` primitive or object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a symbol, else `false`. #### Example ```js @@ -5666,14 +5717,14 @@ _.isSymbol(Symbol.iterator); _.isSymbol('abc'); // => false ``` -* * * +--- ### `_.isTypedArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11504 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") +[#](#_istypedarrayvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11691 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") [Ⓣ][1] Checks if `value` is classified as a typed array. @@ -5683,7 +5734,7 @@ Checks if `value` is classified as a typed array. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a typed array, else `false`. #### Example ```js @@ -5693,14 +5744,14 @@ _.isTypedArray(new Uint8Array); _.isTypedArray([]); // => false ``` -* * * +--- ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11526 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") +[#](#_isundefinedvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11710 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") [Ⓣ][1] Checks if `value` is `undefined`. @@ -5720,14 +5771,14 @@ _.isUndefined(void 0); _.isUndefined(null); // => false ``` -* * * +--- ### `_.isWeakMap(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11548 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package") +[#](#_isweakmapvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11731 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `WeakMap` object. @@ -5737,7 +5788,7 @@ Checks if `value` is classified as a `WeakMap` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a weak map, else `false`. #### Example ```js @@ -5747,14 +5798,14 @@ _.isWeakMap(new WeakMap); _.isWeakMap(new Map); // => false ``` -* * * +--- ### `_.isWeakSet(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11570 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package") +[#](#_isweaksetvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11752 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `WeakSet` object. @@ -5764,7 +5815,7 @@ Checks if `value` is classified as a `WeakSet` object. 1. `value` *(*)*: The value to check. #### Returns -*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. +*(boolean)*: Returns `true` if `value` is a weak set, else `false`. #### Example ```js @@ -5774,14 +5825,14 @@ _.isWeakSet(new WeakSet); _.isWeakSet(new Set); // => false ``` -* * * +--- ### `_.lt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11597 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") +[#](#_ltvalue-other) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11779 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") [Ⓣ][1] Checks if `value` is less than `other`. @@ -5805,14 +5856,14 @@ _.lt(3, 3); _.lt(3, 1); // => false ``` -* * * +--- ### `_.lte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11622 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") +[#](#_ltevalue-other) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11804 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") [Ⓣ][1] Checks if `value` is less than or equal to `other`. @@ -5836,14 +5887,14 @@ _.lte(3, 3); _.lte(3, 1); // => false ``` -* * * +--- ### `_.toArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") +[#](#_toarrayvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11831 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") [Ⓣ][1] Converts `value` to an array. @@ -5869,14 +5920,14 @@ _.toArray(1); _.toArray(null); // => [] ``` -* * * +--- ### `_.toFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11688 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tofinite "See the npm package") +[#](#_tofinitevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11870 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tofinite "See the npm package") [Ⓣ][1] Converts `value` to a finite number. @@ -5902,14 +5953,14 @@ _.toFinite(Infinity); _.toFinite('3.2'); // => 3.2 ``` -* * * +--- ### `_.toInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11726 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") +[#](#_tointegervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11908 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") [Ⓣ][1] Converts `value` to an integer.
@@ -5939,14 +5990,14 @@ _.toInteger(Infinity); _.toInteger('3.2'); // => 3 ``` -* * * +--- ### `_.toLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11760 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") +[#](#_tolengthvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11942 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") [Ⓣ][1] Converts `value` to an integer suitable for use as the length of an array-like object. @@ -5977,14 +6028,14 @@ _.toLength(Infinity); _.toLength('3.2'); // => 3 ``` -* * * +--- ### `_.toNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11787 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") +[#](#_tonumbervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L11969 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") [Ⓣ][1] Converts `value` to a number. @@ -6010,14 +6061,14 @@ _.toNumber(Infinity); _.toNumber('3.2'); // => 3.2 ``` -* * * +--- ### `_.toPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11832 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") +[#](#_toplainobjectvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12014 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") [Ⓣ][1] Converts `value` to a plain object flattening inherited enumerable string keyed properties of `value` to own properties of the plain object. @@ -6044,14 +6095,14 @@ _.assign({ 'a': 1 }, new Foo); _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c': 3 } ``` -* * * +--- ### `_.toSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11860 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") +[#](#_tosafeintegervalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12042 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") [Ⓣ][1] Converts `value` to a safe integer. A safe integer can be compared and represented correctly. @@ -6078,14 +6129,14 @@ _.toSafeInteger(Infinity); _.toSafeInteger('3.2'); // => 3 ``` -* * * +--- ### `_.toString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11885 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") +[#](#_tostringvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12067 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") [Ⓣ][1] Converts `value` to a string. An empty string is returned for `null` and `undefined` values. The sign of `-0` is preserved. @@ -6109,7 +6160,7 @@ _.toString(-0); _.toString([1, 2, 3]); // => '1,2,3' ``` -* * * +--- @@ -6122,7 +6173,7 @@ _.toString([1, 2, 3]); ### `_.add(augend, addend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15481 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") +[#](#_addaugend-addend) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15671 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") [Ⓣ][1] Adds two numbers. @@ -6140,14 +6191,14 @@ Adds two numbers. _.add(6, 4); // => 10 ``` -* * * +--- ### `_.ceil(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15506 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") +[#](#_ceilnumber-precision0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15696 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") [Ⓣ][1] Computes `number` rounded up to `precision`. @@ -6171,14 +6222,14 @@ _.ceil(6.004, 2); _.ceil(6040, -2); // => 6100 ``` -* * * +--- ### `_.divide(dividend, divisor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15523 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.divide "See the npm package") +[#](#_dividedividend-divisor) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15713 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.divide "See the npm package") [Ⓣ][1] Divide two numbers. @@ -6196,14 +6247,14 @@ Divide two numbers. _.divide(6, 4); // => 1.5 ``` -* * * +--- ### `_.floor(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15548 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") +[#](#_floornumber-precision0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15738 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") [Ⓣ][1] Computes `number` rounded down to `precision`. @@ -6227,14 +6278,14 @@ _.floor(0.046, 2); _.floor(4060, -2); // => 4000 ``` -* * * +--- ### `_.max(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15568 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") +[#](#_maxarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15758 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") [Ⓣ][1] Computes the maximum value of `array`. If `array` is empty or falsey, `undefined` is returned. @@ -6255,14 +6306,14 @@ _.max([4, 2, 8, 6]); _.max([]); // => undefined ``` -* * * +--- ### `_.maxBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15598 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") +[#](#_maxbyarray-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15787 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") [Ⓣ][1] This method is like `_.max` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -6272,7 +6323,7 @@ the value is ranked. The iteratee is invoked with one argument: *(value)*. 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(*)*: Returns the maximum value. @@ -6288,14 +6339,14 @@ _.maxBy(objects, function(o) { return o.n; }); _.maxBy(objects, 'n'); // => { 'n': 2 } ``` -* * * +--- ### `_.mean(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15618 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") +[#](#_meanarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15807 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") [Ⓣ][1] Computes the mean of the values in `array`. @@ -6312,14 +6363,14 @@ Computes the mean of the values in `array`. _.mean([4, 2, 8, 6]); // => 5 ``` -* * * +--- ### `_.meanBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15646 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.meanby "See the npm package") +[#](#_meanbyarray-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15834 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.meanby "See the npm package") [Ⓣ][1] This method is like `_.mean` except that it accepts `iteratee` which is invoked for each element in `array` to generate the value to be averaged. @@ -6329,7 +6380,7 @@ The iteratee is invoked with one argument: *(value)*. 4.7.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the mean. @@ -6345,14 +6396,14 @@ _.meanBy(objects, function(o) { return o.n; }); _.meanBy(objects, 'n'); // => 5 ``` -* * * +--- ### `_.min(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15668 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") +[#](#_minarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15856 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") [Ⓣ][1] Computes the minimum value of `array`. If `array` is empty or falsey, `undefined` is returned. @@ -6373,14 +6424,14 @@ _.min([4, 2, 8, 6]); _.min([]); // => undefined ``` -* * * +--- ### `_.minBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") +[#](#_minbyarray-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15885 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") [Ⓣ][1] This method is like `_.min` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -6390,7 +6441,7 @@ the value is ranked. The iteratee is invoked with one argument: *(value)*. 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(*)*: Returns the minimum value. @@ -6406,14 +6457,14 @@ _.minBy(objects, function(o) { return o.n; }); _.minBy(objects, 'n'); // => { 'n': 1 } ``` -* * * +--- ### `_.multiply(multiplier, multiplicand)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15719 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.multiply "See the npm package") +[#](#_multiplymultiplier-multiplicand) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15906 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.multiply "See the npm package") [Ⓣ][1] Multiply two numbers. @@ -6431,14 +6482,14 @@ Multiply two numbers. _.multiply(6, 4); // => 24 ``` -* * * +--- ### `_.round(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") +[#](#_roundnumber-precision0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15931 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") [Ⓣ][1] Computes `number` rounded to `precision`. @@ -6462,14 +6513,14 @@ _.round(4.006, 2); _.round(4060, -2); // => 4100 ``` -* * * +--- ### `_.subtract(minuend, subtrahend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15761 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") +[#](#_subtractminuend-subtrahend) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15948 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") [Ⓣ][1] Subtract two numbers. @@ -6487,14 +6538,14 @@ Subtract two numbers. _.subtract(6, 4); // => 2 ``` -* * * +--- ### `_.sum(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15779 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") +[#](#_sumarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15966 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") [Ⓣ][1] Computes the sum of the values in `array`. @@ -6511,14 +6562,14 @@ Computes the sum of the values in `array`. _.sum([4, 2, 8, 6]); // => 20 ``` -* * * +--- ### `_.sumBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15809 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") +[#](#_sumbyarray-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15995 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") [Ⓣ][1] This method is like `_.sum` except that it accepts `iteratee` which is invoked for each element in `array` to generate the value to be summed. @@ -6528,7 +6579,7 @@ The iteratee is invoked with one argument: *(value)*. 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the sum. @@ -6544,7 +6595,7 @@ _.sumBy(objects, function(o) { return o.n; }); _.sumBy(objects, 'n'); // => 20 ``` -* * * +--- @@ -6557,7 +6608,7 @@ _.sumBy(objects, 'n'); ### `_.clamp(number, [lower], upper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13306 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") +[#](#_clampnumber-lower-upper) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13470 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") [Ⓣ][1] Clamps `number` within the inclusive `lower` and `upper` bounds. @@ -6579,14 +6630,14 @@ _.clamp(-10, -5, 5); _.clamp(10, -5, 5); // => 5 ``` -* * * +--- ### `_.inRange(number, [start=0], end)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") +[#](#_inrangenumber-start0-end) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13524 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") [Ⓣ][1] Checks if `n` is between `start` and up to, but not including, `end`. If `end` is not specified, it's set to `start` with `start` then set to `0`. @@ -6626,14 +6677,14 @@ _.inRange(5.2, 4); _.inRange(-3, -2, -6); // => true ``` -* * * +--- ### `_.random([lower=0], [upper=1], [floating])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13403 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") +[#](#_randomlower0-upper1-floating) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13567 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") [Ⓣ][1] Produces a random number between the inclusive `lower` and `upper` bounds. If only one argument is provided a number between `0` and the given number @@ -6668,7 +6719,7 @@ _.random(5, true); _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2 ``` -* * * +--- @@ -6681,7 +6732,7 @@ _.random(1.2, 5.2); ### `_.assign(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11923 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") +[#](#_assignobject-sources) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12105 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") [Ⓣ][1] Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. @@ -6703,27 +6754,27 @@ Subsequent sources overwrite property assignments of previous sources. #### Example ```js function Foo() { - this.c = 3; + this.a = 1; } function Bar() { - this.e = 5; + this.c = 3; } -Foo.prototype.d = 4; -Bar.prototype.f = 6; +Foo.prototype.b = 2; +Bar.prototype.d = 4; -_.assign({ 'a': 1 }, new Foo, new Bar); -// => { 'a': 1, 'c': 3, 'e': 5 } +_.assign({ 'a': 0 }, new Foo, new Bar); +// => { 'a': 1, 'c': 3 } ``` -* * * +--- ### `_.assignIn(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L11966 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") +[#](#_assigninobject-sources) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12148 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") [Ⓣ][1] This method is like `_.assign` except that it iterates over own and inherited source properties. @@ -6746,27 +6797,27 @@ inherited source properties. #### Example ```js function Foo() { - this.b = 2; + this.a = 1; } function Bar() { - this.d = 4; + this.c = 3; } -Foo.prototype.c = 3; -Bar.prototype.e = 5; +Foo.prototype.b = 2; +Bar.prototype.d = 4; -_.assignIn({ 'a': 1 }, new Foo, new Bar); -// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } +_.assignIn({ 'a': 0 }, new Foo, new Bar); +// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } ``` -* * * +--- ### `_.assignInWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12005 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") +[#](#_assigninwithobject-sources-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12187 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") [Ⓣ][1] This method is like `_.assignIn` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns @@ -6800,14 +6851,14 @@ var defaults = _.partialRight(_.assignInWith, customizer); defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); // => { 'a': 1, 'b': 2 } ``` -* * * +--- ### `_.assignWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12037 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") +[#](#_assignwithobject-sources-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12219 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") [Ⓣ][1] This method is like `_.assign` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns @@ -6838,14 +6889,14 @@ var defaults = _.partialRight(_.assignWith, customizer); defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); // => { 'a': 1, 'b': 2 } ``` -* * * +--- ### `_.at(object, [paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12058 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") +[#](#_atobject-paths) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12240 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") [Ⓣ][1] Creates an array of values corresponding to `paths` of `object`. @@ -6865,14 +6916,14 @@ var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; _.at(object, ['a[0].b.c', 'a[1]']); // => [3, 4] ``` -* * * +--- ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12096 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") +[#](#_createprototype-properties) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12278 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") [Ⓣ][1] Creates an object that inherits from the `prototype` object. If a `properties` object is given, its own enumerable string keyed properties @@ -6909,14 +6960,14 @@ circle instanceof Circle; circle instanceof Shape; // => true ``` -* * * +--- ### `_.defaults(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12122 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") +[#](#_defaultsobject-sources) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12304 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") [Ⓣ][1] Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that @@ -6937,17 +6988,17 @@ Once a property is set, additional values of the same property are ignored. #### Example ```js -_.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); -// => { 'user': 'barney', 'age': 36 } +_.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); +// => { 'a': 1, 'b': 2 } ``` -* * * +--- ### `_.defaultsDeep(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12147 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") +[#](#_defaultsdeepobject-sources) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12328 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") [Ⓣ][1] This method is like `_.defaults` except that it recursively assigns default properties. @@ -6966,17 +7017,17 @@ default properties. #### Example ```js -_.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); -// => { 'user': { 'name': 'barney', 'age': 36 } } +_.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); +// => { 'a': { 'b': 2, 'c': 3 } } ``` -* * * +--- ### `_.findKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12188 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") +[#](#_findkeyobject-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12368 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") [Ⓣ][1] This method is like `_.find` except that it returns the key of the first element `predicate` returns truthy for instead of the element itself. @@ -6985,7 +7036,7 @@ element `predicate` returns truthy for instead of the element itself. 1.1.0 #### Arguments 1. `object` *(Object)*: The object to search. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(*)*: Returns the key of the matched element, else `undefined`. @@ -7013,14 +7064,14 @@ _.findKey(users, ['active', false]); _.findKey(users, 'active'); // => 'barney' ``` -* * * +--- ### `_.findLastKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12228 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") +[#](#_findlastkeyobject-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12407 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") [Ⓣ][1] This method is like `_.findKey` except that it iterates over elements of a collection in the opposite order. @@ -7029,7 +7080,7 @@ a collection in the opposite order. 2.0.0 #### Arguments 1. `object` *(Object)*: The object to search. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(*)*: Returns the key of the matched element, else `undefined`. @@ -7057,14 +7108,14 @@ _.findLastKey(users, ['active', false]); _.findLastKey(users, 'active'); // => 'pebbles' ``` -* * * +--- ### `_.forIn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12260 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") +[#](#_forinobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12439 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") [Ⓣ][1] Iterates over own and inherited enumerable string keyed properties of an object and invokes `iteratee` for each property. The iteratee is invoked @@ -7094,14 +7145,14 @@ _.forIn(new Foo, function(value, key) { }); // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). ``` -* * * +--- ### `_.forInRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12292 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") +[#](#_forinrightobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12471 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") [Ⓣ][1] This method is like `_.forIn` except that it iterates over properties of `object` in the opposite order. @@ -7129,14 +7180,14 @@ _.forInRight(new Foo, function(value, key) { }); // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. ``` -* * * +--- ### `_.forOwn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12326 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") +[#](#_forownobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12505 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") [Ⓣ][1] Iterates over own enumerable string keyed properties of an object and invokes `iteratee` for each property. The iteratee is invoked with three @@ -7166,14 +7217,14 @@ _.forOwn(new Foo, function(value, key) { }); // => Logs 'a' then 'b' (iteration order is not guaranteed). ``` -* * * +--- ### `_.forOwnRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12356 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") +[#](#_forownrightobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12535 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") [Ⓣ][1] This method is like `_.forOwn` except that it iterates over properties of `object` in the opposite order. @@ -7201,14 +7252,14 @@ _.forOwnRight(new Foo, function(value, key) { }); // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. ``` -* * * +--- ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12383 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") +[#](#_functionsobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12562 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") [Ⓣ][1] Creates an array of function property names from own enumerable properties of `object`. @@ -7233,14 +7284,14 @@ Foo.prototype.c = _.constant('c'); _.functions(new Foo); // => ['a', 'b'] ``` -* * * +--- ### `_.functionsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12410 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") +[#](#_functionsinobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12589 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") [Ⓣ][1] Creates an array of function property names from own and inherited enumerable properties of `object`. @@ -7265,17 +7316,17 @@ Foo.prototype.c = _.constant('c'); _.functionsIn(new Foo); // => ['a', 'b', 'c'] ``` -* * * +--- ### `_.get(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12439 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") +[#](#_getobject-path-defaultvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12618 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") [Ⓣ][1] Gets the value at `path` of `object`. If the resolved value is -`undefined`, the `defaultValue` is used in its place. +`undefined`, the `defaultValue` is returned in its place. #### Since 3.7.0 @@ -7300,14 +7351,14 @@ _.get(object, ['a', '0', 'b', 'c']); _.get(object, 'a.b.c', 'default'); // => 'default' ``` -* * * +--- ### `_.has(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12471 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") +[#](#_hasobject-path) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12650 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") [Ⓣ][1] Checks if `path` is a direct property of `object`. @@ -7337,14 +7388,14 @@ _.has(object, ['a', 'b']); _.has(other, 'a'); // => false ``` -* * * +--- ### `_.hasIn(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12501 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") +[#](#_hasinobject-path) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12680 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") [Ⓣ][1] Checks if `path` is a direct or inherited property of `object`. @@ -7373,14 +7424,14 @@ _.hasIn(object, ['a', 'b']); _.hasIn(object, 'b'); // => false ``` -* * * +--- ### `_.invert(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12523 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") +[#](#_invertobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12702 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") [Ⓣ][1] Creates an object composed of the inverted keys and values of `object`. If `object` contains duplicate values, subsequent values overwrite @@ -7401,14 +7452,14 @@ var object = { 'a': 1, 'b': 2, 'c': 1 }; _.invert(object); // => { '1': 'c', '2': 'b' } ``` -* * * +--- ### `_.invertBy(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12554 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") +[#](#_invertbyobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12732 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") [Ⓣ][1] This method is like `_.invert` except that the inverted object is generated from the results of running each element of `object` thru `iteratee`. The @@ -7420,7 +7471,7 @@ with one argument: *(value)*. 4.1.0 #### Arguments 1. `object` *(Object)*: The object to invert. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Object)*: Returns the new inverted object. @@ -7437,14 +7488,14 @@ _.invertBy(object, function(value) { }); // => { 'group1': ['a', 'c'], 'group2': ['b'] } ``` -* * * +--- ### `_.invoke(object, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") +[#](#_invokeobject-path-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12758 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") [Ⓣ][1] Invokes the method at `path` of `object`. @@ -7465,14 +7516,14 @@ var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; _.invoke(object, 'a[0].b.c.slice', 1, 3); // => [2, 3] ``` -* * * +--- ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12610 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") +[#](#_keysobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12788 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") [Ⓣ][1] Creates an array of the own enumerable property names of `object`.
@@ -7504,14 +7555,14 @@ _.keys(new Foo); _.keys('hi'); // => ['0', '1'] ``` -* * * +--- ### `_.keysIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12653 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") +[#](#_keysinobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12831 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") [Ⓣ][1] Creates an array of the own and inherited enumerable property names of `object`.
@@ -7538,14 +7589,14 @@ Foo.prototype.c = 3; _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed) ``` -* * * +--- ### `_.mapKeys(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12695 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") +[#](#_mapkeysobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12872 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") [Ⓣ][1] The opposite of `_.mapValues`; this method creates an object with the same values as `object` and keys generated by running each own enumerable @@ -7556,7 +7607,7 @@ with three arguments: *(value, key, object)*. 3.8.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns the new mapped object. @@ -7568,14 +7619,14 @@ _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { }); // => { 'a1': 1, 'b2': 2 } ``` -* * * +--- ### `_.mapValues(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12734 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") +[#](#_mapvaluesobject-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12910 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") [Ⓣ][1] Creates an object with the same keys as `object` and values generated by running each own enumerable string keyed property of `object` thru @@ -7586,7 +7637,7 @@ by running each own enumerable string keyed property of `object` thru 2.4.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. -2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration. +2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns the new mapped object. @@ -7605,14 +7656,14 @@ _.mapValues(users, function(o) { return o.age; }); _.mapValues(users, 'age'); // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) ``` -* * * +--- ### `_.merge(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12775 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") +[#](#_mergeobject-sources) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12951 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") [Ⓣ][1] This method is like `_.assign` except that it recursively merges own and inherited enumerable string keyed properties of source objects into the @@ -7636,25 +7687,25 @@ sources overwrite property assignments of previous sources. #### Example ```js -var users = { - 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] +var object = { + 'a': [{ 'b': 2 }, { 'd': 4 }] }; -var ages = { - 'data': [{ 'age': 36 }, { 'age': 40 }] +var other = { + 'a': [{ 'c': 3 }, { 'e': 5 }] }; -_.merge(users, ages); -// => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } +_.merge(object, other); +// => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } ``` -* * * +--- ### `_.mergeWith(object, sources, customizer)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12817 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") +[#](#_mergewithobject-sources-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L12986 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") [Ⓣ][1] This method is like `_.merge` except that it accepts `customizer` which is invoked to produce the merged values of the destination and source @@ -7683,27 +7734,20 @@ function customizer(objValue, srcValue) { } } -var object = { - 'fruits': ['apple'], - 'vegetables': ['beet'] -}; - -var other = { - 'fruits': ['banana'], - 'vegetables': ['carrot'] -}; +var object = { 'a': [1], 'b': [2] }; +var other = { 'a': [3], 'b': [4] }; _.mergeWith(object, other, customizer); -// => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } +// => { 'a': [1, 3], 'b': [2, 4] } ``` -* * * +--- ### `_.omit(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12840 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") +[#](#_omitobject-props) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13009 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") [Ⓣ][1] The opposite of `_.pick`; this method creates an object composed of the own and inherited enumerable string keyed properties of `object` that are @@ -7725,14 +7769,14 @@ var object = { 'a': 1, 'b': '2', 'c': 3 }; _.omit(object, ['a', 'c']); // => { 'b': '2' } ``` -* * * +--- ### `_.omitBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12869 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") +[#](#_omitbyobject-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13037 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") [Ⓣ][1] The opposite of `_.pickBy`; this method creates an object composed of the own and inherited enumerable string keyed properties of `object` that @@ -7743,7 +7787,7 @@ arguments: *(value, key)*. 4.0.0 #### Arguments 1. `object` *(Object)*: The source object. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property. +2. `[predicate=_.identity]` *(Function)*: The function invoked per property. #### Returns *(Object)*: Returns the new object. @@ -7755,14 +7799,14 @@ var object = { 'a': 1, 'b': '2', 'c': 3 }; _.omitBy(object, _.isNumber); // => { 'b': '2' } ``` -* * * +--- ### `_.pick(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12893 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") +[#](#_pickobject-props) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13058 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") [Ⓣ][1] Creates an object composed of the picked `object` properties. @@ -7782,14 +7826,14 @@ var object = { 'a': 1, 'b': '2', 'c': 3 }; _.pick(object, ['a', 'c']); // => { 'a': 1, 'c': 3 } ``` -* * * +--- ### `_.pickBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12916 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") +[#](#_pickbyobject-predicate_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13080 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") [Ⓣ][1] Creates an object composed of the `object` properties `predicate` returns truthy for. The predicate is invoked with two arguments: *(value, key)*. @@ -7798,7 +7842,7 @@ truthy for. The predicate is invoked with two arguments: *(value, key)*. 4.0.0 #### Arguments 1. `object` *(Object)*: The source object. -2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property. +2. `[predicate=_.identity]` *(Function)*: The function invoked per property. #### Returns *(Object)*: Returns the new object. @@ -7810,14 +7854,14 @@ var object = { 'a': 1, 'b': '2', 'c': 3 }; _.pickBy(object, _.isNumber); // => { 'a': 1, 'c': 3 } ``` -* * * +--- ### `_.result(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12949 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") +[#](#_resultobject-path-defaultvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13113 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") [Ⓣ][1] This method is like `_.get` except that if the resolved value is a function it's invoked with the `this` binding of its parent object and @@ -7849,14 +7893,14 @@ _.result(object, 'a[0].b.c3', 'default'); _.result(object, 'a[0].b.c3', _.constant('default')); // => 'default' ``` -* * * +--- ### `_.set(object, path, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L12999 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") +[#](#_setobject-path-value) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13163 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") [Ⓣ][1] Sets the value at `path` of `object`. If a portion of `path` doesn't exist, it's created. Arrays are created for missing index properties while objects @@ -7888,14 +7932,14 @@ _.set(object, ['x', '0', 'y', 'z'], 5); console.log(object.x[0].y.z); // => 5 ``` -* * * +--- ### `_.setWith(object, path, value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13027 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") +[#](#_setwithobject-path-value-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13191 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") [Ⓣ][1] This method is like `_.set` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` @@ -7923,14 +7967,14 @@ var object = {}; _.setWith(object, '[0][1]', 'a', Object); // => { '0': { '1': 'a' } } ``` -* * * +--- ### `_.toPairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13056 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") +[#](#_topairsobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13220 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") [Ⓣ][1] Creates an array of own enumerable string keyed-value pairs for `object` which can be consumed by `_.fromPairs`. If `object` is a map or set, its @@ -7959,14 +8003,14 @@ Foo.prototype.c = 3; _.toPairs(new Foo); // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) ``` -* * * +--- ### `_.toPairsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13082 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") +[#](#_topairsinobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13246 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") [Ⓣ][1] Creates an array of own and inherited enumerable string keyed-value pairs for `object` which can be consumed by `_.fromPairs`. If `object` is a map @@ -7995,14 +8039,14 @@ Foo.prototype.c = 3; _.toPairsIn(new Foo); // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) ``` -* * * +--- ### `_.transform(object, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") +[#](#_transformobject-iteratee_identity-accumulator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13278 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") [Ⓣ][1] An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own @@ -8035,14 +8079,14 @@ _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { }, {}); // => { '1': ['a', 'c'], '2': ['b'] } ``` -* * * +--- ### `_.unset(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13163 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") +[#](#_unsetobject-path) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13327 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") [Ⓣ][1] Removes the property at `path` of `object`.
@@ -8073,14 +8117,14 @@ _.unset(object, ['a', '0', 'b', 'c']); console.log(object); // => { 'a': [{ 'b': {} }] }; ``` -* * * +--- ### `_.update(object, path, updater)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13194 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.update "See the npm package") +[#](#_updateobject-path-updater) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13358 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.update "See the npm package") [Ⓣ][1] This method is like `_.set` except that accepts `updater` to produce the value to set. Use `_.updateWith` to customize `path` creation. The `updater` @@ -8111,14 +8155,14 @@ _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); console.log(object.x[0].y.z); // => 0 ``` -* * * +--- ### `_.updateWith(object, path, updater, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13222 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.updatewith "See the npm package") +[#](#_updatewithobject-path-updater-customizer) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13386 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.updatewith "See the npm package") [Ⓣ][1] This method is like `_.update` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` @@ -8146,14 +8190,14 @@ var object = {}; _.updateWith(object, '[0][1]', _.constant('a'), Object); // => { '0': { '1': 'a' } } ``` -* * * +--- ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13253 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") +[#](#_valuesobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13417 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") [Ⓣ][1] Creates an array of the own enumerable string keyed property values of `object`.
@@ -8183,14 +8227,14 @@ _.values(new Foo); _.values('hi'); // => ['h', 'i'] ``` -* * * +--- ### `_.valuesIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13281 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") +[#](#_valuesinobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13445 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") [Ⓣ][1] Creates an array of the own and inherited enumerable string keyed property values of `object`. @@ -8218,7 +8262,7 @@ Foo.prototype.c = 3; _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed) ``` -* * * +--- @@ -8231,7 +8275,7 @@ _.valuesIn(new Foo); ### `_(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1464 "View in source") [Ⓣ][1] +[#](#_value) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1521 "View in source") [Ⓣ][1] Creates a `lodash` object which wraps `value` to enable implicit method chain sequences. Methods that operate on and return arrays, collections, @@ -8308,16 +8352,16 @@ The chainable wrapper methods are:

The wrapper methods that are **not** chainable by default are:
`add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, -`cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, -`eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, -`findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, -`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`, +`cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, +`defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, +`escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, +`findLastIndex`, `findLastKey`, `first`, `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`, @@ -8360,14 +8404,14 @@ _.isArray(squares); _.isArray(squares.value()); // => true ``` -* * * +--- ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8031 "View in source") [Ⓣ][1] +[#](#_chainvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8238 "View in source") [Ⓣ][1] Creates a `lodash` wrapper instance that wraps `value` with explicit method chain sequences enabled. The result of such sequences must be unwrapped @@ -8399,14 +8443,14 @@ var youngest = _ .value(); // => 'pebbles is 1' ``` -* * * +--- ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8060 "View in source") [Ⓣ][1] +[#](#_tapvalue-interceptor) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8267 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is invoked with one argument; *(value)*. The purpose of this method is to @@ -8432,14 +8476,14 @@ _([1, 2, 3]) .value(); // => [2, 1] ``` -* * * +--- ### `_.thru(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8088 "View in source") [Ⓣ][1] +[#](#_thruvalue-interceptor) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8295 "View in source") [Ⓣ][1] This method is like `_.tap` except that it returns the result of `interceptor`. The purpose of this method is to "pass thru" values replacing intermediate @@ -8465,14 +8509,14 @@ _(' abc ') .value(); // => ['abc'] ``` -* * * +--- ### `_.prototype[Symbol.iterator]()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8244 "View in source") [Ⓣ][1] +[#](#_prototypesymboliterator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8451 "View in source") [Ⓣ][1] Enables the wrapper to be iterable. @@ -8491,14 +8535,14 @@ wrapped[Symbol.iterator]() === wrapped; Array.from(wrapped); // => [1, 2] ``` -* * * +--- ### `_.prototype.at([paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8108 "View in source") [Ⓣ][1] +[#](#_prototypeatpaths) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8315 "View in source") [Ⓣ][1] This method is the wrapper version of `_.at`. @@ -8517,14 +8561,14 @@ var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; _(object).at(['a[0].b.c', 'a[1]']).value(); // => [3, 4] ``` -* * * +--- ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8160 "View in source") [Ⓣ][1] +[#](#_prototypechain) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8367 "View in source") [Ⓣ][1] Creates a `lodash` wrapper instance with explicit method chain sequences enabled. @@ -8552,14 +8596,14 @@ _(users) .value(); // => { 'user': 'barney' } ``` -* * * +--- ### `_.prototype.commit()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8190 "View in source") [Ⓣ][1] +[#](#_prototypecommit) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8397 "View in source") [Ⓣ][1] Executes the chain sequence and returns the wrapped result. @@ -8586,14 +8630,14 @@ wrapped.last(); console.log(array); // => [1, 2, 3] ``` -* * * +--- ### `_.prototype.next()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8216 "View in source") [Ⓣ][1] +[#](#_prototypenext) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8423 "View in source") [Ⓣ][1] Gets the next value on a wrapped object following the [iterator protocol](https://mdn.io/iteration_protocols#iterator). @@ -8616,14 +8660,14 @@ wrapped.next(); wrapped.next(); // => { 'done': true, 'value': undefined } ``` -* * * +--- ### `_.prototype.plant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8272 "View in source") [Ⓣ][1] +[#](#_prototypeplantvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8479 "View in source") [Ⓣ][1] Creates a clone of the chain sequence planting `value` as the wrapped value. @@ -8650,14 +8694,14 @@ other.value(); wrapped.value(); // => [1, 4] ``` -* * * +--- ### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8312 "View in source") [Ⓣ][1] +[#](#_prototypereverse) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8519 "View in source") [Ⓣ][1] This method is the wrapper version of `_.reverse`.
@@ -8679,14 +8723,14 @@ _(array).reverse().value() console.log(array); // => [3, 2, 1] ``` -* * * +--- ### `_.prototype.value()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L8344 "View in source") [Ⓣ][1] +[#](#_prototypevalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L8551 "View in source") [Ⓣ][1] Executes the chain sequence to resolve the unwrapped value. @@ -8703,7 +8747,7 @@ Executes the chain sequence to resolve the unwrapped value. _([1, 2, 3]).value(); // => [1, 2, 3] ``` -* * * +--- @@ -8716,7 +8760,7 @@ _([1, 2, 3]).value(); ### `_.camelCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13464 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") +[#](#_camelcasestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13628 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") [Ⓣ][1] Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). @@ -8739,14 +8783,14 @@ _.camelCase('--foo-bar--'); _.camelCase('__FOO_BAR__'); // => 'fooBar' ``` -* * * +--- ### `_.capitalize([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13484 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") +[#](#_capitalizestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13648 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") [Ⓣ][1] Converts the first character of `string` to upper case and the remaining to lower case. @@ -8764,14 +8808,14 @@ to lower case. _.capitalize('FRED'); // => 'Fred' ``` -* * * +--- ### `_.deburr([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") +[#](#_deburrstring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13669 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") [Ⓣ][1] Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) @@ -8791,14 +8835,14 @@ to basic latin letters and removing _.deburr('déjà vu'); // => 'deja vu' ``` -* * * +--- ### `_.endsWith([string=''], [target], [position=string.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13533 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") +[#](#_endswithstring-target-positionstringlength) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13697 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") [Ⓣ][1] Checks if `string` ends with the given target string. @@ -8823,14 +8867,14 @@ _.endsWith('abc', 'b'); _.endsWith('abc', 'b', 2); // => true ``` -* * * +--- ### `_.escape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") +[#](#_escapestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13745 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") [Ⓣ][1] Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to their corresponding HTML entities. @@ -8871,14 +8915,14 @@ XSS vectors. _.escape('fred, barney, & pebbles'); // => 'fred, barney, & pebbles' ``` -* * * +--- ### `_.escapeRegExp([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") +[#](#_escaperegexpstring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13767 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") [Ⓣ][1] Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. @@ -8896,14 +8940,14 @@ Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", _.escapeRegExp('[lodash](https://lodash.com/)'); // => '\[lodash\]\(https://lodash\.com/\)' ``` -* * * +--- ### `_.kebabCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") +[#](#_kebabcasestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13795 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") [Ⓣ][1] Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). @@ -8927,14 +8971,14 @@ _.kebabCase('fooBar'); _.kebabCase('__FOO_BAR__'); // => 'foo-bar' ``` -* * * +--- ### `_.lowerCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13654 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") +[#](#_lowercasestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13819 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") [Ⓣ][1] Converts `string`, as space separated words, to lower case. @@ -8957,14 +9001,14 @@ _.lowerCase('fooBar'); _.lowerCase('__FOO_BAR__'); // => 'foo bar' ``` -* * * +--- ### `_.lowerFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13675 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") +[#](#_lowerfirststring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13840 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") [Ⓣ][1] Converts the first character of `string` to lower case. @@ -8984,14 +9028,14 @@ _.lowerFirst('Fred'); _.lowerFirst('FRED'); // => 'fRED' ``` -* * * +--- ### `_.pad([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13700 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") +[#](#_padstring-length0-chars) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13865 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") [Ⓣ][1] Pads `string` on the left and right sides if it's shorter than `length`. Padding characters are truncated if they can't be evenly divided by `length`. @@ -9017,14 +9061,14 @@ _.pad('abc', 8, '_-'); _.pad('abc', 3); // => 'abc' ``` -* * * +--- ### `_.padEnd([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13739 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") +[#](#_padendstring-length0-chars) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13904 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") [Ⓣ][1] Pads `string` on the right side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -9050,14 +9094,14 @@ _.padEnd('abc', 6, '_-'); _.padEnd('abc', 3); // => 'abc' ``` -* * * +--- ### `_.padStart([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13772 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") +[#](#_padstartstring-length0-chars) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13937 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") [Ⓣ][1] Pads `string` on the left side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -9083,14 +9127,14 @@ _.padStart('abc', 6, '_-'); _.padStart('abc', 3); // => 'abc' ``` -* * * +--- ### `_.parseInt(string, [radix=10])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13806 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") +[#](#_parseintstring-radix10) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L13971 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") [Ⓣ][1] Converts `string` to an integer of the specified radix. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless `value` is a @@ -9117,14 +9161,14 @@ _.parseInt('08'); _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10] ``` -* * * +--- ### `_.repeat([string=''], [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13840 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") +[#](#_repeatstring-n1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14005 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") [Ⓣ][1] Repeats the given string `n` times. @@ -9148,14 +9192,14 @@ _.repeat('abc', 2); _.repeat('abc', 0); // => '' ``` -* * * +--- ### `_.replace([string=''], pattern, replacement)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13868 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") +[#](#_replacestring-pattern-replacement) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14033 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") [Ⓣ][1] Replaces matches for `pattern` in `string` with `replacement`.
@@ -9178,14 +9222,14 @@ Replaces matches for `pattern` in `string` with `replacement`. _.replace('Hi Fred', 'Fred', 'Barney'); // => 'Hi Barney' ``` -* * * +--- ### `_.snakeCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13896 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") +[#](#_snakecasestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14061 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") [Ⓣ][1] Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). @@ -9209,14 +9253,14 @@ _.snakeCase('fooBar'); _.snakeCase('--FOO-BAR--'); // => 'foo_bar' ``` -* * * +--- ### `_.split([string=''], separator, [limit])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13919 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") +[#](#_splitstring-separator-limit) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14084 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") [Ⓣ][1] Splits `string` by `separator`.
@@ -9239,14 +9283,14 @@ Splits `string` by `separator`. _.split('a-b-c', '-', 2); // => ['a', 'b'] ``` -* * * +--- ### `_.startCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13961 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") +[#](#_startcasestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14126 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") [Ⓣ][1] Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). @@ -9270,14 +9314,14 @@ _.startCase('fooBar'); _.startCase('__FOO_BAR__'); // => 'FOO BAR' ``` -* * * +--- ### `_.startsWith([string=''], [target], [position=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L13988 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") +[#](#_startswithstring-target-position0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14153 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") [Ⓣ][1] Checks if `string` starts with the given target string. @@ -9302,14 +9346,14 @@ _.startsWith('abc', 'b'); _.startsWith('abc', 'b', 1); // => true ``` -* * * +--- ### `_.template([string=''], [options={}], [options.escape=_.templateSettings.escape], [options.evaluate=_.templateSettings.evaluate], [options.imports=_.templateSettings.imports], [options.interpolate=_.templateSettings.interpolate], [options.sourceURL='lodash.templateSources[n]'], [options.variable='obj'])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14097 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") +[#](#_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14263 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") [Ⓣ][1] Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in @@ -9411,14 +9455,14 @@ fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ };\ '); ``` -* * * +--- ### `_.toLower([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14226 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") +[#](#_tolowerstring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14392 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") [Ⓣ][1] Converts `string`, as a whole, to lower case just like [String#toLowerCase](https://mdn.io/toLowerCase). @@ -9442,14 +9486,14 @@ _.toLower('fooBar'); _.toLower('__FOO_BAR__'); // => '__foo_bar__' ``` -* * * +--- ### `_.toUpper([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14251 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") +[#](#_toupperstring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14417 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") [Ⓣ][1] Converts `string`, as a whole, to upper case just like [String#toUpperCase](https://mdn.io/toUpperCase). @@ -9473,14 +9517,14 @@ _.toUpper('fooBar'); _.toUpper('__foo_bar__'); // => '__FOO_BAR__' ``` -* * * +--- ### `_.trim([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14277 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") +[#](#_trimstring-charswhitespace) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14443 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") [Ⓣ][1] Removes leading and trailing whitespace or specified characters from `string`. @@ -9504,14 +9548,14 @@ _.trim('-_-abc-_-', '_-'); _.map([' foo ', ' bar '], _.trim); // => ['foo', 'bar'] ``` -* * * +--- ### `_.trimEnd([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14312 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") +[#](#_trimendstring-charswhitespace) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14478 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") [Ⓣ][1] Removes trailing whitespace or specified characters from `string`. @@ -9532,14 +9576,14 @@ _.trimEnd(' abc '); _.trimEnd('-_-abc-_-', '_-'); // => '-_-abc' ``` -* * * +--- ### `_.trimStart([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14345 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") +[#](#_trimstartstring-charswhitespace) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14511 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") [Ⓣ][1] Removes leading whitespace or specified characters from `string`. @@ -9560,14 +9604,14 @@ _.trimStart(' abc '); _.trimStart('-_-abc-_-', '_-'); // => 'abc-_-' ``` -* * * +--- ### `_.truncate([string=''], [options={}], [options.length=30], [options.omission='...'], [options.separator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14396 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") +[#](#_truncatestring-options-optionslength30-optionsomission-optionsseparator) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14562 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") [Ⓣ][1] Truncates `string` if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission @@ -9607,14 +9651,14 @@ _.truncate('hi-diddly-ho there, neighborino', { }); // => 'hi-diddly-ho there, neig [...]' ``` -* * * +--- ### `_.unescape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14471 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") +[#](#_unescapestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14637 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") [Ⓣ][1] The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, `'`, and ``` in `string` to @@ -9637,14 +9681,14 @@ HTML entities use a third-party library like [_he_](https://mths.be/he). _.unescape('fred, barney, & pebbles'); // => 'fred, barney, & pebbles' ``` -* * * +--- ### `_.upperCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14498 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") +[#](#_uppercasestring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14664 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") [Ⓣ][1] Converts `string`, as space separated words, to upper case. @@ -9667,14 +9711,14 @@ _.upperCase('fooBar'); _.upperCase('__foo_bar__'); // => 'FOO BAR' ``` -* * * +--- ### `_.upperFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14519 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") +[#](#_upperfirststring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14685 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") [Ⓣ][1] Converts the first character of `string` to upper case. @@ -9694,14 +9738,14 @@ _.upperFirst('fred'); _.upperFirst('FRED'); // => 'FRED' ``` -* * * +--- ### `_.words([string=''], [pattern])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14540 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") +[#](#_wordsstring-pattern) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14706 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") [Ⓣ][1] Splits `string` into an array of its words. @@ -9722,7 +9766,7 @@ _.words('fred, barney, & pebbles'); _.words('fred, barney, & pebbles', /[^, ]+/g); // => ['fred', 'barney', '&', 'pebbles'] ``` -* * * +--- @@ -9735,7 +9779,7 @@ _.words('fred, barney, & pebbles', /[^, ]+/g); ### `_.attempt(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14574 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") +[#](#_attemptfunc-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14740 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") [Ⓣ][1] Attempts to invoke `func`, returning either the result or the caught error object. Any additional arguments are provided to `func` when it's invoked. @@ -9760,14 +9804,14 @@ if (_.isError(elements)) { elements = []; } ``` -* * * +--- ### `_.bindAll(object, methodNames)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14608 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") +[#](#_bindallobject-methodnames) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14774 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") [Ⓣ][1] Binds methods of an object to the object itself, overwriting the existing method. @@ -9788,23 +9832,23 @@ method. ```js var view = { 'label': 'docs', - 'onClick': function() { + 'click': function() { console.log('clicked ' + this.label); } }; -_.bindAll(view, ['onClick']); -jQuery(element).on('click', view.onClick); +_.bindAll(view, ['click']); +jQuery(element).on('click', view.click); // => Logs 'clicked docs' when clicked. ``` -* * * +--- ### `_.cond(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14645 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") +[#](#_condpairs) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14811 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") [Ⓣ][1] Creates a function that iterates over `pairs` and invokes the corresponding function of the first predicate to return truthy. The predicate-function @@ -9824,7 +9868,7 @@ function. var func = _.cond([ [_.matches({ 'a': 1 }), _.constant('matches A')], [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - [_.constant(true), _.constant('no match')] + [_.stubTrue, _.constant('no match')] ]); func({ 'a': 1, 'b': 2 }); @@ -9836,14 +9880,14 @@ func({ 'a': 0, 'b': 1 }); func({ 'a': '1', 'b': '2' }); // => 'no match' ``` -* * * +--- ### `_.conforms(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14688 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") +[#](#_conformssource) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14854 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") [Ⓣ][1] Creates a function that invokes the predicate properties of `source` with the corresponding property values of a given object, returning `true` if @@ -9859,22 +9903,22 @@ all predicates return truthy, else `false`. #### Example ```js -var users = [ - { 'user': 'barney', 'age': 36 }, - { 'user': 'fred', 'age': 40 } +var objects = [ + { 'a': 2, 'b': 1 }, + { 'a': 1, 'b': 2 } ]; -_.filter(users, _.conforms({ 'age': function(n) { return n > 38; } })); -// => [{ 'user': 'fred', 'age': 40 }] +_.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); +// => [{ 'a': 1, 'b': 2 }] ``` -* * * +--- ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14711 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") +[#](#_constantvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14877 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") [Ⓣ][1] Creates a function that returns `value`. @@ -9896,14 +9940,44 @@ console.log(objects); console.log(objects[0] === objects[1]); // => true ``` -* * * +--- + + + + + +### `_.defaultTo(value, defaultValue)` +[#](#_defaulttovalue-defaultvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14903 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defaultto "See the npm package") [Ⓣ][1] + +Checks `value` to determine whether a default value should be returned in +its place. The `defaultValue` is returned if `value` is `NaN`, `null`, +or `undefined`. + +#### Since +4.14.0 +#### Arguments +1. `value` *(*)*: The value to check. +2. `defaultValue` *(*)*: The default value. + +#### Returns +*(*)*: Returns the resolved value. + +#### Example +```js +_.defaultTo(1, 10); +// => 1 + +_.defaultTo(undefined, 10); +// => 10 +``` +--- ### `_.flow([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14739 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") +[#](#_flowfuncs) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14929 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") [Ⓣ][1] Creates a function that returns the result of invoking the given functions with the `this` binding of the created function, where each successive @@ -9912,7 +9986,7 @@ invocation is supplied the return value of the previous. #### Since 3.0.0 #### Arguments -1. `[funcs]` *(...(Function|Function[]))*: Functions to invoke. +1. `[funcs]` *(...(Function|Function[]))*: The functions to invoke. #### Returns *(Function)*: Returns the new composite function. @@ -9927,14 +10001,14 @@ var addSquare = _.flow([_.add, square]); addSquare(1, 2); // => 9 ``` -* * * +--- ### `_.flowRight([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14762 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") +[#](#_flowrightfuncs) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14952 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") [Ⓣ][1] This method is like `_.flow` except that it creates a function that invokes the given functions from right to left. @@ -9942,7 +10016,7 @@ invokes the given functions from right to left. #### Since 3.0.0 #### Arguments -1. `[funcs]` *(...(Function|Function[]))*: Functions to invoke. +1. `[funcs]` *(...(Function|Function[]))*: The functions to invoke. #### Returns *(Function)*: Returns the new composite function. @@ -9957,16 +10031,16 @@ var addSquare = _.flowRight([square, _.add]); addSquare(1, 2); // => 9 ``` -* * * +--- ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14780 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") +[#](#_identityvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L14970 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") [Ⓣ][1] -This method returns the first argument given to it. +This method returns the first argument it receives. #### Since 0.1.0 @@ -9978,19 +10052,19 @@ This method returns the first argument given to it. #### Example ```js -var object = { 'user': 'fred' }; +var object = { 'a': 1 }; console.log(_.identity(object) === object); // => true ``` -* * * +--- ### `_.iteratee([func=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14826 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") +[#](#_iterateefunc_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15016 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the arguments of the created function. If `func` is a property name, the created function returns the @@ -10035,14 +10109,14 @@ _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { _.filter(['abc', 'def'], /ef/); // => ['def'] ``` -* * * +--- ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14854 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") +[#](#_matchessource) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15044 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") [Ⓣ][1] Creates a function that performs a partial deep comparison between a given object and `source`, returning `true` if the given object has equivalent @@ -10062,22 +10136,22 @@ property values, else `false`. The created function is equivalent to #### Example ```js -var users = [ - { 'user': 'barney', 'age': 36, 'active': true }, - { 'user': 'fred', 'age': 40, 'active': false } +var objects = [ + { 'a': 1, 'b': 2, 'c': 3 }, + { 'a': 4, 'b': 5, 'c': 6 } ]; -_.filter(users, _.matches({ 'age': 40, 'active': false })); -// => [{ 'user': 'fred', 'age': 40, 'active': false }] +_.filter(objects, _.matches({ 'a': 4, 'c': 6 })); +// => [{ 'a': 4, 'b': 5, 'c': 6 }] ``` -* * * +--- ### `_.matchesProperty(path, srcValue)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14882 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") +[#](#_matchespropertypath-srcvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15072 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") [Ⓣ][1] Creates a function that performs a partial deep comparison between the value at `path` of a given object to `srcValue`, returning `true` if the @@ -10097,22 +10171,22 @@ object value is equivalent, else `false`. #### Example ```js -var users = [ - { 'user': 'barney' }, - { 'user': 'fred' } +var objects = [ + { 'a': 1, 'b': 2, 'c': 3 }, + { 'a': 4, 'b': 5, 'c': 6 } ]; -_.find(users, _.matchesProperty('user', 'fred')); -// => { 'user': 'fred' } +_.find(objects, _.matchesProperty('a', 4)); +// => { 'a': 4, 'b': 5, 'c': 6 } ``` -* * * +--- ### `_.method(path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14910 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") +[#](#_methodpath-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15100 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") [Ⓣ][1] Creates a function that invokes the method at `path` of a given object. Any additional arguments are provided to the invoked method. @@ -10139,14 +10213,14 @@ _.map(objects, _.method('a.b')); _.map(objects, _.method(['a', 'b'])); // => [2, 1] ``` -* * * +--- ### `_.methodOf(object, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14939 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") +[#](#_methodofobject-args) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15129 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") [Ⓣ][1] The opposite of `_.method`; this method creates a function that invokes the method at a given path of `object`. Any additional arguments are @@ -10172,14 +10246,14 @@ _.map(['a[2]', 'c[0]'], _.methodOf(object)); _.map([['a', '2'], ['c', '0']], _.methodOf(object)); // => [2, 0] ``` -* * * +--- ### `_.mixin([object=lodash], source, [options={}], [options.chain=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L14981 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") +[#](#_mixinobjectlodash-source-options-optionschaintrue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15171 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") [Ⓣ][1] Adds all own enumerable string keyed function properties of a source object to the destination object. If `object` is a function, then methods @@ -10219,14 +10293,14 @@ _.mixin({ 'vowels': vowels }, { 'chain': false }); _('fred').vowels(); // => ['e'] ``` -* * * +--- ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15030 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") +[#](#_noconflict) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15220 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") [Ⓣ][1] Reverts the `_` variable to its previous value and returns a reference to the `lodash` function. @@ -10240,16 +10314,16 @@ the `lodash` function. ```js var lodash = _.noConflict(); ``` -* * * +--- ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15049 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") +[#](#_noop) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15239 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") [Ⓣ][1] -A method that returns `undefined`. +This method returns `undefined`. #### Since 2.3.0 @@ -10258,14 +10332,14 @@ A method that returns `undefined`. _.times(2, _.noop); // => [undefined, undefined] ``` -* * * +--- ### `_.nthArg([n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15073 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") +[#](#_nthargn0) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15263 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") [Ⓣ][1] Creates a function that gets the argument at index `n`. If `n` is negative, the nth argument from the end is returned. @@ -10288,14 +10362,14 @@ var func = _.nthArg(-2); func('a', 'b', 'c', 'd'); // => 'c' ``` -* * * +--- ### `_.over([iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15098 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") +[#](#_overiteratees_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15288 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") [Ⓣ][1] Creates a function that invokes `iteratees` with the arguments it receives and returns their results. @@ -10303,7 +10377,7 @@ and returns their results. #### Since 4.0.0 #### Arguments -1. `[iteratees=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The iteratees to invoke. +1. `[iteratees=[_.identity]]` *(...(Function|Function[]))*: The iteratees to invoke. #### Returns *(Function)*: Returns the new function. @@ -10315,14 +10389,14 @@ var func = _.over([Math.max, Math.min]); func(1, 2, 3, 4); // => [4, 1] ``` -* * * +--- ### `_.overEvery([predicates=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15124 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") +[#](#_overeverypredicates_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15314 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") [Ⓣ][1] Creates a function that checks if **all** of the `predicates` return truthy when invoked with the arguments it receives. @@ -10330,7 +10404,7 @@ truthy when invoked with the arguments it receives. #### Since 4.0.0 #### Arguments -1. `[predicates=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The predicates to check. +1. `[predicates=[_.identity]]` *(...(Function|Function[]))*: The predicates to check. #### Returns *(Function)*: Returns the new function. @@ -10348,14 +10422,14 @@ func(null); func(NaN); // => false ``` -* * * +--- ### `_.overSome([predicates=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15150 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") +[#](#_oversomepredicates_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15340 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") [Ⓣ][1] Creates a function that checks if **any** of the `predicates` return truthy when invoked with the arguments it receives. @@ -10363,7 +10437,7 @@ truthy when invoked with the arguments it receives. #### Since 4.0.0 #### Arguments -1. `[predicates=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The predicates to check. +1. `[predicates=[_.identity]]` *(...(Function|Function[]))*: The predicates to check. #### Returns *(Function)*: Returns the new function. @@ -10381,14 +10455,14 @@ func(null); func(NaN); // => false ``` -* * * +--- ### `_.property(path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15174 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") +[#](#_propertypath) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15364 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") [Ⓣ][1] Creates a function that returns the value at `path` of a given object. @@ -10413,14 +10487,14 @@ _.map(objects, _.property('a.b')); _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); // => [1, 2] ``` -* * * +--- ### `_.propertyOf(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15199 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") +[#](#_propertyofobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15389 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") [Ⓣ][1] The opposite of `_.property`; this method creates a function that returns the value at a given path of `object`. @@ -10444,14 +10518,14 @@ _.map(['a[2]', 'c[0]'], _.propertyOf(object)); _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); // => [2, 0] ``` -* * * +--- ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") +[#](#_rangestart0-end-step1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15436 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") [Ⓣ][1] Creates an array of numbers *(positive and/or negative)* progressing from `start` up to, but not including, `end`. A step of `-1` is used if a negative @@ -10495,14 +10569,14 @@ _.range(1, 4, 0); _.range(0); // => [] ``` -* * * +--- ### `_.rangeRight([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15284 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") +[#](#_rangerightstart0-end-step1) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15474 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") [Ⓣ][1] This method is like `_.range` except that it populates values in descending order. @@ -10540,14 +10614,14 @@ _.rangeRight(1, 4, 0); _.rangeRight(0); // => [] ``` -* * * +--- ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") +[#](#_runincontextcontextroot) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1279 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") [Ⓣ][1] Create a new pristine `lodash` function using the `context` object. @@ -10586,16 +10660,16 @@ var stubbed = _.runInContext({ // Create a suped-up `defer` in Node.js. var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; ``` -* * * +--- ### `_.stubArray()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15304 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.stubarray "See the npm package") +[#](#_stubarray) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15494 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.stubarray "See the npm package") [Ⓣ][1] -A method that returns a new empty array. +This method returns a new empty array. #### Since 4.13.0 @@ -10612,16 +10686,16 @@ console.log(arrays); console.log(arrays[0] === arrays[1]); // => false ``` -* * * +--- ### `_.stubFalse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15321 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.stubfalse "See the npm package") +[#](#_stubfalse) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15511 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.stubfalse "See the npm package") [Ⓣ][1] -A method that returns `false`. +This method returns `false`. #### Since 4.13.0 @@ -10633,16 +10707,16 @@ A method that returns `false`. _.times(2, _.stubFalse); // => [false, false] ``` -* * * +--- ### `_.stubObject()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15343 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.stubobject "See the npm package") +[#](#_stubobject) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15533 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.stubobject "See the npm package") [Ⓣ][1] -A method that returns a new empty object. +This method returns a new empty object. #### Since 4.13.0 @@ -10659,16 +10733,16 @@ console.log(objects); console.log(objects[0] === objects[1]); // => false ``` -* * * +--- ### `_.stubString()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.stubstring "See the npm package") +[#](#_stubstring) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15550 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.stubstring "See the npm package") [Ⓣ][1] -A method that returns an empty string. +This method returns an empty string. #### Since 4.13.0 @@ -10680,16 +10754,16 @@ A method that returns an empty string. _.times(2, _.stubString); // => ['', ''] ``` -* * * +--- ### `_.stubTrue()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15377 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.stubtrue "See the npm package") +[#](#_stubtrue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15567 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.stubtrue "See the npm package") [Ⓣ][1] -A method that returns `true`. +This method returns `true`. #### Since 4.13.0 @@ -10701,14 +10775,14 @@ A method that returns `true`. _.times(2, _.stubTrue); // => [true, true] ``` -* * * +--- ### `_.times(n, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15400 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") +[#](#_timesn-iteratee_identity) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15590 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") [Ⓣ][1] Invokes the iteratee `n` times, returning an array of the results of each invocation. The iteratee is invoked with one argument; *(index)*. @@ -10730,14 +10804,14 @@ _.times(3, String); _.times(4, _.constant(0)); // => [0, 0, 0, 0] ``` -* * * +--- ### `_.toPath(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15435 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") +[#](#_topathvalue) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15625 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") [Ⓣ][1] Converts `value` to a property path array. @@ -10757,14 +10831,14 @@ _.toPath('a.b.c'); _.toPath('a[0].b.c'); // => ['a', '0', 'b', 'c'] ``` -* * * +--- ### `_.uniqueId([prefix=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L15459 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") +[#](#_uniqueidprefix) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L15649 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") [Ⓣ][1] Generates a unique ID. If `prefix` is given, the ID is appended to it. @@ -10784,7 +10858,7 @@ _.uniqueId('contact_'); _.uniqueId(); // => '105' ``` -* * * +--- @@ -10797,79 +10871,79 @@ _.uniqueId(); ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L16152 "View in source") [Ⓣ][1] +[#](#_version) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L16340 "View in source") [Ⓣ][1] (string): The semantic version number. -* * * +--- ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1509 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") +[#](#_templatesettings) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1566 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") [Ⓣ][1] (Object): By default, the template delimiters used by lodash are like those in embedded Ruby *(ERB)*. Change the following template settings to use alternative delimiters. -* * * +--- ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1517 "View in source") [Ⓣ][1] +[#](#_templatesettingsescape) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1574 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to be HTML-escaped. -* * * +--- ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1525 "View in source") [Ⓣ][1] +[#](#_templatesettingsevaluate) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1582 "View in source") [Ⓣ][1] (RegExp): Used to detect code to be evaluated. -* * * +--- ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1549 "View in source") [Ⓣ][1] +[#](#_templatesettingsimports) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1606 "View in source") [Ⓣ][1] (Object): Used to import variables into the compiled template. -* * * +--- ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1533 "View in source") [Ⓣ][1] +[#](#_templatesettingsinterpolate) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1590 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to inject. -* * * +--- ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1541 "View in source") [Ⓣ][1] +[#](#_templatesettingsvariable) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1598 "View in source") [Ⓣ][1] (string): Used to reference the data object in the template text. -* * * +--- @@ -10882,11 +10956,11 @@ alternative delimiters. ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.13.1/lodash.js#L1557 "View in source") [Ⓣ][1] +[#](#_templatesettingsimports_) [Ⓢ](https://github.com/lodash/lodash/blob/4.14.0/lodash.js#L1614 "View in source") [Ⓣ][1] A reference to the `lodash` function. -* * * +--- diff --git a/lodash.js b/lodash.js index f717c2bdc..8dd467299 100644 --- a/lodash.js +++ b/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.13.1'; + var VERSION = '4.14.0'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/package.json b/package.json index 7d06d4686..3a8208e76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "4.13.2-pre", + "version": "4.14.0", "license": "MIT", "private": true, "main": "lodash.js",