From aebc0650f8fe0df6ec7df40204063ff79fcc8cde Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 22 Apr 2016 08:19:27 -0700 Subject: [PATCH 01/57] Simplify `_.concat`. --- lodash.js | 44 ++++++++++---------------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/lodash.js b/lodash.js index 9f472f6910..d379fdc14f 100644 --- a/lodash.js +++ b/lodash.js @@ -456,30 +456,6 @@ return accumulator; } - /** - * Creates a new array concatenating `array` with `other`. - * - * @private - * @param {Array} array The first array to concatenate. - * @param {Array} other The second array to concatenate. - * @returns {Array} Returns the new concatenated array. - */ - function arrayConcat(array, other) { - var index = -1, - length = array.length, - othIndex = -1, - othLength = other.length, - result = Array(length + othLength); - - while (++index < length) { - result[index] = array[index]; - } - while (++othIndex < othLength) { - result[index++] = other[othIndex]; - } - return result; - } - /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. @@ -4592,8 +4568,8 @@ function wrapper() { var length = arguments.length, - index = length, - args = Array(length); + args = Array(length), + index = length; while (index--) { args[index] = arguments[index]; @@ -6053,16 +6029,16 @@ */ function concat() { var length = arguments.length, - array = castArray(arguments[0]); + args = Array(length ? length - 1 : 0), + array = arguments[0], + index = length; - if (length < 2) { - return length ? copyArray(array) : []; - } - var args = Array(length - 1); - while (length--) { - args[length - 1] = arguments[length]; + while (index--) { + args[index - 1] = arguments[index]; } - return arrayConcat(array, baseFlatten(args, 1)); + return length + ? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)) + : []; } /** From e2c86dac63cbb9d6788dbc2b51e5c328288f08d8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 22 Apr 2016 08:46:35 -0700 Subject: [PATCH 02/57] Ensure `fp.update` does not convert end of `path` to an object. [closes #2271] --- fp/_baseConvert.js | 3 ++- test/test-fp.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index e7e631ce4b..1d92da540e 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -235,6 +235,7 @@ function baseConvert(util, name, func, options) { var index = -1, length = path.length, + lastIndex = length - 1, result = clone(Object(object)), nested = result; @@ -243,7 +244,7 @@ function baseConvert(util, name, func, options) { value = nested[key]; if (value != null) { - nested[key] = clone(Object(value)); + nested[path[index]] = clone(index == lastIndex ? value : Object(value)); } nested = nested[key]; } diff --git a/test/test-fp.js b/test/test-fp.js index 775d7eed2a..739ceed409 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -1474,6 +1474,19 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.update'); + + (function() { + QUnit.test('should not convert end of `path` to an object', function(assert) { + assert.expect(1); + + var actual = fp.update('a.b')(_.identity)({ 'a': { 'b': 1 } }); + assert.strictEqual(typeof actual.a.b, 'number'); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('padChars methods'); _.each(['padChars', 'padCharsStart', 'padCharsEnd'], function(methodName) { From 4e38f70e0e7a6344b0bdb6bc52efc9fa5999e033 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 22 Apr 2016 20:45:16 -0700 Subject: [PATCH 03/57] Update cache implementations. --- lodash.js | 479 ++++++++++++++++++++++++++---------------------- test/test-fp.js | 10 +- 2 files changed, 264 insertions(+), 225 deletions(-) diff --git a/lodash.js b/lodash.js index d379fdc14f..85472bba24 100644 --- a/lodash.js +++ b/lodash.js @@ -920,6 +920,18 @@ }); } + /** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. @@ -1661,64 +1673,202 @@ * * @private * @constructor - * @returns {Object} Returns the new hash object. + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @name clear + * @memberOf Hash */ - function Hash() {} + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + } /** * Removes `key` and its value from the hash. * - * @private + * @name delete + * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; + function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; } /** * Gets the hash value for `key`. * - * @private - * @param {Object} hash The hash to query. + * @name get + * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ - function hashGet(hash, key) { + function hashGet(key) { + var data = this.__data__; if (nativeCreate) { - var result = hash[key]; + var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; + return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * - * @private - * @param {Object} hash The hash to query. + * @name has + * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * * @private - * @param {Object} hash The hash to modify. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + } + + /** + * Removes `key` and its value from the list cache. + * + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @name set + * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. */ - function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; } - // Avoid inheriting from `Object.prototype` when possible. - Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ @@ -1727,15 +1877,15 @@ * * @private * @constructor - * @param {Array} [values] The values to cache. + * @param {Array} [entries] The key-value pairs to cache. */ - function MapCache(values) { + function MapCache(entries) { var index = -1, - length = values ? values.length : 0; + length = entries ? entries.length : 0; this.clear(); while (++index < length) { - var entry = values[index]; + var entry = entries[index]; this.set(entry[0], entry[1]); } } @@ -1743,14 +1893,13 @@ /** * Removes all key-value entries from the map. * - * @private * @name clear * @memberOf MapCache */ - function mapClear() { + function mapCacheClear() { this.__data__ = { 'hash': new Hash, - 'map': Map ? new Map : [], + 'map': new (Map || ListCache), 'string': new Hash }; } @@ -1764,82 +1913,60 @@ * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); + function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); } /** * Gets the map value for `key`. * - * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ - function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); + function mapCacheGet(key) { + return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * - * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); + function mapCacheHas(key) { + return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * - * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ - function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } + function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); return this; } // Add methods to `MapCache`. - MapCache.prototype.clear = mapClear; - MapCache.prototype['delete'] = mapDelete; - MapCache.prototype.get = mapGet; - MapCache.prototype.has = mapHas; - MapCache.prototype.set = mapSet; + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * - * Creates a set cache object to store unique values. + * Creates an array cache object to store unique values. * * @private * @constructor @@ -1851,52 +1978,39 @@ this.__data__ = new MapCache; while (++index < length) { - this.push(values[index]); + this.add(values[index]); } } /** - * Checks if `value` is in `cache`. + * Adds `value` to the array cache. * - * @private - * @param {Object} cache The set cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ - function cacheHas(cache, value) { - var map = cache.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - return hash[value] === HASH_UNDEFINED; - } - return map.has(value); + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } /** - * Adds `value` to the set cache. + * Checks if `value` is in the array cache. * - * @private - * @name push + * @name has * @memberOf SetCache - * @param {*} value The value to cache. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. */ - function cachePush(value) { - var map = this.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - hash[value] = HASH_UNDEFINED; - } - else { - map.set(value, HASH_UNDEFINED); - } + function setCacheHas(value) { + return this.__data__.has(value); } // Add methods to `SetCache`. - SetCache.prototype.push = cachePush; + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ @@ -1905,82 +2019,61 @@ * * @private * @constructor - * @param {Array} [values] The values to cache. + * @param {Array} [entries] The key-value pairs to cache. */ - function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } + function Stack(entries) { + this.__data__ = new ListCache(entries); } /** * Removes all key-value entries from the stack. * - * @private * @name clear * @memberOf Stack */ function stackClear() { - this.__data__ = { 'array': [], 'map': null }; + this.__data__ = new ListCache; } /** * Removes `key` and its value from the stack. * - * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); + return this.__data__['delete'](key); } /** * Gets the stack value for `key`. * - * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); + return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * - * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); + return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * - * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. @@ -1988,21 +2081,11 @@ * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); + var cache = this.__data__; + if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { + cache = this.__data__ = new MapCache(cache.__data__); } + cache.set(key, value); return this; } @@ -2015,90 +2098,6 @@ /*------------------------------------------------------------------------*/ - /** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; - } - - /** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; - } - - /** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } - } - - /*------------------------------------------------------------------------*/ - /** * Used by `_.defaults` to customize its `_.assignIn` use. * @@ -2151,6 +2150,24 @@ } } + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. @@ -4957,9 +4974,7 @@ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; @@ -4971,7 +4986,10 @@ if (stacked) { return stacked == other; } - var result = true; + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + stack.set(array, other); // Ignore non-index properties. @@ -5259,6 +5277,21 @@ */ var getLength = baseProperty('length'); + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + /** * Gets the property names, values, and compare flags of `object`. * diff --git a/test/test-fp.js b/test/test-fp.js index 739ceed409..d550aa335f 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -901,7 +901,7 @@ var iteration = 0, objects = [{ 'a': 1 }, { 'a': 2 }], - stack = { '__data__': { 'array': [[objects[0], objects[1]]], 'map': null } }, + stack = { '__data__': { '__data__': [objects] } }, expected = [1, 2, 'a', objects[0], objects[1], stack]; args = undefined; @@ -913,10 +913,12 @@ })(objects[0])(objects[1]); args[5] = _.omitBy(args[5], _.isFunction); + args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction); + assert.deepEqual(args, expected, 'fp.isEqualWith'); args = undefined; - stack = { '__data__': { 'array': [], 'map': null } }; + stack = { '__data__': { '__data__': [] } }; expected = [2, 1, 'a', objects[1], objects[0], stack]; fp.isMatchWith(function() { @@ -924,6 +926,8 @@ })(objects[0])(objects[1]); args[5] = _.omitBy(args[5], _.isFunction); + args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction); + assert.deepEqual(args, expected, 'fp.isMatchWith'); args = undefined; @@ -935,6 +939,8 @@ })(value)({ 'a': [2, 3] }); args[5] = _.omitBy(args[5], _.isFunction); + args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction); + assert.deepEqual(args, expected, 'fp.mergeWith'); args = undefined; From 43c26b5d6f9d7ba971cf89c2582ac08d72007291 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 22 Apr 2016 22:01:29 -0700 Subject: [PATCH 04/57] Ensure matches methods match arrays with duplicate values. [closes #2270] --- lodash.js | 10 ++++++---- test/test.js | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index 85472bba24..8bb686ad9b 100644 --- a/lodash.js +++ b/lodash.js @@ -5010,10 +5010,12 @@ break; } // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || - equalFunc(arrValue, othValue, customizer, bitmask, stack); + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } })) { result = false; break; diff --git a/test/test.js b/test/test.js index 2b20e07fee..0ecdcd572c 100644 --- a/test/test.js +++ b/test/test.js @@ -10437,9 +10437,23 @@ source = { 'a': ['d', 'b'] }; actual = lodashStable.filter(objects, predicate); + assert.deepEqual(actual, []); }); + QUnit.test('should partial match arrays with duplicate values', function(assert) { + assert.expect(1); + + var objects = [{ 'a': [1, 2] }, { 'a': [2, 2] }], + source = { 'a': [2, 2] }; + + var actual = lodashStable.filter(objects, function(object) { + return _.isMatch(object, source); + }); + + assert.deepEqual(actual, [objects[1]]); + }); + QUnit.test('should partial match arrays of objects', function(assert) { assert.expect(1); @@ -13630,6 +13644,15 @@ assert.deepEqual(actual, []); }); + QUnit.test('should partial match arrays with duplicate values', function(assert) { + assert.expect(1); + + var objects = [{ 'a': [1, 2] }, { 'a': [2, 2] }], + actual = lodashStable.filter(objects, _.matches({ 'a': [2, 2] })); + + assert.deepEqual(actual, [objects[1]]); + }); + QUnit.test('should partial match arrays of objects', function(assert) { assert.expect(1); @@ -14075,6 +14098,15 @@ assert.deepEqual(actual, []); }); + QUnit.test('should partial match arrays with duplicate values', function(assert) { + assert.expect(1); + + var objects = [{ 'a': [1, 2] }, { 'a': [2, 2] }], + actual = lodashStable.filter(objects, _.matchesProperty('a', [2, 2])); + + assert.deepEqual(actual, [objects[1]]); + }); + QUnit.test('should partial match arrays of objects', function(assert) { assert.expect(1); From fbc91cf7aef4856753f636772e8285104ad480d7 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 23 Apr 2016 11:29:52 -0700 Subject: [PATCH 05/57] Add iteratee arity hints to forEach methods. [closes #2277] --- fp/_baseConvert.js | 17 +++++++---------- lodash.js | 18 ++++++++---------- test/test-fp.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index 1d92da540e..fd66bce153 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -189,25 +189,22 @@ function baseConvert(util, name, func, options) { if (!isFunction(func)) { return mixin(func, Object(source)); } - var methods = [], - methodNames = []; - + var pairs = []; each(keys(source), function(key) { var value = source[key]; if (isFunction(value)) { - methodNames.push(key); - methods.push(func.prototype[key]); + pairs.push([key, func.prototype[key]]); } }); mixin(func, Object(source)); - each(methodNames, function(methodName, index) { - var method = methods[index]; - if (isFunction(method)) { - func.prototype[methodName] = method; + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; } else { - delete func.prototype[methodName]; + delete func.prototype[pair[0]]; } }); return func; diff --git a/lodash.js b/lodash.js index 8bb686ad9b..4d77d51abe 100644 --- a/lodash.js +++ b/lodash.js @@ -8500,9 +8500,8 @@ * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEach(collection, iteratee) - : baseEach(collection, getIteratee(iteratee)); + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); } /** @@ -8526,9 +8525,8 @@ * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEachRight(collection, iteratee) - : baseEachRight(collection, getIteratee(iteratee)); + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); } /** @@ -12103,7 +12101,7 @@ function forIn(object, iteratee) { return object == null ? object - : baseFor(object, getIteratee(iteratee), keysIn); + : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** @@ -12135,7 +12133,7 @@ function forInRight(object, iteratee) { return object == null ? object - : baseForRight(object, getIteratee(iteratee), keysIn); + : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** @@ -12167,7 +12165,7 @@ * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee)); + return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** @@ -12197,7 +12195,7 @@ * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee)); + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** diff --git a/test/test-fp.js b/test/test-fp.js index d550aa335f..1ebd6b4bf2 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -1178,6 +1178,35 @@ }); }); }); + + /*--------------------------------------------------------------------------*/ + + QUnit.module('forEach methods'); + + _.each(['forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight'], function(methodName) { + var func = fp[methodName]; + + QUnit.test('`fp.' + methodName + '` should provide `value` to `iteratee`', function(assert) { + assert.expect(2); + + var args; + + func(function() { + args || (args = slice.call(arguments)); + })(['a']); + + assert.deepEqual(args, ['a']); + + args = undefined; + + func(function() { + args || (args = slice.call(arguments)); + })({ 'a': 1 }); + + assert.deepEqual(args, [1]); + }); + }); + /*--------------------------------------------------------------------------*/ QUnit.module('fp.getOr'); From 0125ff73038dc1549a9a325adbd21c33f6c9a278 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 23 Apr 2016 11:31:14 -0700 Subject: [PATCH 06/57] Cleanup fp test labels and args tests. --- test/test-fp.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/test/test-fp.js b/test/test-fp.js index 1ebd6b4bf2..f4354795aa 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -1022,7 +1022,7 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('fp.curry and fp.curryRight'); + QUnit.module('curry methods'); _.each(['curry', 'curryRight'], function(methodName) { var func = fp[methodName]; @@ -1036,7 +1036,7 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('fp.curryN and fp.curryRightN'); + QUnit.module('curryN methods'); _.each(['curryN', 'curryRightN'], function(methodName) { var func = fp[methodName]; @@ -1133,7 +1133,7 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('fp.flow and fp.flowRight'); + QUnit.module('flow methods'); _.each(['flow', 'flowRight'], function(methodName) { var func = fp[methodName], @@ -1343,12 +1343,11 @@ QUnit.test('should only provide `key` to `iteratee`', function(assert) { assert.expect(1); - var args, - object = { 'a': 1 }; + var args; fp.mapKeys(function() { args || (args = slice.call(arguments)); - }, object); + }, { 'a': 1 }); assert.deepEqual(args, ['a']); }); @@ -1496,12 +1495,11 @@ QUnit.test('`fp.' + methodName + '` should provide `value` and `key` to `iteratee`', function(assert) { assert.expect(1); - var args, - object = { 'a': 1 }; + var args; func(function() { args || (args = slice.call(arguments)); - })(object); + })({ 'a': 1 }); assert.deepEqual(args, [1, 'a']); }); @@ -1542,7 +1540,7 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('fp.partial and fp.partialRight'); + QUnit.module('partial methods'); _.each(['partial', 'partialRight'], function(methodName) { var func = fp[methodName], @@ -1615,7 +1613,7 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('fp.reduce and fp.reduceRight'); + QUnit.module('reduce methods'); _.each(['reduce', 'reduceRight'], function(methodName) { var func = fp[methodName], @@ -1624,12 +1622,11 @@ QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an array', function(assert) { assert.expect(1); - var args, - array = [1, 2, 3]; + var args; func(function() { args || (args = slice.call(arguments)); - })(0)(array); + })(0)([1, 2, 3]); assert.deepEqual(args, isReduce ? [0, 1] : [0, 3]); }); From 9fa0ec00b8a5d1f2f26d26137c07318aa3a17477 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 23 Apr 2016 11:43:15 -0700 Subject: [PATCH 07/57] Remove unneeded var assignment. --- fp/_baseConvert.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index fd66bce153..e177cdd031 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -191,8 +191,7 @@ function baseConvert(util, name, func, options) { } var pairs = []; each(keys(source), function(key) { - var value = source[key]; - if (isFunction(value)) { + if (isFunction(source[key])) { pairs.push([key, func.prototype[key]]); } }); From f7c4410f41030ca9eab4794573f8f5a67662c211 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Apr 2016 23:56:00 -0700 Subject: [PATCH 08/57] Add support for converting maps to `_.toPairs` and `_.toPairsIn`. --- lodash.js | 26 +++++++++++++++++--------- test/test.js | 34 ++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/lodash.js b/lodash.js index 4d77d51abe..f71afa3014 100644 --- a/lodash.js +++ b/lodash.js @@ -2674,9 +2674,7 @@ */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); - return isArray(object) - ? result - : arrayPush(result, symbolsFunc(object)); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** @@ -4879,6 +4877,20 @@ return new Set(values); }; + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + return tag == mapTag ? mapToArray(object) : baseToPairs(object, keysFunc(object)); + }; + } + /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. @@ -12893,9 +12905,7 @@ * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ - function toPairs(object) { - return baseToPairs(object, keys(object)); - } + var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs @@ -12920,9 +12930,7 @@ * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) */ - function toPairsIn(object) { - return baseToPairs(object, keysIn(object)); - } + var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new diff --git a/test/test.js b/test/test.js index 0ecdcd572c..af1b71ff33 100644 --- a/test/test.js +++ b/test/test.js @@ -23256,15 +23256,6 @@ assert.deepEqual(actual, [['a', 1], ['b', 2]]); }); - QUnit.test('`_.' + methodName + '` should work with an object that has a `length` property', function(assert) { - assert.expect(1); - - var object = { '0': 'a', '1': 'b', 'length': 2 }, - actual = lodashStable.sortBy(func(object), 0); - - assert.deepEqual(actual, [['0', 'a'], ['1', 'b'], ['length', 2]]); - }); - QUnit.test('`_.' + methodName + '` should ' + (isToPairs ? 'not ' : '') + 'include inherited string keyed property values', function(assert) { assert.expect(1); @@ -23279,7 +23270,30 @@ assert.deepEqual(actual, expected); }); - QUnit.test('`_.' + methodName + '` should work with strings', function(assert) { + QUnit.test('`_.' + methodName + '` should convert objects with a `length` property', function(assert) { + assert.expect(1); + + var object = { '0': 'a', '1': 'b', 'length': 2 }, + actual = lodashStable.sortBy(func(object), 0); + + assert.deepEqual(actual, [['0', 'a'], ['1', 'b'], ['length', 2]]); + }); + + QUnit.test('`_.' + methodName + '` should convert maps', function(assert) { + assert.expect(1); + + if (Map) { + var map = new Map; + map.set('a', 1); + map.set('b', 2); + assert.deepEqual(func(map), [['a', 1], ['b', 2]]); + } + else { + skipAssert(assert); + } + }); + + QUnit.test('`_.' + methodName + '` should convert strings', function(assert) { assert.expect(2); lodashStable.each(['xo', Object('xo')], function(string) { From dc77d7605d05bbda9a46f14da4408e0f745385d8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Apr 2016 23:56:22 -0700 Subject: [PATCH 09/57] Add `_.toArray` tests for maps. --- test/test.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/test/test.js b/test/test.js index af1b71ff33..679e1bf46d 100644 --- a/test/test.js +++ b/test/test.js @@ -22784,14 +22784,6 @@ assert.deepEqual(_.toArray({ 'a': 1, 'b': 2 }), [1, 2]); }); - QUnit.test('should convert strings to arrays', function(assert) { - assert.expect(3); - - assert.deepEqual(_.toArray(''), []); - assert.deepEqual(_.toArray('ab'), ['a', 'b']); - assert.deepEqual(_.toArray(Object('ab')), ['a', 'b']); - }); - QUnit.test('should convert iterables to arrays', function(assert) { assert.expect(1); @@ -22806,6 +22798,28 @@ } }); + QUnit.test('should convert maps to arrays', function(assert) { + assert.expect(1); + + if (Map) { + var map = new Map; + map.set('a', 1); + map.set('b', 2); + assert.deepEqual(_.toArray(map), [['a', 1], ['b', 2]]); + } + else { + skipAssert(assert); + } + }); + + QUnit.test('should convert strings to arrays', function(assert) { + assert.expect(3); + + assert.deepEqual(_.toArray(''), []); + assert.deepEqual(_.toArray('ab'), ['a', 'b']); + assert.deepEqual(_.toArray(Object('ab')), ['a', 'b']); + }); + QUnit.test('should work in a lazy sequence', function(assert) { assert.expect(2); From 9aa456f26fd227cf7d91adfa0a1f6d07c75db37c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 25 Apr 2016 00:04:33 -0700 Subject: [PATCH 10/57] Use `lodashStable.toArray` in more places. --- test/test.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/test.js b/test/test.js index 679e1bf46d..0f8bb231eb 100644 --- a/test/test.js +++ b/test/test.js @@ -7582,7 +7582,7 @@ }, function(collection, key) { var isStr = typeof collection == 'string', - values = _.toArray(collection), + values = lodashStable.toArray(collection), length = values.length; QUnit.test('should work with ' + key + ' and return `true` for matched values', function(assert) { @@ -9905,7 +9905,7 @@ lodashStable.each([[map1, map2], [set1, set2]], function(pair, index) { if (pair[0]) { var argsList = [], - array = _.toArray(pair[0]); + array = lodashStable.toArray(pair[0]); var expected = [ [pair[0], pair[1]], @@ -10760,7 +10760,7 @@ lodashStable.each([[map1, map2], [set1, set2]], function(pair, index) { if (pair[0]) { var argsList = [], - array = _.toArray(pair[0]), + array = lodashStable.toArray(pair[0]), object1 = { 'a': pair[0] }, object2 = { 'a': pair[1] }; @@ -25308,7 +25308,7 @@ wrapped = chain(array); assert.strictEqual(wrapped[Symbol.iterator](), wrapped); - assert.deepEqual(_.toArray(wrapped), array); + assert.deepEqual(lodashStable.toArray(wrapped), array); } else { skipAssert(assert, 2); @@ -25339,12 +25339,12 @@ var array = [1, 2], wrapped = chain(array); - assert.deepEqual(_.toArray(wrapped), array); - assert.deepEqual(_.toArray(wrapped), [], 'produces an empty array for exhausted iterator'); + assert.deepEqual(lodashStable.toArray(wrapped), array); + assert.deepEqual(lodashStable.toArray(wrapped), [], 'produces an empty array for exhausted iterator'); var other = wrapped.filter(); - assert.deepEqual(_.toArray(other), array, 'reset for new chain segments'); - assert.deepEqual(_.toArray(wrapped), [], 'iterator is still exhausted'); + assert.deepEqual(lodashStable.toArray(other), array, 'reset for new chain segments'); + assert.deepEqual(lodashStable.toArray(wrapped), [], 'iterator is still exhausted'); } else { skipAssert(assert, 4); @@ -25360,10 +25360,10 @@ values = [], wrapped = chain(array); - assert.deepEqual(_.toArray(wrapped), array); + assert.deepEqual(lodashStable.toArray(wrapped), array); wrapped = wrapped.filter(predicate); - assert.deepEqual(_.toArray(wrapped), _.filter(array, isEven), 'reset for new lazy chain segments'); + assert.deepEqual(lodashStable.toArray(wrapped), _.filter(array, isEven), 'reset for new lazy chain segments'); assert.deepEqual(values, array, 'memoizes iterator values'); } else { @@ -25418,11 +25418,11 @@ array2 = [6, 8], wrapped1 = _(array1).map(square); - assert.deepEqual(_.toArray(wrapped1), [4, 16]); - assert.deepEqual(_.toArray(wrapped1), []); + assert.deepEqual(lodashStable.toArray(wrapped1), [4, 16]); + assert.deepEqual(lodashStable.toArray(wrapped1), []); var wrapped2 = wrapped1.plant(array2); - assert.deepEqual(_.toArray(wrapped2), [36, 64]); + assert.deepEqual(lodashStable.toArray(wrapped2), [36, 64]); } else { skipAssert(assert, 3); From 6f600ebeac7a98ddf47eef1594b4ac1de5635991 Mon Sep 17 00:00:00 2001 From: Clinton Montague Date: Tue, 26 Apr 2016 19:55:46 +0100 Subject: [PATCH 11/57] Add _.flip bitmask value to `createWrapper` documentation. [ci skip] --- lodash.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lodash.js b/lodash.js index f71afa3014..724e4f5732 100644 --- a/lodash.js +++ b/lodash.js @@ -4908,6 +4908,7 @@ * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` + * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. From cbcd5ffdc4c793a96aa1a95f3c16774281200c07 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 27 Apr 2016 08:04:33 -0700 Subject: [PATCH 12/57] Add node_js v6 to travis. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 161f0cdf88..0748d81f4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js sudo: false node_js: - - "5" + - "6" env: global: - BIN="node" ISTANBUL=false OPTION="" @@ -20,6 +20,8 @@ matrix: env: - node_js: "4" env: + - node_js: "5" + env: git: depth: 10 branches: From da146a9afdd0a07baeb3db393e485e2b754b8cd9 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 27 Apr 2016 10:25:02 -0700 Subject: [PATCH 13/57] Add map doc note to `_.toPairs` and `_.toPairsIn`. [ci skip] --- lodash.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 724e4f5732..dd0466f91f 100644 --- a/lodash.js +++ b/lodash.js @@ -12885,7 +12885,8 @@ /** * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. + * which can be consumed by `_.fromPairs`. If `object` is a map, its entries + * are returned. * * @static * @memberOf _ @@ -12910,7 +12911,8 @@ /** * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map, + * its entries are returned. * * @static * @memberOf _ From 8accfb3372b3dddaaf07664bc4c297d37a47c40b Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Wed, 27 Apr 2016 17:12:17 +0200 Subject: [PATCH 14/57] Update fs-extra to 0.30.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 914499d16d..e6e4941afd 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "docdown": "~0.5.1", "dojo": "^1.11.1", "ecstatic": "^1.4.0", - "fs-extra": "~0.28.0", + "fs-extra": "~0.30.0", "glob": "^7.0.3", "istanbul": "0.4.3", "jquery": "^2.2.3", From 816edcce2efbc43409107c51ae3f57ff57de7709 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 28 Apr 2016 14:55:25 -0700 Subject: [PATCH 15/57] Rename `getPlaceholder` to `getHolder`. --- lodash.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lodash.js b/lodash.js index dd0466f91f..d1029bf5f2 100644 --- a/lodash.js +++ b/lodash.js @@ -4468,7 +4468,7 @@ var length = arguments.length, args = Array(length), index = length, - placeholder = getPlaceholder(wrapper); + placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; @@ -4590,7 +4590,7 @@ args[index] = arguments[index]; } if (isCurried) { - var placeholder = getPlaceholder(wrapper), + var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { @@ -5262,6 +5262,18 @@ return result; } + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. @@ -5337,18 +5349,6 @@ return isNative(value) ? value : undefined; } - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getPlaceholder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - /** * Gets the `[[Prototype]]` of `value`. * @@ -9304,7 +9304,7 @@ var bind = rest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { - var holders = replaceHolders(partials, getPlaceholder(bind)); + var holders = replaceHolders(partials, getHolder(bind)); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); @@ -9358,7 +9358,7 @@ var bindKey = rest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { - var holders = replaceHolders(partials, getPlaceholder(bindKey)); + var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); @@ -9899,7 +9899,7 @@ * // => 'hi fred' */ var partial = rest(function(func, partials) { - var holders = replaceHolders(partials, getPlaceholder(partial)); + var holders = replaceHolders(partials, getHolder(partial)); return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); }); @@ -9936,7 +9936,7 @@ * // => 'hello fred' */ var partialRight = rest(function(func, partials) { - var holders = replaceHolders(partials, getPlaceholder(partialRight)); + var holders = replaceHolders(partials, getHolder(partialRight)); return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); From 59546b998904ffed4af1eebe76f9fdce4bae4135 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 28 Apr 2016 21:26:46 -0700 Subject: [PATCH 16/57] Update conduct link in contributing text. [ci skip] --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b3427fd5cb..c985592aae 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,8 +1,8 @@ # Contributing to Lodash Contributions are always welcome. Before contributing please read the -[code of conduct](https://github.com/lodash/lodash/blob/master/CODE_OF_CONDUCT.md) -& [search the issue tracker](https://github.com/lodash/lodash/issues); your issue +[code of conduct](https://jquery.org/conduct/) & +[search the issue tracker](https://github.com/lodash/lodash/issues); your issue may have already been discussed or fixed in `master`. To contribute, [fork](https://help.github.com/articles/fork-a-repo/) Lodash, commit your changes, & [send a pull request](https://help.github.com/articles/using-pull-requests/). From e9a08ba9a9baf81f1c1bb6818faf99766c83c3ac Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 28 Apr 2016 21:30:22 -0700 Subject: [PATCH 17/57] Use https for Alex's blog. [ci skip] --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c985592aae..067b3943e8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -36,7 +36,7 @@ As such, we request that all contributors sign the jQuery Foundation [contributor license agreement (CLA)](https://contribute.jquery.org/CLA/). For more information about CLAs, please check out Alex Russell’s excellent post, -[“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/). +[“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/). ## Coding Guidelines From 6c6e1c2be31f2b063ef9ae9c81d4f522d5e9d153 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 28 Apr 2016 22:08:28 -0700 Subject: [PATCH 18/57] Use `array` and `iteratee`. [ci skip] --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 067b3943e8..e12c9cdc5d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -48,7 +48,7 @@ established in the code. - **Naming**:
Keep variable & method names concise & descriptive.
- Variable names `index`, `collection`, & `callback` are preferable to + Variable names `index`, `array`, & `iteratee` are preferable to `i`, `arr`, & `fn`. - **Quotes**:
From ef1024bb60d15b5215b44a2c6a319e454b514d6a Mon Sep 17 00:00:00 2001 From: Nick Johnstone Date: Fri, 29 Apr 2016 19:27:51 +0200 Subject: [PATCH 19/57] Test documentation with markdown-doctest. --- .markdown-doctest-setup.js | 53 ++++++++++++++++++++++++++++++++++++++ lodash.js | 12 ++++----- package.json | 4 ++- 3 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 .markdown-doctest-setup.js diff --git a/.markdown-doctest-setup.js b/.markdown-doctest-setup.js new file mode 100644 index 0000000000..361088748a --- /dev/null +++ b/.markdown-doctest-setup.js @@ -0,0 +1,53 @@ +var _ = require(__dirname); + +function jQuery () { + return { + on: function (ev, cb) { + cb() + } + } +} + +jQuery.each = function (items, f) { + items.forEach(f) +} + +module.exports = { + globals: { + '_': _, + + asyncSave: _.noop, + addContactToList: _.noop, + calculateLayout: _.noop, + createApplication: _.noop, + updatePosition: _.noop, + sendMail: _.noop, + renewToken: _.noop, + batchLog: _.noop, + + setImmediate: setImmediate, + Buffer: Buffer, + EventSource: function () {}, + + fs: {writeFileSync: _.noop}, + path: {join: _.noop}, + + cwd: __dirname, + mainText: '', + data: {user: 'mock'}, + + document: { + body: { + childNodes: [], + nodeName: 'body' + } + }, + + jQuery: jQuery, + + element: {}, + window: {} + }, + + babel: false +} diff --git a/lodash.js b/lodash.js index d1029bf5f2..227cc48437 100644 --- a/lodash.js +++ b/lodash.js @@ -13908,12 +13908,6 @@ * compiled({ 'user': 'pebbles' }); * // => 'hello pebbles!' * - * // Use custom template delimiters. - * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; - * var compiled = _.template('hello {{ user }}!'); - * compiled({ 'user': 'mustache' }); - * // => 'hello mustache!' - * * // Use backslashes to treat delimiters as plain text. * var compiled = _.template('<%= "\\<%- value %\\>" %>'); * compiled({ 'value': 'ignored' }); @@ -13939,6 +13933,12 @@ * // return __p; * // } * + * // Use custom template delimiters. + * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; + * var compiled = _.template('hello {{ user }}!'); + * compiled({ 'user': 'mustache' }); + * // => 'hello mustache!' + * * // Use the `source` property to inline compiled templates for meaningful * // line numbers in error messages and stack traces. * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ diff --git a/package.json b/package.json index e6e4941afd..acc2ef2517 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build:fp-modules": "node lib/fp/build-modules.js", "build:main": "node lib/main/build-dist.js", "build:main-modules": "node lib/main/build-modules.js", - "doc": "node lib/main/build-doc github", + "doc": "node lib/main/build-doc github && npm run test:docs", "doc:fp": "node lib/fp/build-doc", "doc:site": "node lib/main/build-doc site", "pretest": "npm run build", @@ -22,6 +22,7 @@ "test": "npm run test:main && npm run test:fp", "test:fp": "node test/test-fp", "test:main": "node test/test", + "test:docs": "markdown-doctest", "validate": "npm run style && npm run test" }, "devDependencies": { @@ -40,6 +41,7 @@ "jquery": "^2.2.3", "jscs": "^3.0.1", "lodash": "4.10.0", + "markdown-doctest": "^0.3.4", "platform": "^1.3.1", "qunit-extras": "^1.5.0", "qunitjs": "~1.23.1", From c3c6bc9666d30b2846d3f4ecc982e89a61df98e2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 29 Apr 2016 11:57:41 -0700 Subject: [PATCH 20/57] Cleanup markdown-doctest-setup. --- .markdown-doctest-setup.js | 77 +++++++++++++++++--------------------- lodash.js | 2 +- package.json | 4 +- 3 files changed, 37 insertions(+), 46 deletions(-) diff --git a/.markdown-doctest-setup.js b/.markdown-doctest-setup.js index 361088748a..b525cfd5c8 100644 --- a/.markdown-doctest-setup.js +++ b/.markdown-doctest-setup.js @@ -1,53 +1,44 @@ -var _ = require(__dirname); +var _ = require('./lodash.js'); -function jQuery () { +function mockQuery() { return { - on: function (ev, cb) { - cb() + 'on': function(eventName, callback) { + callback(); } - } + }; } -jQuery.each = function (items, f) { - items.forEach(f) -} +mockQuery.each = _.each; module.exports = { - globals: { + 'babel': false, + 'globals': { '_': _, - asyncSave: _.noop, - addContactToList: _.noop, - calculateLayout: _.noop, - createApplication: _.noop, - updatePosition: _.noop, - sendMail: _.noop, - renewToken: _.noop, - batchLog: _.noop, - - setImmediate: setImmediate, - Buffer: Buffer, - EventSource: function () {}, - - fs: {writeFileSync: _.noop}, - path: {join: _.noop}, - - cwd: __dirname, - mainText: '', - data: {user: 'mock'}, - - document: { - body: { - childNodes: [], - nodeName: 'body' - } - }, - - jQuery: jQuery, - - element: {}, - window: {} - }, - - babel: false + // Example mocks. + 'asyncSave': _.noop, + 'addContactToList': _.noop, + 'batchLog': _.noop, + 'calculateLayout': _.noop, + 'createApplication': _.noop, + 'data': { 'user': 'mock'}, + 'mainText': '', + 'renewToken': _.noop, + 'sendMail': _.noop, + 'updatePosition': _.noop, + + // DOM mocks. + 'document': { 'body': { 'childNodes': [], 'nodeName': 'BODY' } }, + 'element': {}, + 'EventSource': _.noop, + 'jQuery': mockQuery, + 'window': {}, + + // Node.js mocks. + 'Buffer': Buffer, + 'fs': { 'writeFileSync': _.noop }, + 'path': require('path'), + 'process': process, + 'setImmediate': setImmediate + } } diff --git a/lodash.js b/lodash.js index 227cc48437..61bbe228b6 100644 --- a/lodash.js +++ b/lodash.js @@ -13941,7 +13941,7 @@ * * // Use the `source` property to inline compiled templates for meaningful * // line numbers in error messages and stack traces. - * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ + * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ * var JST = {\ * "main": ' + _.template(mainText).source + '\ * };\ diff --git a/package.json b/package.json index acc2ef2517..d39f5244a6 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build:fp-modules": "node lib/fp/build-modules.js", "build:main": "node lib/main/build-dist.js", "build:main-modules": "node lib/main/build-modules.js", - "doc": "node lib/main/build-doc github && npm run test:docs", + "doc": "node lib/main/build-doc github && npm run test:doc", "doc:fp": "node lib/fp/build-doc", "doc:site": "node lib/main/build-doc site", "pretest": "npm run build", @@ -20,9 +20,9 @@ "style:perf": "jscs perf/*.js perf/**/*.js", "style:test": "jscs test/*.js test/**/*.js", "test": "npm run test:main && npm run test:fp", + "test:doc": "markdown-doctest", "test:fp": "node test/test-fp", "test:main": "node test/test", - "test:docs": "markdown-doctest", "validate": "npm run style && npm run test" }, "devDependencies": { From 7ee4bf8d02acb464da3b22af85b86982860b6498 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Sat, 30 Apr 2016 16:02:58 +0200 Subject: [PATCH 21/57] Remove duplicate method from FP mapping. --- fp/_mapping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fp/_mapping.js b/fp/_mapping.js index 18a3196d30..178e4d6d4a 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -64,7 +64,7 @@ exports.aryMethod = { 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', - 'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', + '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', From 963e2c23b0183080a1f90c7f653285c9299876eb Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 30 Apr 2016 11:59:06 -0700 Subject: [PATCH 22/57] Upgrade to qunit-extras 2.0. --- package.json | 2 +- test/test-fp.js | 31 ++++++++----------------------- test/test.js | 11 +++-------- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index d39f5244a6..af441b22c6 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "lodash": "4.10.0", "markdown-doctest": "^0.3.4", "platform": "^1.3.1", - "qunit-extras": "^1.5.0", + "qunit-extras": "^2.0.0", "qunitjs": "~1.23.1", "request": "^2.69.0", "requirejs": "^2.2.0", diff --git a/test/test-fp.js b/test/test-fp.js index f4354795aa..6a471bf7b9 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -14,10 +14,8 @@ /** Method and object shortcuts. */ var phantom = root.phantom, - amd = root.define && define.amd, argv = root.process && process.argv, document = !phantom && root.document, - noop = function() {}, slice = arrayProto.slice, WeakMap = root.WeakMap; @@ -26,30 +24,17 @@ /*--------------------------------------------------------------------------*/ - /** Use a single "load" function. */ - var load = (!amd && typeof require == 'function') - ? require - : noop; + /** Load QUnit and extras. */ + var QUnit = root.QUnit || require('qunit-extras'); - /** The unit testing framework. */ - var QUnit = root.QUnit || (root.QUnit = ( - QUnit = load('../node_modules/qunitjs/qunit/qunit.js') || root.QUnit, - QUnit = QUnit.QUnit || QUnit - )); - - /** Load stable Lodash and QUnit Extras. */ - var _ = root._ || (root._ = ( - _ = load('../lodash.js'), + /** Load stable Lodash. */ + var _ = root._ || ( + _ = require('../lodash.js'), _.runInContext(root) - )); - - var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js'); - if (QUnitExtras) { - QUnitExtras.runInContext(root); - } + ); var convert = (function() { - var baseConvert = root.fp || load('../fp/_baseConvert.js'); + var baseConvert = root.fp || require('../fp/_baseConvert.js'); if (!root.fp) { return function(name, func, options) { return baseConvert(_, name, func, options); @@ -79,7 +64,7 @@ ? (fp = _.noConflict(), _ = root._, fp) : convert(_.runInContext()); - var mapping = root.mapping || load('../fp/_mapping.js'); + var mapping = root.mapping || require('../fp/_mapping.js'); /*--------------------------------------------------------------------------*/ diff --git a/test/test.js b/test/test.js index 0f8bb231eb..2e6bf6c50d 100644 --- a/test/test.js +++ b/test/test.js @@ -300,10 +300,10 @@ ? require : noop; - /** The unit testing framework. */ - var QUnit = root.QUnit || (root.QUnit = load('../node_modules/qunitjs/qunit/qunit.js')); + /** Load QUnit and extras. */ + var QUnit = root.QUnit || load('qunit-extras'); - /** Load stable Lodash and QUnit Extras. */ + /** Load stable Lodash. */ var lodashStable = root.lodashStable; if (!lodashStable) { try { @@ -316,11 +316,6 @@ } lodashStable = lodashStable.runInContext(root); - var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js'); - if (QUnitExtras) { - QUnitExtras.runInContext(root); - } - /** The `lodash` function to test. */ var _ = root._ || (root._ = ( _ = load(filePath), From 9e30cc454265c836f9d783b81dcf44433f2ee2b9 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Sat, 30 Apr 2016 22:02:58 -0500 Subject: [PATCH 23/57] Fix docs typo space after sentence in `_.merge`. --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 61bbe228b6..18f21915c5 100644 --- a/lodash.js +++ b/lodash.js @@ -12600,7 +12600,7 @@ * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties - * are merged recursively.Other objects and value types are overridden by + * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * From 8e44d73705acb0024f702e7dc2f4fc03aaba825d Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Mon, 2 May 2016 03:17:42 +0200 Subject: [PATCH 24/57] Update markdown-doctest to 0.4.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index af441b22c6..3679d191fb 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "jquery": "^2.2.3", "jscs": "^3.0.1", "lodash": "4.10.0", - "markdown-doctest": "^0.3.4", + "markdown-doctest": "^0.4.0", "platform": "^1.3.1", "qunit-extras": "^2.0.0", "qunitjs": "~1.23.1", From c2aee218d202f23e382b22375e03cabea874302b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 1 May 2016 19:11:49 -0700 Subject: [PATCH 25/57] Add `promise` case to code removal for coverage run. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0748d81f4a..5d49ec1626 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ before_install: PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|" PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|" PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|" - PATTERN[4]="|\bcase\s+(?:dataView|set|map|weakMap)CtorString:.+|g" + PATTERN[4]="|\bcase\s+(?:dataView|promise|set|map|weakMap)CtorString:.+|g" PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|" PATTERN[6]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|" PATTERN[7]="|\s*define\([\s\S]+?\);|" From 6883f991419a806444dce3770abc3b046696f736 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 1 May 2016 19:12:03 -0700 Subject: [PATCH 26/57] Add tests for map caches. --- test/test.js | 100 +++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/test/test.js b/test/test.js index 2e6bf6c50d..1fab8ebff3 100644 --- a/test/test.js +++ b/test/test.js @@ -686,8 +686,12 @@ if (isModularize && !(amd || isNpm)) { lodashStable.each([ '_baseEach', + '_Hash', '_isIndex', - '_isIterateeCall' + '_isIterateeCall', + '_ListCache', + '_MapCache', + '_Stack' ], function(relPath) { var func = require(path.join(basePath, relPath)), funcName = path.basename(relPath); @@ -994,6 +998,55 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('map caches'); + + lodashStable.each(['_Hash', '_ListCache', '_MapCache', '_Stack'], function(ctorName) { + var Ctor = _[ctorName]; + + QUnit.test('`' + ctorName + '` should implement a `Map` interface', function(assert) { + assert.expect(82); + + var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}]; + + var pairs = lodashStable.map(keys, function(key, index) { + var lastIndex = keys.length - 1; + return [key, keys[lastIndex - index]]; + }); + + var cache = Ctor ? new Ctor(pairs) : undefined; + + lodashStable.each(keys, function(key, index) { + if (cache) { + var value = pairs[index][1]; + + assert.deepEqual(cache.get(key), value); + assert.strictEqual(cache.has(key), true); + assert.strictEqual(cache['delete'](key), true); + assert.strictEqual(cache.has(key), false); + assert.strictEqual(cache.get(key), undefined); + assert.strictEqual(cache['delete'](key), false); + assert.strictEqual(cache.set(key, value), cache); + assert.strictEqual(cache.has(key), true); + } + else { + skipAssert(assert, 8); + } + }); + + if (cache) { + assert.strictEqual(cache.clear(), undefined); + assert.ok(lodashStable.every(keys, function(key) { + return !cache.has(key); + })); + } + else { + skipAssert(assert, 2); + } + }); + }); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash constructor'); (function() { @@ -14576,51 +14629,6 @@ _.memoize.Cache = oldCache; }); - - QUnit.test('should implement a `Map` interface on the cache object', function(assert) { - assert.expect(164); - - var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}]; - - var pairs = lodashStable.map(keys, function(key, index) { - var lastIndex = keys.length - 1; - return [key, keys[lastIndex - index]]; - }); - - lodashStable.times(2, function(index) { - var memoize = (index ? (lodashBizarro || {}) : _).memoize, - Cache = memoize ? memoize.Cache : undefined, - cache = Cache ? new Cache(pairs) : undefined; - - lodashStable.each(keys, function(key, index) { - if (cache) { - var value = pairs[index][1]; - - assert.deepEqual(cache.get(key), value); - assert.strictEqual(cache.has(key), true); - assert.strictEqual(cache['delete'](key), true); - assert.strictEqual(cache.has(key), false); - assert.strictEqual(cache.get(key), undefined); - assert.strictEqual(cache['delete'](key), false); - assert.strictEqual(cache.set(key, value), cache); - assert.strictEqual(cache.has(key), true); - } - else { - skipAssert(assert, 8); - } - }); - - if (cache) { - assert.strictEqual(cache.clear(), undefined); - assert.ok(lodashStable.every(keys, function(key) { - return !cache.has(key); - })); - } - else { - skipAssert(assert, 2); - } - }); - }); }()); /*--------------------------------------------------------------------------*/ From b9cfd31bd5c147ca294ff4bc877738892803a3d4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 1 May 2016 20:55:44 -0700 Subject: [PATCH 27/57] Add modular build to coverage tests. --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d49ec1626..98c14f6cbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,15 +58,16 @@ before_install: - "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../" - "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js" script: + - "([ $SAUCE_LABS == true ] || [ $ISTANBUL == true ]) && rm -rf ./node_modules/lodash" + - "[ $ISTANBUL == false ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./node_modules/lodash && node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/lodash.js)" - "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js" - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true" - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true" - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || cd ./test" - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js" - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js" - - "[ $SAUCE_LABS == false ] || rm -rf ./node_modules/lodash" - - "[ $SAUCE_LABS == false ] || ($BIN ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js && cd ./node_modules/lodash/ && ln -s ./index.js ./lodash.js && cd ../../)" - - "[ $SAUCE_LABS == false ] || $BIN ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js" + - "[ $SAUCE_LABS == false ] || (node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js && cd ./node_modules/lodash/ && ln -s ./index.js ./lodash.js && cd ../../)" + - "[ $SAUCE_LABS == false ] || node ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js" - "[ $SAUCE_LABS == false ] || npm run build" - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\"" - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\"" From edd7c2f0b165e1c9d32f0118fd360476dbaf8485 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 1 May 2016 22:23:19 -0700 Subject: [PATCH 28/57] Cleanup travis tests. --- .travis.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98c14f6cbd..232eea4819 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,18 +55,24 @@ before_install: node ./test/remove.js "$PTRN" ./lodash.js done fi - - "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../" - - "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js" + - "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli" + - "mkdir -p ./node_modules/lodash-cli/node_modules/lodash && cd $_ && cp ../../../../lodash.js ./lodash.js && cp ../../../../package.json ./package.json" + - "cd ../../ && npm i && cd ../../" script: - - "([ $SAUCE_LABS == true ] || [ $ISTANBUL == true ]) && rm -rf ./node_modules/lodash" - - "[ $ISTANBUL == false ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./node_modules/lodash && node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/lodash.js)" + +# Detect code coverage. + - "[ $SAUCE_LABS == true ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./ && node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js)" - "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js" - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true" - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true" - - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || cd ./test" - - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js" - - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js" - - "[ $SAUCE_LABS == false ] || (node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js && cd ./node_modules/lodash/ && ln -s ./index.js ./lodash.js && cd ../../)" + +# Test in Node.js and PhantomJS. + - "[ $ISTANBUL == true ] || node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js" + - "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || cd ./test" + - "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || $BIN $OPTION ./test.js ../lodash.js" + - "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js" + +# Test in Sauce Labs. - "[ $SAUCE_LABS == false ] || node ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js" - "[ $SAUCE_LABS == false ] || npm run build" - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\"" From 767f9c6bcedf1ae87d759a84be1e2208ff59ecb8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 1 May 2016 23:37:13 -0700 Subject: [PATCH 29/57] Simplify module assignment. --- test/test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test.js b/test/test.js index 1fab8ebff3..1a71a75a77 100644 --- a/test/test.js +++ b/test/test.js @@ -692,10 +692,8 @@ '_ListCache', '_MapCache', '_Stack' - ], function(relPath) { - var func = require(path.join(basePath, relPath)), - funcName = path.basename(relPath); - + ], function(funcName) { + var func = require(path.join(basePath, funcName)); _['_' + funcName] = func[funcName] || func['default'] || func; }); } From 6d70b64b2e13dceeeeb90f200cc0c44818011505 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 00:00:19 -0700 Subject: [PATCH 30/57] Ensure module tests ran for coverage. --- test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 1a71a75a77..5e51d02f7f 100644 --- a/test/test.js +++ b/test/test.js @@ -683,7 +683,7 @@ var path = require('path'), basePath = path.dirname(filePath); - if (isModularize && !(amd || isNpm)) { + if (coverage || (isModularize && !(amd || isNpm))) { lodashStable.each([ '_baseEach', '_Hash', @@ -15969,7 +15969,7 @@ QUnit.test('should work with a `root` of `this`', function(assert) { assert.expect(2); - if (!isModularize && !coverage && (!document && realm.object)) { + if (!coverage && !document && !isModularize && realm.object) { var fs = require('fs'), vm = require('vm'), expected = {}, From 2e59faad8f5248985d53758b0c0eba2a4fb311b0 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 00:34:58 -0700 Subject: [PATCH 31/57] Fix module paths. --- test/test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/test.js b/test/test.js index 5e51d02f7f..88a2cd78f9 100644 --- a/test/test.js +++ b/test/test.js @@ -685,15 +685,15 @@ if (coverage || (isModularize && !(amd || isNpm))) { lodashStable.each([ - '_baseEach', - '_Hash', - '_isIndex', - '_isIterateeCall', - '_ListCache', - '_MapCache', - '_Stack' + 'baseEach', + 'Hash', + 'isIndex', + 'isIterateeCall', + 'ListCache', + 'MapCache', + 'Stack' ], function(funcName) { - var func = require(path.join(basePath, funcName)); + var func = require(path.join(basePath, '_' + funcName)); _['_' + funcName] = func[funcName] || func['default'] || func; }); } From c7d4106f66e58692ddaab8c45446b39374f77ba7 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 07:15:32 -0700 Subject: [PATCH 32/57] Add `private` tags back to map methods. [ci skip] --- lodash.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lodash.js b/lodash.js index 18f21915c5..a3dd6de577 100644 --- a/lodash.js +++ b/lodash.js @@ -1689,6 +1689,7 @@ /** * Removes all key-value entries from the hash. * + * @private * @name clear * @memberOf Hash */ @@ -1699,6 +1700,7 @@ /** * Removes `key` and its value from the hash. * + * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. @@ -1712,6 +1714,7 @@ /** * Gets the hash value for `key`. * + * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. @@ -1729,6 +1732,7 @@ /** * Checks if a hash value for `key` exists. * + * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. @@ -1742,6 +1746,7 @@ /** * Sets the hash `key` to `value`. * + * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. @@ -1784,6 +1789,7 @@ /** * Removes all key-value entries from the list cache. * + * @private * @name clear * @memberOf ListCache */ @@ -1794,6 +1800,7 @@ /** * Removes `key` and its value from the list cache. * + * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. @@ -1818,6 +1825,7 @@ /** * Gets the list cache value for `key`. * + * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. @@ -1833,6 +1841,7 @@ /** * Checks if a list cache value for `key` exists. * + * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. @@ -1845,6 +1854,7 @@ /** * Sets the list cache `key` to `value`. * + * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. @@ -1893,6 +1903,7 @@ /** * Removes all key-value entries from the map. * + * @private * @name clear * @memberOf MapCache */ @@ -1920,6 +1931,7 @@ /** * Gets the map value for `key`. * + * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. @@ -1932,6 +1944,7 @@ /** * Checks if a map value for `key` exists. * + * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. @@ -1944,6 +1957,7 @@ /** * Sets the map `key` to `value`. * + * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. @@ -1985,6 +1999,7 @@ /** * Adds `value` to the array cache. * + * @private * @name add * @memberOf SetCache * @alias push @@ -1999,6 +2014,7 @@ /** * Checks if `value` is in the array cache. * + * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. @@ -2028,6 +2044,7 @@ /** * Removes all key-value entries from the stack. * + * @private * @name clear * @memberOf Stack */ @@ -2038,6 +2055,7 @@ /** * Removes `key` and its value from the stack. * + * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. @@ -2050,6 +2068,7 @@ /** * Gets the stack value for `key`. * + * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. @@ -2062,6 +2081,7 @@ /** * Checks if a stack value for `key` exists. * + * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. @@ -2074,6 +2094,7 @@ /** * Sets the stack `key` to `value`. * + * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. From a13d640bcc67d933cae1b30cfc01fbc3f3f6d8b6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 07:39:29 -0700 Subject: [PATCH 33/57] Test internal caches instead of cache modules. --- test/test.js | 58 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/test/test.js b/test/test.js index 88a2cd78f9..2bc1d5a3a9 100644 --- a/test/test.js +++ b/test/test.js @@ -683,15 +683,11 @@ var path = require('path'), basePath = path.dirname(filePath); - if (coverage || (isModularize && !(amd || isNpm))) { + if (isModularize && !(amd || isNpm)) { lodashStable.each([ 'baseEach', - 'Hash', 'isIndex', - 'isIterateeCall', - 'ListCache', - 'MapCache', - 'Stack' + 'isIterateeCall' ], function(funcName) { var func = require(path.join(basePath, '_' + funcName)); _['_' + funcName] = func[funcName] || func['default'] || func; @@ -998,23 +994,35 @@ QUnit.module('map caches'); - lodashStable.each(['_Hash', '_ListCache', '_MapCache', '_Stack'], function(ctorName) { - var Ctor = _[ctorName]; + (function() { + var MapCache = _.memoize.Cache; - QUnit.test('`' + ctorName + '` should implement a `Map` interface', function(assert) { - assert.expect(82); + var caches = { + 'Hash': new MapCache().__data__.hash.constructor, + 'MapCache': MapCache + }; - var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}]; + var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}]; - var pairs = lodashStable.map(keys, function(key, index) { - var lastIndex = keys.length - 1; - return [key, keys[lastIndex - index]]; - }); + var pairs = lodashStable.map(keys, function(key, index) { + var lastIndex = keys.length - 1; + return [key, keys[lastIndex - index]]; + }); + + _.isMatchWith({ 'a': 1 }, { 'a': 1 }, function() { + var stack = lodashStable.last(arguments); + caches.ListCache = stack.__data__.constructor; + caches.Stack = stack.constructor; + }); - var cache = Ctor ? new Ctor(pairs) : undefined; + lodashStable.each(['Hash', 'ListCache', 'MapCache', 'Stack'], function(ctorName) { + QUnit.test('`' + ctorName + '` should implement a `Map` interface', function(assert) { + assert.expect(82); - lodashStable.each(keys, function(key, index) { - if (cache) { + var Ctor = caches[ctorName], + cache = new Ctor(pairs); + + lodashStable.each(keys, function(key, index) { var value = pairs[index][1]; assert.deepEqual(cache.get(key), value); @@ -1025,23 +1033,15 @@ assert.strictEqual(cache['delete'](key), false); assert.strictEqual(cache.set(key, value), cache); assert.strictEqual(cache.has(key), true); - } - else { - skipAssert(assert, 8); - } - }); + }); - if (cache) { assert.strictEqual(cache.clear(), undefined); assert.ok(lodashStable.every(keys, function(key) { return !cache.has(key); })); - } - else { - skipAssert(assert, 2); - } + }); }); - }); + }()); /*--------------------------------------------------------------------------*/ From d1779d6cdd54d698fa34fc364e2a11a956285a25 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 10:01:17 -0700 Subject: [PATCH 34/57] Fix phantomjs test fails. --- test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 2bc1d5a3a9..29d056ec69 100644 --- a/test/test.js +++ b/test/test.js @@ -1002,7 +1002,7 @@ 'MapCache': MapCache }; - var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}]; + var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || noop]; var pairs = lodashStable.map(keys, function(key, index) { var lastIndex = keys.length - 1; @@ -2693,7 +2693,7 @@ assert.expect(164); var Stack, - keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}]; + keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || noop]; var pairs = lodashStable.map(keys, function(key, index) { var lastIndex = keys.length - 1; From 44927be6e2dbe7a30cf3815982d534fc2912e816 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 10:52:53 -0700 Subject: [PATCH 35/57] Drop version from license header. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index a3dd6de577..b2e417a109 100644 --- a/lodash.js +++ b/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.11.2 + * lodash * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 From 05c32044e970cd04f9c8422531217e9a9af77b4f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 13:08:51 -0700 Subject: [PATCH 36/57] Remove extraneous `isArrayLikeObject` check from `isFlattenable`. --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index b2e417a109..79affe98c0 100644 --- a/lodash.js +++ b/lodash.js @@ -5619,7 +5619,7 @@ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + return isArray(value) || isArguments(value); } /** From ce8a1feb947b025a54b33fcd240a27b18985a3ee Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 13:31:03 -0700 Subject: [PATCH 37/57] Avoid paving modified lodash for coverage runs in travis. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 232eea4819..476e2e202f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,13 +61,13 @@ before_install: script: # Detect code coverage. - - "[ $SAUCE_LABS == true ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./ && node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js)" - "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js" - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true" - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true" # Test in Node.js and PhantomJS. - "[ $ISTANBUL == true ] || node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js" + - "[ $ISTANBUL == true ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./ && node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js)" - "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || cd ./test" - "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || $BIN $OPTION ./test.js ../lodash.js" - "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js" From 71f5264ee17730c196727928c45ebd5faab69744 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 16:50:10 -0700 Subject: [PATCH 38/57] Cleanup `returns` tags. [ci skip] --- lodash.js | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/lodash.js b/lodash.js index 79affe98c0..bb6f8980ce 100644 --- a/lodash.js +++ b/lodash.js @@ -883,7 +883,7 @@ * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. + * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { @@ -896,7 +896,7 @@ * * @private * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { @@ -1088,11 +1088,11 @@ } /** - * Converts `map` to an array. + * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. + * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, @@ -1130,11 +1130,11 @@ } /** - * Converts `set` to an array. + * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. + * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, @@ -2226,7 +2226,7 @@ * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths of elements to pick. - * @returns {Array} Returns the new array of picked elements. + * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, @@ -2341,7 +2341,7 @@ * * @private * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source), @@ -2654,7 +2654,7 @@ * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. + * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { @@ -3087,7 +3087,7 @@ * * @private * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); @@ -3105,7 +3105,7 @@ * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { @@ -3320,7 +3320,7 @@ * * @private * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { @@ -3333,7 +3333,7 @@ * * @private * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { @@ -3434,7 +3434,7 @@ * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the new array of numbers. + * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, @@ -4148,7 +4148,7 @@ * placeholders, and provided arguments into a single array of arguments. * * @private - * @param {Array|Object} args The provided arguments. + * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. @@ -4183,7 +4183,7 @@ * is tailored for `_.partialRight`. * * @private - * @param {Array|Object} args The provided arguments. + * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. @@ -4404,7 +4404,7 @@ * * @private * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { @@ -4700,7 +4700,7 @@ * * @private * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new invoker function. + * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return rest(function(iteratees) { @@ -5763,7 +5763,7 @@ * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { @@ -6015,7 +6015,7 @@ * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array containing chunks. + * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); @@ -7707,7 +7707,7 @@ * @memberOf _ * @since 0.1.0 * @category Array - * @param {Array} array The array to filter. + * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor @@ -7733,7 +7733,7 @@ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. + * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * @@ -7757,7 +7757,7 @@ * @param {...Array} [arrays] The arrays to inspect. * @param {Array|Function|Object|string} [iteratee=_.identity] * The iteratee invoked per element. - * @returns {Array} Returns the new array of values. + * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); @@ -7786,7 +7786,7 @@ * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. + * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; @@ -9241,7 +9241,7 @@ * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); @@ -9705,7 +9705,7 @@ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { @@ -9738,7 +9738,7 @@ * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. + * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; @@ -9796,7 +9796,7 @@ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { @@ -10159,7 +10159,7 @@ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); @@ -11919,7 +11919,7 @@ * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths of elements to pick. - * @returns {Array} Returns the new array of picked elements. + * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; @@ -12241,7 +12241,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. + * @returns {Array} Returns the function names. * @see _.functionsIn * @example * @@ -12268,7 +12268,7 @@ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. + * @returns {Array} Returns the function names. * @see _.functions * @example * @@ -12915,7 +12915,7 @@ * @alias entries * @category Object * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. + * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { @@ -12941,7 +12941,7 @@ * @alias entriesIn * @category Object * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. + * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { @@ -13784,7 +13784,7 @@ * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the new array of string segments. + * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); @@ -14498,7 +14498,7 @@ * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new composite function. * @example * * var func = _.cond([ @@ -14548,7 +14548,7 @@ * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ @@ -14571,7 +14571,7 @@ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new constant function. * @example * * var object = { 'user': 'fred' }; @@ -14596,7 +14596,7 @@ * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new composite function. * @see _.flowRight * @example * @@ -14619,7 +14619,7 @@ * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new composite function. * @see _.flow * @example * @@ -14712,7 +14712,7 @@ * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ @@ -14740,7 +14740,7 @@ * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ @@ -14765,7 +14765,7 @@ * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new invoker function. * @example * * var objects = [ @@ -14796,7 +14796,7 @@ * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new invoker function. * @example * * var array = _.times(3, _.constant), @@ -14934,7 +14934,7 @@ * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new pass-thru function. * @example * * var func = _.nthArg(1); @@ -15032,7 +15032,7 @@ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. * @example * * var objects = [ @@ -15059,7 +15059,7 @@ * @since 3.0.0 * @category Util * @param {Object} object The object to query. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. * @example * * var array = [0, 1, 2], @@ -15093,7 +15093,7 @@ * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. + * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * @@ -15131,7 +15131,7 @@ * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. + * @returns {Array} Returns the range of numbers. * @see _.inRange, _.range * @example * From 264d68dec9c640dda633c2ac5cc9101cf37a6c9f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 16:53:17 -0700 Subject: [PATCH 39/57] Add support for sets to `_.toPairs` methods. --- lodash.js | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/lodash.js b/lodash.js index bb6f8980ce..397a2928f3 100644 --- a/lodash.js +++ b/lodash.js @@ -1146,6 +1146,23 @@ return result; } + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + /** * Gets the number of symbols in `string`. * @@ -4908,7 +4925,13 @@ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); - return tag == mapTag ? mapToArray(object) : baseToPairs(object, keysFunc(object)); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); }; } @@ -12906,8 +12929,8 @@ /** * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map, its entries - * are returned. + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. * * @static * @memberOf _ @@ -12932,8 +12955,8 @@ /** * 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, - * its entries are returned. + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. * * @static * @memberOf _ From b8fa0d9b29a0297db6c1a7d23a9507abfc95a05e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 19:42:23 -0700 Subject: [PATCH 40/57] Add large stack test to other cache tests. --- test/test.js | 83 +++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/test/test.js b/test/test.js index 29d056ec69..8ca93390ee 100644 --- a/test/test.js +++ b/test/test.js @@ -323,6 +323,21 @@ (_.runInContext ? _.runInContext(root) : _) )); + /** Used to test pseudo private map caches. */ + var mapCaches = (function() { + var MapCache = _.memoize.Cache; + var result = { + 'Hash': new MapCache().__data__.hash.constructor, + 'MapCache': MapCache + }; + _.isMatchWith({ 'a': 1 }, { 'a': 1 }, function() { + var stack = lodashStable.last(arguments); + result.ListCache = stack.__data__.constructor; + result.Stack = stack.constructor; + }); + return result; + }()); + /** Used to detect instrumented istanbul code coverage runs. */ var coverage = root.__coverage__ || root[lodashStable.findKey(root, function(value, key) { return /^(?:\$\$cov_\d+\$\$)$/.test(key); @@ -995,13 +1010,6 @@ QUnit.module('map caches'); (function() { - var MapCache = _.memoize.Cache; - - var caches = { - 'Hash': new MapCache().__data__.hash.constructor, - 'MapCache': MapCache - }; - var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || noop]; var pairs = lodashStable.map(keys, function(key, index) { @@ -1009,18 +1017,23 @@ return [key, keys[lastIndex - index]]; }); - _.isMatchWith({ 'a': 1 }, { 'a': 1 }, function() { - var stack = lodashStable.last(arguments); - caches.ListCache = stack.__data__.constructor; - caches.Stack = stack.constructor; + var largeStack = new mapCaches.Stack(pairs); + + lodashStable.times(LARGE_ARRAY_SIZE - pairs.length + 1, function() { + largeStack.set({}, {}); }); - lodashStable.each(['Hash', 'ListCache', 'MapCache', 'Stack'], function(ctorName) { - QUnit.test('`' + ctorName + '` should implement a `Map` interface', function(assert) { - assert.expect(82); + var caches = { + 'hashes': new mapCaches.Hash(pairs), + 'list caches': new mapCaches.ListCache(pairs), + 'map caches': new mapCaches.MapCache(pairs), + 'stack caches': new mapCaches.Stack(pairs), + 'large stacks': largeStack + }; - var Ctor = caches[ctorName], - cache = new Ctor(pairs); + lodashStable.forOwn(caches, function(cache, key) { + QUnit.test('should implement a `Map` interface for ' + key, function(assert) { + assert.expect(82); lodashStable.each(keys, function(key, index) { var value = pairs[index][1]; @@ -2690,47 +2703,17 @@ }); QUnit.test('`_.cloneDeepWith` should provide `stack` to `customizer`', function(assert) { - assert.expect(164); - - var Stack, - keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || noop]; + assert.expect(1); - var pairs = lodashStable.map(keys, function(key, index) { - var lastIndex = keys.length - 1; - return [key, keys[lastIndex - index]]; - }); + var actual; _.cloneDeepWith({ 'a': 1 }, function() { if (arguments.length > 1) { - Stack || (Stack = _.last(arguments).constructor); + actual || (actual = _.last(arguments)); } }); - var stacks = [new Stack(pairs), new Stack(pairs)]; - - lodashStable.times(LARGE_ARRAY_SIZE - pairs.length + 1, function() { - stacks[1].set({}, {}); - }); - - lodashStable.each(stacks, function(stack) { - lodashStable.each(keys, function(key, index) { - var value = pairs[index][1]; - - assert.deepEqual(stack.get(key), value); - assert.strictEqual(stack.has(key), true); - assert.strictEqual(stack['delete'](key), true); - assert.strictEqual(stack.has(key), false); - assert.strictEqual(stack.get(key), undefined); - assert.strictEqual(stack['delete'](key), false); - assert.strictEqual(stack.set(key, value), stack); - assert.strictEqual(stack.has(key), true); - }); - - assert.strictEqual(stack.clear(), undefined); - assert.ok(lodashStable.every(keys, function(key) { - return !stack.has(key); - })); - }); + assert.ok(actual instanceof mapCaches.Stack); }); lodashStable.each(['clone', 'cloneDeep'], function(methodName) { From f2b5e58500be30ea03dfd198b41af77cb92c254f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 19:42:33 -0700 Subject: [PATCH 41/57] Minor hyphen nit. --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 8ca93390ee..ff79f6bca5 100644 --- a/test/test.js +++ b/test/test.js @@ -2631,7 +2631,7 @@ var objects = { '`arguments` objects': arguments, 'arrays': ['a', ''], - 'array-like-objects': { '0': 'a', '1': '', 'length': 3 }, + 'array-like objects': { '0': 'a', '1': '', 'length': 3 }, 'booleans': false, 'boolean objects': Object(false), 'date objects': new Date, From 67ef2bb008e59823aa840e9676caa8e6cef4a2fc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 20:16:07 -0700 Subject: [PATCH 42/57] Cleanup `customizer` test labels. --- test/test.js | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/test.js b/test/test.js index ff79f6bca5..df0f925f65 100644 --- a/test/test.js +++ b/test/test.js @@ -3055,7 +3055,7 @@ assert.deepEqual(argsList, isDeep ? [[object], [1, 'a', object]] : [[object]]); }); - QUnit.test('`_.' + methodName + '` should handle cloning if `customizer` returns `undefined`', function(assert) { + QUnit.test('`_.' + methodName + '` should handle cloning when `customizer` returns `undefined`', function(assert) { assert.expect(1); var actual = func({ 'a': { 'b': 'c' } }, noop); @@ -9853,7 +9853,7 @@ assert.deepEqual(argsList, expected); }); - QUnit.test('should handle comparisons if `customizer` returns `undefined`', function(assert) { + QUnit.test('should handle comparisons when `customizer` returns `undefined`', function(assert) { assert.expect(3); assert.strictEqual(_.isEqualWith('a', 'a', noop), true); @@ -9861,7 +9861,7 @@ assert.strictEqual(_.isEqualWith({ '0': 'a' }, { '0': 'a' }, noop), true); }); - QUnit.test('should not handle comparisons if `customizer` returns `true`', function(assert) { + QUnit.test('should not handle comparisons when `customizer` returns `true`', function(assert) { assert.expect(3); var customizer = function(value) { @@ -9873,7 +9873,7 @@ assert.strictEqual(_.isEqualWith({ '0': 'a' }, { '0': 'b' }, customizer), true); }); - QUnit.test('should not handle comparisons if `customizer` returns `false`', function(assert) { + QUnit.test('should not handle comparisons when `customizer` returns `false`', function(assert) { assert.expect(3); var customizer = function(value) { @@ -9885,7 +9885,7 @@ assert.strictEqual(_.isEqualWith({ '0': 'a' }, { '0': 'a' }, customizer), false); }); - QUnit.test('should return a boolean value even if `customizer` does not', function(assert) { + QUnit.test('should return a boolean value even when `customizer` does not', function(assert) { assert.expect(2); var actual = _.isEqualWith('a', 'b', alwaysC); @@ -10711,13 +10711,13 @@ assert.deepEqual(argsList, expected); }); - QUnit.test('should handle comparisons if `customizer` returns `undefined`', function(assert) { + QUnit.test('should handle comparisons when `customizer` returns `undefined`', function(assert) { assert.expect(1); assert.strictEqual(_.isMatchWith({ 'a': 1 }, { 'a': 1 }, noop), true); }); - QUnit.test('should not handle comparisons if `customizer` returns `true`', function(assert) { + QUnit.test('should not handle comparisons when `customizer` returns `true`', function(assert) { assert.expect(2); var customizer = function(value) { @@ -10728,7 +10728,7 @@ assert.strictEqual(_.isMatchWith({ '0': 'a' }, { '0': 'b' }, customizer), true); }); - QUnit.test('should not handle comparisons if `customizer` returns `false`', function(assert) { + QUnit.test('should not handle comparisons when `customizer` returns `false`', function(assert) { assert.expect(2); var customizer = function(value) { @@ -10739,7 +10739,7 @@ assert.strictEqual(_.isMatchWith({ '0': 'a' }, { '0': 'a' }, customizer), false); }); - QUnit.test('should return a boolean value even if `customizer` does not', function(assert) { + QUnit.test('should return a boolean value even when `customizer` does not', function(assert) { assert.expect(2); var object = { 'a': 1 }, @@ -14993,7 +14993,7 @@ QUnit.module('lodash.mergeWith'); (function() { - QUnit.test('should handle merging if `customizer` returns `undefined`', function(assert) { + QUnit.test('should handle merging when `customizer` returns `undefined`', function(assert) { assert.expect(2); var actual = _.mergeWith({ 'a': { 'b': [1, 1] } }, { 'a': { 'b': [0] } }, noop); @@ -15003,7 +15003,17 @@ assert.deepEqual(actual, [undefined]); }); - QUnit.test('should defer to `customizer` when it returns a non `undefined` value', function(assert) { + QUnit.test('should clone sources when `customizer` returns `undefined`', function(assert) { + assert.expect(1); + + var source1 = { 'a': { 'b': { 'c': 1 } } }, + source2 = { 'a': { 'b': { 'd': 2 } } }; + + _.mergeWith({}, source1, source2, noop); + assert.deepEqual(source1.a.b, { 'c': 1 }); + }); + + QUnit.test('should defer to `customizer` for non `undefined` results', function(assert) { assert.expect(1); var actual = _.mergeWith({ 'a': { 'b': [0, 1] } }, { 'a': { 'b': [2] } }, function(a, b) { @@ -15023,16 +15033,6 @@ assert.deepEqual(actual, { 'a': { 'b': ['c'] } }); }); - QUnit.test('should clone sources when `customizer` result is `undefined`', function(assert) { - assert.expect(1); - - var source1 = { 'a': { 'b': { 'c': 1 } } }, - source2 = { 'a': { 'b': { 'd': 2 } } }; - - _.mergeWith({}, source1, source2, noop); - assert.deepEqual(source1.a.b, { 'c': 1 }); - }); - QUnit.test('should pop the stack of sources for each sibling property', function(assert) { assert.expect(1); From 2b54f23dad0508e7f2f5137b2b9fb8b4cfe453e5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 20:15:38 -0700 Subject: [PATCH 43/57] Add more stack tests. --- test/test.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/test/test.js b/test/test.js index df0f925f65..1c695bc04b 100644 --- a/test/test.js +++ b/test/test.js @@ -2708,9 +2708,7 @@ var actual; _.cloneDeepWith({ 'a': 1 }, function() { - if (arguments.length > 1) { - actual || (actual = _.last(arguments)); - } + actual = _.last(arguments); }); assert.ok(actual instanceof mapCaches.Stack); @@ -10757,6 +10755,18 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should provide `stack` to `customizer`', function(assert) { + assert.expect(1); + + var actual; + + _.isMatchWith({ 'a': 1 }, { 'a': 1 }, function() { + actual = _.last(arguments); + }); + + assert.ok(actual instanceof mapCaches.Stack); + }); + QUnit.test('should ensure `customizer` is a function', function(assert) { assert.expect(1); @@ -15023,6 +15033,18 @@ assert.deepEqual(actual, { 'a': { 'b': [0, 1, 2] } }); }); + QUnit.test('should provide `stack` to `customizer`', function(assert) { + assert.expect(1); + + var actual; + + _.mergeWith({}, { 'a': { 'b': 1 } }, function() { + actual = _.last(arguments); + }); + + assert.ok(actual instanceof mapCaches.Stack); + }); + QUnit.test('should overwrite primitives with source object clones', function(assert) { assert.expect(1); From 70c8651182c2f12de5d97d985a63345bc572238b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 21:03:13 -0700 Subject: [PATCH 44/57] Use consistent `b` values. --- test/test.js | 56 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/test/test.js b/test/test.js index 1c695bc04b..afd8d2de8e 100644 --- a/test/test.js +++ b/test/test.js @@ -4494,7 +4494,7 @@ assert.expect(1); var object = { 'a': { 'b': 2 }, 'd': 4 }, - source = { 'a': { 'b': 1, 'c': 3 }, 'e': 5 }, + source = { 'a': { 'b': 3, 'c': 3 }, 'e': 5 }, expected = { 'a': { 'b': 2, 'c': 3 }, 'd': 4, 'e': 5 }; assert.deepEqual(_.defaultsDeep(object, source), expected); @@ -10416,9 +10416,9 @@ assert.expect(1); function Foo() {} - Foo.a = { 'b': 1, 'c': 2 }; + Foo.a = { 'b': 2, 'c': 3 }; - assert.strictEqual(_.isMatch(Foo, { 'a': { 'b': 1 } }), true); + assert.strictEqual(_.isMatch(Foo, { 'a': { 'b': 2 } }), true); }); QUnit.test('should work with a function for `source`', function(assert) { @@ -10443,8 +10443,8 @@ function Foo(object) { lodashStable.assign(this, object); } - var object = new Foo({ 'a': new Foo({ 'b': 1, 'c': 2 }) }); - assert.strictEqual(_.isMatch(object, { 'a': { 'b': 1 } }), true); + var object = new Foo({ 'a': new Foo({ 'b': 2, 'c': 3 }) }); + assert.strictEqual(_.isMatch(object, { 'a': { 'b': 2 } }), true); }); QUnit.test('should partial match arrays', function(assert) { @@ -10580,7 +10580,7 @@ assert.deepEqual(actual, expected); - objects = [{ 'a': { 'b': 1 } }, { 'a': { 'b': 1, 'c': 1 } }, { 'a': { 'b': 1, 'c': undefined } }]; + objects = [{ 'a': { 'b': 2 } }, { 'a': { 'b': 2, 'c': 3 } }, { 'a': { 'b': 2, 'c': undefined } }]; source = { 'a': { 'c': undefined } }; actual = lodashStable.map(objects, predicate); @@ -12322,7 +12322,7 @@ if (!isModularize) { _.iteratee = getPropB; - assert.deepEqual(_.mapKeys({ 'a': { 'b': 1 } }), { '1': { 'b': 1 } }); + assert.deepEqual(_.mapKeys({ 'a': { 'b': 2 } }), { '2': { 'b': 2 } }); _.iteratee = iteratee; } else { @@ -12335,7 +12335,7 @@ if (!isModularize) { _.iteratee = getPropB; - assert.deepEqual(_.mapValues({ 'a': { 'b': 1 } }), { 'a': 1 }); + assert.deepEqual(_.mapValues({ 'a': { 'b': 2 } }), { 'a': 2 }); _.iteratee = iteratee; } else { @@ -13471,8 +13471,8 @@ QUnit.test('should work with `_.property` shorthands', function(assert) { assert.expect(1); - var actual = _.mapValues({ 'a': { 'b': 1 } }, 'b'); - assert.deepEqual(actual, { 'a': 1 }); + var actual = _.mapValues({ 'a': { 'b': 2 } }, 'b'); + assert.deepEqual(actual, { 'a': 2 }); }); QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) { @@ -13637,9 +13637,9 @@ assert.expect(1); function Foo() {} - Foo.a = { 'b': 1, 'c': 2 }; + Foo.a = { 'b': 2, 'c': 3 }; - var matches = _.matches({ 'a': { 'b': 1 } }); + var matches = _.matches({ 'a': { 'b': 2 } }); assert.strictEqual(matches(Foo), true); }); @@ -13662,8 +13662,8 @@ function Foo(object) { lodashStable.assign(this, object); } - var object = new Foo({ 'a': new Foo({ 'b': 1, 'c': 2 }) }), - matches = _.matches({ 'a': { 'b': 1 } }); + var object = new Foo({ 'a': new Foo({ 'b': 2, 'c': 3 }) }), + matches = _.matches({ 'a': { 'b': 2 } }); assert.strictEqual(matches(object), true); }); @@ -13777,7 +13777,7 @@ assert.deepEqual(actual, expected); - objects = [{ 'a': { 'b': 1 } }, { 'a': { 'b': 1, 'c': 1 } }, { 'a': { 'b': 1, 'c': undefined } }]; + objects = [{ 'a': { 'b': 2 } }, { 'a': { 'b': 2, 'c': 3 } }, { 'a': { 'b': 2, 'c': undefined } }]; actual = lodashStable.map(objects, _.matches({ 'a': { 'c': undefined } })); assert.deepEqual(actual, expected); @@ -14706,25 +14706,19 @@ assert.strictEqual(Foo.a, 1); }); - QUnit.test('should not merge onto nested function values', function(assert) { + QUnit.test('should not merge onto function values of sources', function(assert) { assert.expect(3); var source1 = { 'a': function() {} }, - source2 = { 'a': { 'b': 1 } }, - actual = _.merge({}, source1, source2), - expected = { 'a': { 'b': 1 } }; - - assert.deepEqual(actual, expected); - - source1 = { 'a': function() {} }; - source2 = { 'a': { 'b': 1 } }; + source2 = { 'a': { 'b': 2 } }, + actual = _.merge({}, source1, source2); - expected = { 'a': function() {} }; - expected.a.b = 1; + assert.deepEqual(actual, { 'a': { 'b': 2 } }); actual = _.merge(source1, source2); + assert.strictEqual(typeof actual.a, 'function'); - assert.strictEqual(actual.a.b, 1); + assert.strictEqual(actual.a.b, 2); }); QUnit.test('should merge onto non-plain `object` values', function(assert) { @@ -15038,7 +15032,7 @@ var actual; - _.mergeWith({}, { 'a': { 'b': 1 } }, function() { + _.mergeWith({}, { 'a': { 'b': 2 } }, function() { actual = _.last(arguments); }); @@ -17126,9 +17120,9 @@ QUnit.test('should work as a deep `_.defaults`', function(assert) { assert.expect(1); - var object = { 'a': { 'b': 1 } }, - source = { 'a': { 'b': 2, 'c': 3 } }, - expected = { 'a': { 'b': 1, 'c': 3 } }; + var object = { 'a': { 'b': 2 } }, + source = { 'a': { 'b': 3, 'c': 3 } }, + expected = { 'a': { 'b': 2, 'c': 3 } }; var defaultsDeep = _.partialRight(_.mergeWith, function deep(value, other) { return lodashStable.isObject(value) ? _.mergeWith(value, other, deep) : value; From 9ee423edcfdbc7a56976c7b4054849c296029fd8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 21:04:00 -0700 Subject: [PATCH 45/57] Add `_.toPairs` test for sets. --- test/test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test.js b/test/test.js index afd8d2de8e..849a369d94 100644 --- a/test/test.js +++ b/test/test.js @@ -23307,6 +23307,20 @@ } }); + QUnit.test('`_.' + methodName + '` should convert sets', function(assert) { + assert.expect(1); + + if (Set) { + var set = new Set; + set.add(1); + set.add(2); + assert.deepEqual(func(set), [[1, 1], [2, 2]]); + } + else { + skipAssert(assert); + } + }); + QUnit.test('`_.' + methodName + '` should convert strings', function(assert) { assert.expect(2); From f1b63d41f806ff23adf55e6ce9bc15bbbb03a19a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 21:34:19 -0700 Subject: [PATCH 46/57] Fix test fails for npm package builds. --- test/test.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/test.js b/test/test.js index 849a369d94..5d9457ee8f 100644 --- a/test/test.js +++ b/test/test.js @@ -2711,7 +2711,10 @@ actual = _.last(arguments); }); - assert.ok(actual instanceof mapCaches.Stack); + assert.ok(isNpm + ? actual.constructor.name == 'Stack' + : actual instanceof mapCaches.Stack + ); }); lodashStable.each(['clone', 'cloneDeep'], function(methodName) { @@ -10764,7 +10767,10 @@ actual = _.last(arguments); }); - assert.ok(actual instanceof mapCaches.Stack); + assert.ok(isNpm + ? actual.constructor.name == 'Stack' + : actual instanceof mapCaches.Stack + ); }); QUnit.test('should ensure `customizer` is a function', function(assert) { @@ -15036,7 +15042,10 @@ actual = _.last(arguments); }); - assert.ok(actual instanceof mapCaches.Stack); + assert.ok(isNpm + ? actual.constructor.name == 'Stack' + : actual instanceof mapCaches.Stack + ); }); QUnit.test('should overwrite primitives with source object clones', function(assert) { From 572060aedc37f913cccac478f33ed5ca7eefc6cf Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 4 May 2016 17:17:01 -0700 Subject: [PATCH 47/57] Update fp description. [ci skip] --- lib/fp/template/doc/wiki.jst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fp/template/doc/wiki.jst b/lib/fp/template/doc/wiki.jst index 188302fb9b..095eda6048 100644 --- a/lib/fp/template/doc/wiki.jst +++ b/lib/fp/template/doc/wiki.jst @@ -1,7 +1,9 @@ ## lodash/fp -The `lodash/fp` module is an instance of `lodash` with its methods wrapped to -produce immutable auto-curried iteratee-first data-last methods. +The `lodash/fp` module promotes a more +[functional programming](https://en.wikipedia.org/wiki/Functional_programming) +(FP) friendly style by exporting an instance of `lodash` with its methods wrapped +to produce immutable auto-curried iteratee-first data-last methods. ## Installation From 73e7bab8398e5d6b8927cb75fb5de221f08bfd46 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 4 May 2016 17:17:14 -0700 Subject: [PATCH 48/57] Add tooling section. [ci skip] --- lib/fp/template/doc/wiki.jst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/fp/template/doc/wiki.jst b/lib/fp/template/doc/wiki.jst index 095eda6048..7a429ab178 100644 --- a/lib/fp/template/doc/wiki.jst +++ b/lib/fp/template/doc/wiki.jst @@ -220,3 +220,8 @@ var fp = convert({ // Convert by `lodash` instance. var fp = convert(lodash.runInContext()); ``` + +## Tooling + +Use [eslint-plugin-lodash-fp](https://www.npmjs.com/package/eslint-plugin-lodash-fp) +to help use `lodash/fp` more efficiently. From 9a461a5e480056040f1cdbca7836a1b8d335161c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 4 May 2016 21:09:28 -0700 Subject: [PATCH 49/57] Add `_.toFinite`. --- lodash.js | 92 ++++++++++++++++++++++++++++++++++------------------ test/test.js | 37 +++++++++++++-------- 2 files changed, 85 insertions(+), 44 deletions(-) diff --git a/lodash.js b/lodash.js index 397a2928f3..69a7403a80 100644 --- a/lodash.js +++ b/lodash.js @@ -1416,10 +1416,10 @@ * `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`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, + * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, + * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, @@ -1428,9 +1428,9 @@ * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, - * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, - * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, + * `toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, + * `toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` * * @name _ @@ -10858,14 +10858,14 @@ * _.isFinite(3); * // => true * - * _.isFinite(Number.MAX_VALUE); - * // => true - * - * _.isFinite(3.14); + * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false + * + * _.isFinite('3'); + * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); @@ -11586,6 +11586,41 @@ return func(value); } + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + /** * Converts `value` to an integer. * @@ -11600,7 +11635,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toInteger(3); + * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); @@ -11609,20 +11644,14 @@ * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * - * _.toInteger('3'); + * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - var remainder = value % 1; - return value === value ? (remainder ? value - remainder : value) : 0; + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; } /** @@ -11640,7 +11669,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toLength(3); + * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); @@ -11649,7 +11678,7 @@ * _.toLength(Infinity); * // => 4294967295 * - * _.toLength('3'); + * _.toLength('3.2'); * // => 3 */ function toLength(value) { @@ -11667,8 +11696,8 @@ * @returns {number} Returns the number. * @example * - * _.toNumber(3); - * // => 3 + * _.toNumber(3.2); + * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 @@ -11676,8 +11705,8 @@ * _.toNumber(Infinity); * // => Infinity * - * _.toNumber('3'); - * // => 3 + * _.toNumber('3.2'); + * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { @@ -11740,7 +11769,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toSafeInteger(3); + * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); @@ -11749,7 +11778,7 @@ * _.toSafeInteger(Infinity); * // => 9007199254740991 * - * _.toSafeInteger('3'); + * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { @@ -15915,6 +15944,7 @@ lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; + lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; diff --git a/test/test.js b/test/test.js index 5d9457ee8f..e9349ab872 100644 --- a/test/test.js +++ b/test/test.js @@ -22994,7 +22994,7 @@ QUnit.module('number coercion methods'); - lodashStable.each(['toInteger', 'toNumber', 'toSafeInteger'], function(methodName) { + lodashStable.each(['toFinite', 'toInteger', 'toNumber', 'toSafeInteger'], function(methodName) { var func = _[methodName]; QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) { @@ -23016,8 +23016,9 @@ }); }); - lodashStable.each(['toInteger', 'toLength', 'toNumber', 'toSafeInteger'], function(methodName) { + lodashStable.each(['toFinite', 'toInteger', 'toLength', 'toNumber', 'toSafeInteger'], function(methodName) { var func = _[methodName], + isToFinite = methodName == 'toFinite', isToLength = methodName == 'toLength', isToNumber = methodName == 'toNumber', isToSafeInteger = methodName == 'toSafeInteger'; @@ -23055,7 +23056,7 @@ var expected = lodashStable.map(values, function(value) { if (!isToNumber) { - if (value == 1.2) { + if (!isToFinite && value == 1.2) { value = 1; } else if (value == Infinity) { @@ -23094,13 +23095,13 @@ var expected = lodashStable.map(values, function(value) { var n = +value; if (!isToNumber) { - if (n == 1.234567890) { + if (!isToFinite && n == 1.234567890) { n = 1; } else if (n == Infinity) { n = MAX_INTEGER; } - else if (n == Number.MIN_VALUE || n !== n) { + else if ((!isToFinite && n == Number.MIN_VALUE) || n !== n) { n = 0; } if (isToLength || isToSafeInteger) { @@ -23216,20 +23217,29 @@ ]; var expected = [ - NaN, 0, 1, NaN, - NaN, 2.2, 1.1, 1.1, + NaN, 0, 1, NaN, + NaN, 2.2, 1.1, 1.1, NaN, NaN, 5349, 5349, 42, 42 ]; - if (!isToNumber) { + if (isToFinite) { expected = [ - 0, 0, 1, 0, - 0, 2, 1, 1, - 0, 0, + 0, 0, 1, 0, + 0, 2.2, 1.1, 1.1, + 0, 0, 5349, 5349, - 42, 42 + 42, 42 + ]; + } + else if (!isToNumber) { + expected = [ + 0, 0, 1, 0, + 0, 2, 1, 1, + 0, 0, + 5349, 5349, + 42, 42 ]; } var actual = lodashStable.map(values, func); @@ -25946,6 +25956,7 @@ 'startsWith', 'subtract', 'sum', + 'toFinite', 'toInteger', 'toLower', 'toNumber', @@ -26203,7 +26214,7 @@ var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey); QUnit.test('should accept falsey arguments', function(assert) { - assert.expect(308); + assert.expect(309); var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray); From ca1f22a7c60a30a686dbade938bf757aae9fc60e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 6 May 2016 21:24:57 -0700 Subject: [PATCH 50/57] Ensure trailing function sources aren't skipping for _.assign, _.assignIn, _.defaults, & _.merge. [closes #2311] --- lodash.js | 2 +- test/test.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lodash.js b/lodash.js index 69a7403a80..49f424f7f7 100644 --- a/lodash.js +++ b/lodash.js @@ -4322,7 +4322,7 @@ customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; - customizer = typeof customizer == 'function' + customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; diff --git a/test/test.js b/test/test.js index e9349ab872..30187c03cc 100644 --- a/test/test.js +++ b/test/test.js @@ -6813,6 +6813,15 @@ assert.deepEqual(func({}, new Foo), expected); }); + QUnit.test('`_.' + methodName + '` should not skip a trailing function source', function(assert) { + assert.expect(1); + + function fn() {} + fn.b = 2; + + assert.deepEqual(func({}, { 'a': 1 }, fn), { 'a': 1, 'b': 2 }); + }); + QUnit.test('`_.' + methodName + '` should not error on nullish sources', function(assert) { assert.expect(1); @@ -6850,14 +6859,13 @@ var array = [{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }], expected = { 'a': isDefaults ? 0 : 1, 'b': 2, 'c': 3 }; - assert.deepEqual(lodashStable.reduce(array, func, { 'a': 0 }), expected); - - var fn = function() {}; + function fn() {}; fn.a = array[0]; fn.b = array[1]; fn.c = array[2]; - assert.deepEqual(_.reduce(fn, func, { 'a': 0 }), expected); + assert.deepEqual(lodashStable.reduce(array, func, { 'a': 0 }), expected); + assert.deepEqual(lodashStable.reduce(fn, func, { 'a': 0 }), expected); }); QUnit.test('`_.' + methodName + '` should not return the existing wrapped value when chaining', function(assert) { From 05135ca17173bbfee26ad6be2284ae2e7cafc1d3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 6 May 2016 22:58:01 -0700 Subject: [PATCH 51/57] Update chrome version in sauce. --- test/saucelabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index d10a3139a9..5ffe94e148 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -104,8 +104,8 @@ var browserNameMap = { /** List of platforms to load the runner on. */ var platforms = [ ['Linux', 'android', '5.1'], + ['Windows 10', 'chrome', '50'], ['Windows 10', 'chrome', '49'], - ['Windows 10', 'chrome', '48'], ['Windows 10', 'firefox', '45'], ['Windows 10', 'firefox', '44'], ['Windows 10', 'microsoftedge', '13'], From 47d024ae7b80ae990ebd9ecd07539c5949451b4e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 7 May 2016 06:54:26 -0700 Subject: [PATCH 52/57] Use "index" instead of "nth". [closes #2313] [ci skip] --- lodash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 49f424f7f7..858b792e39 100644 --- a/lodash.js +++ b/lodash.js @@ -6849,8 +6849,8 @@ } /** - * Gets the nth element of `array`. If `n` is negative, the nth element - * from the end is returned. + * Gets the element at `n` index of `array`. If `n` is negative, the nth + * element from the end is returned. * * @static * @memberOf _ @@ -14978,7 +14978,7 @@ } /** - * Creates a function that returns its nth argument. If `n` is negative, + * Creates a function that gets the argument at `n` index. If `n` is negative, * the nth argument from the end is returned. * * @static From def9f5d84af52a53b9f774017e141d67ec7babb3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 7 May 2016 10:06:45 -0700 Subject: [PATCH 53/57] Fix doc typo for `_.toPairsIn`. [closes #2314] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 858b792e39..1ca558afd7 100644 --- a/lodash.js +++ b/lodash.js @@ -13004,7 +13004,7 @@ * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); From 8864095bab17a038ca9b7cef938bca20fa6ab766 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 7 May 2016 19:31:30 -0700 Subject: [PATCH 54/57] Update firefox version in sauce. --- test/saucelabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index 5ffe94e148..f8a7554ff3 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -106,8 +106,8 @@ var platforms = [ ['Linux', 'android', '5.1'], ['Windows 10', 'chrome', '50'], ['Windows 10', 'chrome', '49'], + ['Windows 10', 'firefox', '46'], ['Windows 10', 'firefox', '45'], - ['Windows 10', 'firefox', '44'], ['Windows 10', 'microsoftedge', '13'], ['Windows 10', 'internet explorer', '11'], ['Windows 8', 'internet explorer', '10'], From 996636d25b43901b6a0bb3fa84c85f1f1f79eccc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 7 May 2016 11:55:48 -0700 Subject: [PATCH 55/57] Update lodash dep. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3679d191fb..ca7fab3976 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "istanbul": "0.4.3", "jquery": "^2.2.3", "jscs": "^3.0.1", - "lodash": "4.10.0", + "lodash": "4.11.2", "markdown-doctest": "^0.4.0", "platform": "^1.3.1", "qunit-extras": "^2.0.0", From 1123e13072883436799e4817288b4eb247cc0471 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 6 May 2016 22:10:19 -0700 Subject: [PATCH 56/57] Rebuild lodash and docs. --- dist/lodash.core.js | 140 ++----- dist/lodash.core.min.js | 46 +-- dist/lodash.fp.js | 25 +- dist/lodash.fp.min.js | 18 +- dist/lodash.js | 859 ++++++++++++++++++++++------------------ dist/lodash.min.js | 245 ++++++------ dist/mapping.fp.js | 2 +- doc/README.md | 782 +++++++++++++++++++----------------- lodash.js | 2 +- package.json | 2 +- 10 files changed, 1096 insertions(+), 1025 deletions(-) diff --git a/dist/lodash.core.js b/dist/lodash.core.js index 73b541bef9..954cdcf20f 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -1,7 +1,6 @@ /** * @license - * lodash 4.11.2 (Custom Build) - * Build: `lodash core -o ./dist/lodash.core.js` + * lodash * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 @@ -13,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.11.2'; + var VERSION = '4.12.0'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -105,18 +104,6 @@ /*--------------------------------------------------------------------------*/ - /** - * Creates a new array concatenating `array` with `other`. - * - * @private - * @param {Array} array The first array to concatenate. - * @param {Array} other The second array to concatenate. - * @returns {Array} Returns the new concatenated array. - */ - function arrayConcat(array, other) { - return arrayPush(copyArray(array), values); - } - /** * Appends the elements of `values` to `array`. * @@ -378,10 +365,10 @@ * `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`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, + * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, + * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, @@ -390,9 +377,9 @@ * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, - * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, - * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, + * `toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, + * `toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` * * @name _ @@ -651,7 +638,7 @@ * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. + * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return baseFilter(props, function(key) { @@ -856,7 +843,7 @@ * * @private * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var props = keys(source); @@ -902,7 +889,7 @@ * * @private * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { @@ -1067,7 +1054,7 @@ length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined; - customizer = typeof customizer == 'function' + customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; @@ -1212,16 +1199,16 @@ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } - var result = true; + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? [] : undefined; // Ignore non-index properties. while (++index < arrLength) { @@ -1237,10 +1224,12 @@ break; } // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!baseSome(other, function(othValue) { - return arrValue === othValue || - equalFunc(arrValue, othValue, customizer, bitmask, stack); + if (seen) { + if (!baseSome(other, function(othValue, othIndex) { + if (!indexOf(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.push(othIndex); + } })) { result = false; break; @@ -1405,7 +1394,7 @@ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + return isArray(value) || isArguments(value); } /** @@ -1491,16 +1480,16 @@ */ function concat() { var length = arguments.length, - array = castArray(arguments[0]); + args = Array(length ? length - 1 : 0), + array = arguments[0], + index = length; - if (length < 2) { - return length ? copyArray(array) : []; - } - var args = Array(length - 1); - while (length--) { - args[length - 1] = arguments[length]; + while (index--) { + args[index - 1] = arguments[index]; } - return arrayConcat(array, baseFlatten(args, 1)); + return length + ? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)) + : []; } /** @@ -2280,7 +2269,7 @@ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { @@ -2372,47 +2361,6 @@ /*------------------------------------------------------------------------*/ - /** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - /** * Creates a shallow clone of `value`. * @@ -2729,14 +2677,14 @@ * _.isFinite(3); * // => true * - * _.isFinite(Number.MAX_VALUE); - * // => true - * - * _.isFinite(3.14); + * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false + * + * _.isFinite('3'); + * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); @@ -3056,7 +3004,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toInteger(3); + * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); @@ -3065,7 +3013,7 @@ * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * - * _.toInteger('3'); + * _.toInteger('3.2'); * // => 3 */ var toInteger = Number; @@ -3081,8 +3029,8 @@ * @returns {number} Returns the number. * @example * - * _.toNumber(3); - * // => 3 + * _.toNumber(3.2); + * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 @@ -3090,8 +3038,8 @@ * _.toNumber(Infinity); * // => Infinity * - * _.toNumber('3'); - * // => 3 + * _.toNumber('3.2'); + * // => 3.2 */ var toNumber = Number; @@ -3626,7 +3574,7 @@ * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index af9a2251cb..d33dffd07e 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -1,30 +1,28 @@ /** * @license - * lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE - * Build: `lodash core -o ./dist/lodash.core.js` + * lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE */ ;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return O(t,function(t){return n[t]})}function u(n){return n&&n.Object===Object?n:null}function o(n){return gn[n]}function i(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}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===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function l(n){return nn(n)?Bn(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(pn,r)},t)}function s(n,t){var r=true;return zn(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)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Cn(n,t,on)}function b(n,t){return v(t,function(t){return Y(n[t])})}function _(n,t){return n>t}function d(n,t,r,e,u){return n===t?true:null==n||null==t||!nn(n)&&!tn(t)?n!==n&&t!==t:j(n,t,d,r,e,u)}function j(n,t,r,e,u,o){var c=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]"; -c||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!i(n),f="[object Object]"==l&&!i(t),l=a==l;o||(o=[]);var s=U(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=c||isTypedArray(n)?$(n,t,r,e,u,o):q(n,t,a),o.pop(),r):2&u||(c=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!c&&!a)?l?(r=z(n,t,r,e,u,o),o.pop(),r):false:(c=c?n.value():n,t=a?t.value():t,r=r(c,t,e,u,o), -o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?A:k)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function x(n,t){return t>n}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),H(t,function(t,r){ -return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(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]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++ef))return false;for(a=true;++i-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function P(n){return n&&n.length?n[0]:pn}function U(n,r){return t(n,m(r),zn)}function V(n,t){return zn(n,m(t))}function H(n,t,e){ -return r(n,m(t),e,3>arguments.length,zn)}function K(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function L(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object"; -}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max; -f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++ot)return t?S(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return y(e,1),n(S(r),fn)},c.create=function(n,t){var r=l(n);return t?Ln(r,t):r},c.defaults=Xn,c.defer=Pn,c.delay=Un,c.filter=function(n,t){return v(n,m(t))},c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,sn):[]},c.iteratee=Zn,c.keys=on,c.map=function(n,t){return O(n,m(t))},c.matches=function(n){return A(Ln({},n))},c.mixin=ln,c.negate=function(n){ -if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return K(2,n)},c.pick=Yn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?N(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){var r=0;return t=m(t),O(O(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==pn,o=null===r,i=r===r,c=e!==pn,f=null===e,a=e===e;if(!f&&r>e||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}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=U,c.forEach=V,c.has=function(n,t){return null!=n&&kn.call(n,t); -},c.head=P,c.identity=an,c.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rn}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),K(t,function(t,r){ +return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(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]:pn,o=n.length>3&&typeof o=="function"?(u--,o):pn;for(t=Object(t);++ei))return false;for(var c=-1,f=true,a=1&u?[]:pn;++c-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En); +}function P(n){return n&&n.length?n[0]:pn}function U(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,zn)}function L(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}} +function Q(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object"}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length; +for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max; +f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe||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}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=V,c.forEach=H,c.has=function(n,t){return null!=n&&kn.call(n,t); +},c.head=P,c.identity=an,c.indexOf=U,c.isArguments=W,c.isArray=Vn,c.isBoolean=function(n){return true===n||false===n||tn(n)&&"[object Boolean]"==Sn.call(n)},c.isDate=function(n){return tn(n)&&"[object Date]"==Sn.call(n)},c.isEmpty=function(n){return X(n)&&(Vn(n)||en(n)||Y(n.splice)||W(n))?!n.length:!on(n).length},c.isEqual=function(n,t){return d(n,t)},c.isFinite=function(n){return typeof n=="number"&&In(n)},c.isFunction=Y,c.isNaN=function(n){return rn(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=rn, +c.isObject=nn,c.isRegExp=function(n){return nn(n)&&"[object RegExp]"==Sn.call(n)},c.isString=en,c.isUndefined=function(n){return n===pn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},c.max=function(n){return n&&n.length?h(n,an,_):pn},c.min=function(n){return n&&n.length?h(n,an,x):pn},c.noConflict=function(){return On._===this&&(On._=Tn),this},c.noop=function(){},c.reduce=K,c.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),Y(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=X(n)?n:on(n), +n.length)},c.some=function(n,t,r){return t=r?pn:t,T(n,m(t))},c.uniqueId=function(n){var t=++Nn;return un(n)+t},c.each=H,c.first=P,ln(c,function(){var n={};return g(c,function(t,r){kn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.12.0",zn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:An)[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(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(wn||mn||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return c}):_n&&dn?(jn&&((dn.exports=c)._=c),_n._=c):On._=c}).call(this); \ No newline at end of file diff --git a/dist/lodash.fp.js b/dist/lodash.fp.js index 6181b35e1a..99e48c8d51 100644 --- a/dist/lodash.fp.js +++ b/dist/lodash.fp.js @@ -269,25 +269,21 @@ return /******/ (function(modules) { // webpackBootstrap if (!isFunction(func)) { return mixin(func, Object(source)); } - var methods = [], - methodNames = []; - + var pairs = []; each(keys(source), function(key) { - var value = source[key]; - if (isFunction(value)) { - methodNames.push(key); - methods.push(func.prototype[key]); + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); } }); mixin(func, Object(source)); - each(methodNames, function(methodName, index) { - var method = methods[index]; - if (isFunction(method)) { - func.prototype[methodName] = method; + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; } else { - delete func.prototype[methodName]; + delete func.prototype[pair[0]]; } }); return func; @@ -315,6 +311,7 @@ return /******/ (function(modules) { // webpackBootstrap var index = -1, length = path.length, + lastIndex = length - 1, result = clone(Object(object)), nested = result; @@ -323,7 +320,7 @@ return /******/ (function(modules) { // webpackBootstrap value = nested[key]; if (value != null) { - nested[key] = clone(Object(value)); + nested[path[index]] = clone(index == lastIndex ? value : Object(value)); } nested = nested[key]; } @@ -619,7 +616,7 @@ return /******/ (function(modules) { // webpackBootstrap 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', - 'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', + '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', diff --git a/dist/lodash.fp.min.js b/dist/lodash.fp.min.js index bd12b9e969..979fae372e 100644 --- a/dist/lodash.fp.min.js +++ b/dist/lodash.fp.min.js @@ -1,14 +1,14 @@ !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,d){function f(t,e){e=F(e);for(var r=-1,n=e.length,i=M(Object(t)),a=i;null!=a&&++r1&&(E||!p.skipRearg[t])&&(r=L(r,p.methodRearg[t]||p.aryRearg[e])), -I.cap&&(o?r=m(r,o):a&&(r=g(r,a))),(b||I.curry&&e>1)&&(b&&console.log(b,t),r=q(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=b?q(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=O),r}var W,R="function"==typeof e,A=e===Object(e);if(A&&(d=r,r=e,e=void 0),null==r)throw new TypeError;d||(d={});var I={cap:"cap"in d?d.cap:!0,curry:"curry"in d?d.curry:!0,fixed:"fixed"in d?d.fixed:!0,immutable:"immutable"in d?d.immutable:!0,rearg:"rearg"in d?d.rearg:!0 -},b="curry"in d&&d.curry,k="fixed"in d&&d.fixed,E="rearg"in d&&d.rearg,O=R?r:c,B=R?r.runInContext():void 0,j=R?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},C=j.ary,w=j.assign,M=j.clone,q=j.curry,P=j.forEach,S=j.isArray,z=j.isFunction,K=j.keys,L=j.rearg,D=j.spread,F=j.toPath,T=K(p.aryMethod),_={castArray:function(t){return function(){var e=arguments[0]; -return S(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 I.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(!z(r))return t(r,Object(e));var n=[],i=[];return P(K(e),function(t){var a=e[t];z(a)&&(i.push(t),n.push(r.prototype[t]))}),t(r,Object(e)),P(i,function(t,e){var i=n[e];z(i)?r.prototype[t]=i:delete r.prototype[t]}),r}},runInContext:function(e){ -return function(r){return u(t,e(r),d)}}};if(!A)return x(e,r);var N=r,V=[];return P(T,function(t){P(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),P(K(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])}}),P(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=O),P(K(N),function(t){P(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),l=p.mutate,c=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","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"], +i}}function u(t,e,r,d){function f(t,e){e=F(e);for(var r=-1,n=e.length,i=n-1,a=M(Object(t)),o=a;null!=o&&++r1&&(E||!p.skipRearg[t])&&(r=L(r,p.methodRearg[t]||p.aryRearg[e])),I.cap&&(o?r=m(r,o):a&&(r=g(r,a))),(b||I.curry&&e>1)&&(b&&console.log(b,t),r=q(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=b?q(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=O),r}var W,R="function"==typeof e,A=e===Object(e);if(A&&(d=r,r=e,e=void 0),null==r)throw new TypeError;d||(d={});var I={cap:"cap"in d?d.cap:!0,curry:"curry"in d?d.curry:!0,fixed:"fixed"in d?d.fixed:!0, +immutable:"immutable"in d?d.immutable:!0,rearg:"rearg"in d?d.rearg:!0},b="curry"in d&&d.curry,k="fixed"in d&&d.fixed,E="rearg"in d&&d.rearg,O=R?r:c,B=R?r.runInContext():void 0,j=R?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},C=j.ary,w=j.assign,M=j.clone,q=j.curry,P=j.forEach,S=j.isArray,z=j.isFunction,K=j.keys,L=j.rearg,D=j.spread,F=j.toPath,T=K(p.aryMethod),_={ +castArray:function(t){return function(){var e=arguments[0];return S(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 I.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(!z(r))return t(r,Object(e));var n=[];return P(K(e),function(t){z(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),P(n,function(t){var e=t[1];z(e)?r.prototype[t[0]]=e:delete r.prototype[t[0]]; +}),r}},runInContext:function(e){return function(r){return u(t,e(r),d)}}};if(!A)return x(e,r);var N=r,V=[];return P(T,function(t){P(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),P(K(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])}}),P(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=O),P(K(N),function(t){P(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),l=p.mutate,c=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"], 3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","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,findIndex:1,findKey:1,findLast:1,findLastIndex: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],getOr:[2,1,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],updateWith:[3,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, diff --git a/dist/lodash.js b/dist/lodash.js index 7bc771f19e..4bcb6ca88c 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -1,7 +1,6 @@ /** * @license - * lodash 4.11.2 (Custom Build) - * Build: `lodash -o ./dist/lodash.js` + * lodash * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 @@ -13,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.11.2'; + var VERSION = '4.12.0'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -457,30 +456,6 @@ return accumulator; } - /** - * Creates a new array concatenating `array` with `other`. - * - * @private - * @param {Array} array The first array to concatenate. - * @param {Array} other The second array to concatenate. - * @returns {Array} Returns the new concatenated array. - */ - function arrayConcat(array, other) { - var index = -1, - length = array.length, - othIndex = -1, - othLength = other.length, - result = Array(length + othLength); - - while (++index < length) { - result[index] = array[index]; - } - while (++othIndex < othLength) { - result[index++] = other[othIndex]; - } - return result; - } - /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. @@ -908,7 +883,7 @@ * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. + * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { @@ -921,7 +896,7 @@ * * @private * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { @@ -945,6 +920,18 @@ }); } + /** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. @@ -1101,11 +1088,11 @@ } /** - * Converts `map` to an array. + * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. + * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, @@ -1143,11 +1130,11 @@ } /** - * Converts `set` to an array. + * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. + * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, @@ -1159,6 +1146,23 @@ return result; } + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + /** * Gets the number of symbols in `string`. * @@ -1412,10 +1416,10 @@ * `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`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, + * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, + * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, @@ -1424,9 +1428,9 @@ * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, - * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, - * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, + * `toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, + * `toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` * * @name _ @@ -1686,64 +1690,212 @@ * * @private * @constructor - * @returns {Object} Returns the new hash object. + * @param {Array} [entries] The key-value pairs to cache. */ - function Hash() {} + function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + } /** * Removes `key` and its value from the hash. * * @private + * @name delete + * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; + function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; } /** * Gets the hash value for `key`. * * @private - * @param {Object} hash The hash to query. + * @name get + * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ - function hashGet(hash, key) { + function hashGet(key) { + var data = this.__data__; if (nativeCreate) { - var result = hash[key]; + var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; + return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private - * @param {Object} hash The hash to query. + * @name has + * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private - * @param {Object} hash The hash to modify. + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. */ - function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; } - // Avoid inheriting from `Object.prototype` when possible. - Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ @@ -1752,15 +1904,15 @@ * * @private * @constructor - * @param {Array} [values] The values to cache. + * @param {Array} [entries] The key-value pairs to cache. */ - function MapCache(values) { + function MapCache(entries) { var index = -1, - length = values ? values.length : 0; + length = entries ? entries.length : 0; this.clear(); while (++index < length) { - var entry = values[index]; + var entry = entries[index]; this.set(entry[0], entry[1]); } } @@ -1772,10 +1924,10 @@ * @name clear * @memberOf MapCache */ - function mapClear() { + function mapCacheClear() { this.__data__ = { 'hash': new Hash, - 'map': Map ? new Map : [], + 'map': new (Map || ListCache), 'string': new Hash }; } @@ -1789,12 +1941,8 @@ * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); + function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); } /** @@ -1806,12 +1954,8 @@ * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ - function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); + function mapCacheGet(key) { + return getMapData(this, key).get(key); } /** @@ -1823,12 +1967,8 @@ * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); + function mapCacheHas(key) { + return getMapData(this, key).has(key); } /** @@ -1841,30 +1981,23 @@ * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ - function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } + function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); return this; } // Add methods to `MapCache`. - MapCache.prototype.clear = mapClear; - MapCache.prototype['delete'] = mapDelete; - MapCache.prototype.get = mapGet; - MapCache.prototype.has = mapHas; - MapCache.prototype.set = mapSet; + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * - * Creates a set cache object to store unique values. + * Creates an array cache object to store unique values. * * @private * @constructor @@ -1876,52 +2009,41 @@ this.__data__ = new MapCache; while (++index < length) { - this.push(values[index]); + this.add(values[index]); } } /** - * Checks if `value` is in `cache`. + * Adds `value` to the array cache. * * @private - * @param {Object} cache The set cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ - function cacheHas(cache, value) { - var map = cache.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - return hash[value] === HASH_UNDEFINED; - } - return map.has(value); + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } /** - * Adds `value` to the set cache. + * Checks if `value` is in the array cache. * * @private - * @name push + * @name has * @memberOf SetCache - * @param {*} value The value to cache. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. */ - function cachePush(value) { - var map = this.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - hash[value] = HASH_UNDEFINED; - } - else { - map.set(value, HASH_UNDEFINED); - } + function setCacheHas(value) { + return this.__data__.has(value); } // Add methods to `SetCache`. - SetCache.prototype.push = cachePush; + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ @@ -1930,17 +2052,10 @@ * * @private * @constructor - * @param {Array} [values] The values to cache. + * @param {Array} [entries] The key-value pairs to cache. */ - function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } + function Stack(entries) { + this.__data__ = new ListCache(entries); } /** @@ -1951,7 +2066,7 @@ * @memberOf Stack */ function stackClear() { - this.__data__ = { 'array': [], 'map': null }; + this.__data__ = new ListCache; } /** @@ -1964,10 +2079,7 @@ * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); + return this.__data__['delete'](key); } /** @@ -1980,10 +2092,7 @@ * @returns {*} Returns the entry value. */ function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); + return this.__data__.get(key); } /** @@ -1996,10 +2105,7 @@ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); + return this.__data__.has(key); } /** @@ -2013,21 +2119,11 @@ * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); + var cache = this.__data__; + if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { + cache = this.__data__ = new MapCache(cache.__data__); } + cache.set(key, value); return this; } @@ -2040,90 +2136,6 @@ /*------------------------------------------------------------------------*/ - /** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; - } - - /** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; - } - - /** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } - } - - /*------------------------------------------------------------------------*/ - /** * Used by `_.defaults` to customize its `_.assignIn` use. * @@ -2176,6 +2188,24 @@ } } + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. @@ -2213,7 +2243,7 @@ * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths of elements to pick. - * @returns {Array} Returns the new array of picked elements. + * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, @@ -2328,7 +2358,7 @@ * * @private * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source), @@ -2641,7 +2671,7 @@ * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. + * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { @@ -2682,9 +2712,7 @@ */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); - return isArray(object) - ? result - : arrayPush(result, symbolsFunc(object)); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** @@ -3076,7 +3104,7 @@ * * @private * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); @@ -3094,7 +3122,7 @@ * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { @@ -3309,7 +3337,7 @@ * * @private * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { @@ -3322,7 +3350,7 @@ * * @private * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { @@ -3423,7 +3451,7 @@ * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the new array of numbers. + * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, @@ -4137,7 +4165,7 @@ * placeholders, and provided arguments into a single array of arguments. * * @private - * @param {Array|Object} args The provided arguments. + * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. @@ -4172,7 +4200,7 @@ * is tailored for `_.partialRight`. * * @private - * @param {Array|Object} args The provided arguments. + * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. @@ -4294,7 +4322,7 @@ customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; - customizer = typeof customizer == 'function' + customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; @@ -4393,7 +4421,7 @@ * * @private * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { @@ -4478,7 +4506,7 @@ var length = arguments.length, args = Array(length), index = length, - placeholder = getPlaceholder(wrapper); + placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; @@ -4593,14 +4621,14 @@ function wrapper() { var length = arguments.length, - index = length, - args = Array(length); + args = Array(length), + index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { - var placeholder = getPlaceholder(wrapper), + var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { @@ -4689,7 +4717,7 @@ * * @private * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new invoker function. + * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return rest(function(iteratees) { @@ -4887,6 +4915,26 @@ return new Set(values); }; + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. @@ -4904,6 +4952,7 @@ * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` + * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. @@ -4982,9 +5031,7 @@ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; @@ -4996,7 +5043,10 @@ if (stacked) { return stacked == other; } - var result = true; + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + stack.set(array, other); // Ignore non-index properties. @@ -5017,10 +5067,12 @@ break; } // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || - equalFunc(arrValue, othValue, customizer, bitmask, stack); + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } })) { result = false; break; @@ -5254,6 +5306,18 @@ return result; } + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. @@ -5284,6 +5348,21 @@ */ var getLength = baseProperty('length'); + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + /** * Gets the property names, values, and compare flags of `object`. * @@ -5314,18 +5393,6 @@ return isNative(value) ? value : undefined; } - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getPlaceholder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - /** * Gets the `[[Prototype]]` of `value`. * @@ -5575,7 +5642,7 @@ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + return isArray(value) || isArguments(value); } /** @@ -5719,7 +5786,7 @@ * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { @@ -5971,7 +6038,7 @@ * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array containing chunks. + * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); @@ -6054,16 +6121,16 @@ */ function concat() { var length = arguments.length, - array = castArray(arguments[0]); + args = Array(length ? length - 1 : 0), + array = arguments[0], + index = length; - if (length < 2) { - return length ? copyArray(array) : []; - } - var args = Array(length - 1); - while (length--) { - args[length - 1] = arguments[length]; + while (index--) { + args[index - 1] = arguments[index]; } - return arrayConcat(array, baseFlatten(args, 1)); + return length + ? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)) + : []; } /** @@ -6782,8 +6849,8 @@ } /** - * Gets the nth element of `array`. If `n` is negative, the nth element - * from the end is returned. + * Gets the element at `n` index of `array`. If `n` is negative, the nth + * element from the end is returned. * * @static * @memberOf _ @@ -7663,7 +7730,7 @@ * @memberOf _ * @since 0.1.0 * @category Array - * @param {Array} array The array to filter. + * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor @@ -7689,7 +7756,7 @@ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. + * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * @@ -7713,7 +7780,7 @@ * @param {...Array} [arrays] The arrays to inspect. * @param {Array|Function|Object|string} [iteratee=_.identity] * The iteratee invoked per element. - * @returns {Array} Returns the new array of values. + * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); @@ -7742,7 +7809,7 @@ * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. + * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; @@ -8490,9 +8557,8 @@ * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEach(collection, iteratee) - : baseEach(collection, getIteratee(iteratee)); + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); } /** @@ -8516,9 +8582,8 @@ * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEachRight(collection, iteratee) - : baseEachRight(collection, getIteratee(iteratee)); + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); } /** @@ -9199,7 +9264,7 @@ * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); @@ -9283,7 +9348,7 @@ var bind = rest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { - var holders = replaceHolders(partials, getPlaceholder(bind)); + var holders = replaceHolders(partials, getHolder(bind)); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); @@ -9337,7 +9402,7 @@ var bindKey = rest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { - var holders = replaceHolders(partials, getPlaceholder(bindKey)); + var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); @@ -9663,7 +9728,7 @@ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { @@ -9696,7 +9761,7 @@ * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. + * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; @@ -9754,7 +9819,7 @@ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { @@ -9878,7 +9943,7 @@ * // => 'hi fred' */ var partial = rest(function(func, partials) { - var holders = replaceHolders(partials, getPlaceholder(partial)); + var holders = replaceHolders(partials, getHolder(partial)); return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); }); @@ -9915,7 +9980,7 @@ * // => 'hello fred' */ var partialRight = rest(function(func, partials) { - var holders = replaceHolders(partials, getPlaceholder(partialRight)); + var holders = replaceHolders(partials, getHolder(partialRight)); return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); @@ -10117,7 +10182,7 @@ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); @@ -10793,14 +10858,14 @@ * _.isFinite(3); * // => true * - * _.isFinite(Number.MAX_VALUE); - * // => true - * - * _.isFinite(3.14); + * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false + * + * _.isFinite('3'); + * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); @@ -11521,6 +11586,41 @@ return func(value); } + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + /** * Converts `value` to an integer. * @@ -11535,7 +11635,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toInteger(3); + * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); @@ -11544,20 +11644,14 @@ * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * - * _.toInteger('3'); + * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - var remainder = value % 1; - return value === value ? (remainder ? value - remainder : value) : 0; + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; } /** @@ -11575,7 +11669,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toLength(3); + * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); @@ -11584,7 +11678,7 @@ * _.toLength(Infinity); * // => 4294967295 * - * _.toLength('3'); + * _.toLength('3.2'); * // => 3 */ function toLength(value) { @@ -11602,8 +11696,8 @@ * @returns {number} Returns the number. * @example * - * _.toNumber(3); - * // => 3 + * _.toNumber(3.2); + * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 @@ -11611,8 +11705,8 @@ * _.toNumber(Infinity); * // => Infinity * - * _.toNumber('3'); - * // => 3 + * _.toNumber('3.2'); + * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { @@ -11675,7 +11769,7 @@ * @returns {number} Returns the converted integer. * @example * - * _.toSafeInteger(3); + * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); @@ -11684,7 +11778,7 @@ * _.toSafeInteger(Infinity); * // => 9007199254740991 * - * _.toSafeInteger('3'); + * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { @@ -11877,7 +11971,7 @@ * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths of elements to pick. - * @returns {Array} Returns the new array of picked elements. + * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; @@ -12093,7 +12187,7 @@ function forIn(object, iteratee) { return object == null ? object - : baseFor(object, getIteratee(iteratee), keysIn); + : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** @@ -12125,7 +12219,7 @@ function forInRight(object, iteratee) { return object == null ? object - : baseForRight(object, getIteratee(iteratee), keysIn); + : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** @@ -12157,7 +12251,7 @@ * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee)); + return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** @@ -12187,7 +12281,7 @@ * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee)); + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** @@ -12199,7 +12293,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. + * @returns {Array} Returns the function names. * @see _.functionsIn * @example * @@ -12226,7 +12320,7 @@ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. + * @returns {Array} Returns the function names. * @see _.functions * @example * @@ -12579,7 +12673,7 @@ * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties - * are merged recursively.Other objects and value types are overridden by + * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * @@ -12864,7 +12958,8 @@ /** * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. * * @static * @memberOf _ @@ -12872,7 +12967,7 @@ * @alias entries * @category Object * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. + * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { @@ -12885,13 +12980,12 @@ * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ - function toPairs(object) { - return baseToPairs(object, keys(object)); - } + var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. * * @static * @memberOf _ @@ -12899,7 +12993,7 @@ * @alias entriesIn * @category Object * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. + * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { @@ -12910,11 +13004,9 @@ * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ - function toPairsIn(object) { - return baseToPairs(object, keysIn(object)); - } + var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new @@ -13744,7 +13836,7 @@ * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the new array of string segments. + * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); @@ -13889,12 +13981,6 @@ * compiled({ 'user': 'pebbles' }); * // => 'hello pebbles!' * - * // Use custom template delimiters. - * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; - * var compiled = _.template('hello {{ user }}!'); - * compiled({ 'user': 'mustache' }); - * // => 'hello mustache!' - * * // Use backslashes to treat delimiters as plain text. * var compiled = _.template('<%= "\\<%- value %\\>" %>'); * compiled({ 'value': 'ignored' }); @@ -13920,9 +14006,15 @@ * // return __p; * // } * + * // Use custom template delimiters. + * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; + * var compiled = _.template('hello {{ user }}!'); + * compiled({ 'user': 'mustache' }); + * // => 'hello mustache!' + * * // Use the `source` property to inline compiled templates for meaningful * // line numbers in error messages and stack traces. - * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ + * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ * var JST = {\ * "main": ' + _.template(mainText).source + '\ * };\ @@ -14458,7 +14550,7 @@ * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new composite function. * @example * * var func = _.cond([ @@ -14508,7 +14600,7 @@ * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ @@ -14531,7 +14623,7 @@ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new constant function. * @example * * var object = { 'user': 'fred' }; @@ -14556,7 +14648,7 @@ * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new composite function. * @see _.flowRight * @example * @@ -14579,7 +14671,7 @@ * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new composite function. * @see _.flow * @example * @@ -14672,7 +14764,7 @@ * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ @@ -14700,7 +14792,7 @@ * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new spec function. * @example * * var users = [ @@ -14725,7 +14817,7 @@ * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new invoker function. * @example * * var objects = [ @@ -14756,7 +14848,7 @@ * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new invoker function. * @example * * var array = _.times(3, _.constant), @@ -14886,7 +14978,7 @@ } /** - * Creates a function that returns its nth argument. If `n` is negative, + * Creates a function that gets the argument at `n` index. If `n` is negative, * the nth argument from the end is returned. * * @static @@ -14894,7 +14986,7 @@ * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new pass-thru function. * @example * * var func = _.nthArg(1); @@ -14992,7 +15084,7 @@ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. * @example * * var objects = [ @@ -15019,7 +15111,7 @@ * @since 3.0.0 * @category Util * @param {Object} object The object to query. - * @returns {Function} Returns the new function. + * @returns {Function} Returns the new accessor function. * @example * * var array = [0, 1, 2], @@ -15053,7 +15145,7 @@ * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. + * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * @@ -15091,7 +15183,7 @@ * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. + * @returns {Array} Returns the range of numbers. * @see _.inRange, _.range * @example * @@ -15852,6 +15944,7 @@ lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; + lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 499422919f..9f27fc1b75 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -1,126 +1,125 @@ /** * @license - * lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE - * Build: `lodash -o ./dist/lodash.js` + * lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE */ -;(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.length;++ur?false:(r==t.length-1?t.pop():Fu.call(t,r,1),true)}function Zt(t,n){var r=Tt(t,n);return 0>r?N:t[r][1]}function Tt(t,n){for(var r=t.length;r--;)if(Se(t[r][0],n))return r;return-1}function qt(t,n,r){ -var e=Tt(t,n);0>e?t.push([n,r]):t[e][1]=r}function Gt(t,n,r,e){return t===N||Se(t,xu[r])&&!wu.call(e,r)?n:t}function Jt(t,n,r){(r===N||Se(t[n],r))&&(typeof n!="number"||r!==N||n in t)||(t[n]=r)}function Yt(t,n,r){var e=t[n];wu.call(t,n)&&Se(e,r)&&(r!==N||n in t)||(t[n]=r)}function Ht(t,n,r,e){return yo(t,function(t,u,o){n(e,t,r(t),o)}),e}function Qt(t,n){return t&&ar(n,tu(n),t)}function Xt(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r=t?t:r), -n!==N&&(t=t>=n?t:n)),t}function nn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==N)return c;if(!ze(t))return t;if(o=li(t)){if(c=Pr(t),!n)return cr(t,c)}else{var a=Fr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(si(t))return er(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(L(t))return i?t:{};if(c=Zr(l?{}:t),!n)return lr(t,Qt(c,t))}else{if(!Bt[a])return i?t:{};c=Tr(t,a,nn,n)}}if(f||(f=new Ft),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?vn(t,tu,$r):tu(t); -return u(s||t,function(u,o){s&&(o=u,u=t[o]),Yt(c,o,nn(u,n,r,e,o,t,f))}),c}function rn(t){var n=tu(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===N&&!(o in Object(e))||!i(f))return false}return true}}function en(t){return ze(t)?zu(t):{}}function un(t,n,r){if(typeof t!="function")throw new yu("Expected a function");return $u(function(){t.apply(N,r)},n)}function on(t,n,r,e){var u=-1,o=f,i=true,l=t.length,s=[],h=n.length;if(!l)return s;r&&(n=a(n,A(r))),e?(o=c, -i=false):n.length>=200&&(o=zt,i=false,n=new Ut(n));t:for(;++u0&&r(f)?n>1?ln(f,n-1,r,e,u):l(u,f):e||(u[u.length]=f)}return u}function sn(t,n){return t&&xo(t,n,tu)}function hn(t,n){return t&&jo(t,n,tu)}function pn(t,n){return i(n,function(n){return Ce(t[n])})}function _n(t,n){n=Yr(n,t)?[n]:nr(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[ee(n[r++])];return r&&r==e?t:N}function vn(t,n,r){return n=n(t),li(t)?n:l(n,r(t))}function gn(t,n){return t>n}function dn(t,n){return wu.call(t,n)||typeof t=="object"&&n in t&&null===Zu(Object(t)); -}function yn(t,n){return n in Object(t)}function bn(t,n,r){for(var e=r?c:f,u=t[0].length,o=t.length,i=o,l=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=a(p,A(n))),s=Gu(p.length,s),l[i]=!r&&(n||u>=120&&p.length>=120)?new Ut(i&&p):N}var p=t[0],_=-1,v=l[0];t:for(;++_h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!zt(v,d):!e(h,d,r)){for(i=o;--i;){var y=l[i];if(y?!zt(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function xn(t,n,r){var e={};return sn(t,function(t,u,o){n(e,r(t),u,o); -}),e}function jn(t,n,e){return Yr(n,t)||(n=nr(n),t=re(t,n),n=ae(n)),n=null==t?t:t[ee(n)],null==n?N:r(n,t,e)}function mn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!ze(t)&&!De(n))n=t!==t&&n!==n;else t:{var o=li(t),i=li(n),f="[object Array]",c="[object Array]";o||(f=Fr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Fr(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!L(t),i="[object Object]"==c&&!L(n);if((c=f==c)&&!a)u||(u=new Ft),n=o||qe(t)?Br(t,n,mn,r,e,u):Lr(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 Ft),n=mn(t,n,r,e,u);break t}if(c)n:if(u||(u=new Ft),o=2&e,f=tu(t),i=f.length,c=tu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:dn(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 En(t,n){var r=-1,e=We(t)?Array(t.length):[];return yo(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function In(t){var n=Ur(t);return 1==n.length&&n[0][2]?te(n[0][0],n[0][1]):function(r){return r===t||wn(r,t,n)}}function Sn(t,n){return Yr(t)&&n===n&&!ze(n)?te(ee(t),n):function(r){ -var e=Qe(r,t);return e===N&&e===n?Xe(r,t):mn(n,e,N,3)}}function Rn(t,n,r,e,o){if(t!==n){if(!li(n)&&!qe(n))var i=nu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),ze(u)){o||(o=new Ft);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):N,p=h===N;p&&(h=s,li(s)||qe(s)?li(l)?h=l:Be(l)?h=cr(l):(p=false,h=nn(s,true)):Ne(s)||Re(s)?Re(l)?h=Ye(l):!ze(l)||r&&Ce(l)?(p=false,h=nn(s,true)):h=l:p=false),a.set(s,h),p&&Rn(h,s,r,e,a),a["delete"](s),Jt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):N,c===N&&(c=u), -Jt(t,f,c)})}}function Wn(t,n){var r=t.length;return r?(n+=0>n?r:0,Gr(n,r)?t[n]:N):void 0}function Bn(t,n,r){var e=-1;return n=a(n.length?n:[au],A(Mr())),t=En(t,function(t){return{a:a(n,function(n){return n(t)}),b:++e,c:t}}),x(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 Ln(t,n){return t=Object(t),s(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Cn(t,n){for(var r=-1,e=vn(t,nu,ko),u=e.length,o={};++rn||n>9007199254740991)return r;do n%2&&(r+=t),(n=Pu(n/2))&&(t+=t);while(n);return r}function Nn(t,n,r,e){n=Yr(n,t)?[n]:nr(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&&!Te(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u}return qn(t,n,au,r)}function qn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Te(n),a=n===N;o>u;){var l=Pu((u+o)/2),s=r(t[l]),h=s!==N,p=null===s,_=s===s,v=Te(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 Gu(o,4294967294)}function Vn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r=200){if(u=n?null:wo(t))return z(u);i=false,u=zt,l=new Ut}else l=n?[]:a;t:for(;++ee?n[e]:N);return i}function tr(t){return Be(t)?t:[]}function nr(t){return li(t)?t:Io(t)}function rr(t,n,r){var e=t.length;return r=r===N?e:r,!n&&r>=e?t:Pn(t,n,r)}function er(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ur(t){var n=new t.constructor(t.byteLength);return new Bu(n).set(new Bu(t)),n}function or(t,n){if(t!==n){var r=t!==N,e=null===t,u=t===t,o=Te(t),i=n!==N,f=null===n,c=n===n,a=Te(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 ir(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Ku(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 fr(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Ku(o-f,0),s=Array(l+a);for(e=!e;++uu)&&(s[l+r[i]]=t[u++]); -return s}function cr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r1?r[u-1]:N,i=u>2?r[2]:N,o=typeof o=="function"?(u--,o):N;for(i&&Jr(r[0],r[1],i)&&(o=3>u?N:o,u=1),n=Object(n);++ei&&f[0]!==a&&f[i-1]!==a?[]:U(f,a),i-=c.length,e>i?Sr(t,n,jr,u.placeholder,N,f,c,N,N,e-i):r(this&&this!==Vt&&this instanceof u?o:t,this,f)}var o=yr(t);return u}function xr(t){return Ee(function(n){n=ln(n,1);var r=n.length,e=r,u=wt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new yu("Expected a function");if(u&&!i&&"wrapper"==Cr(o))var i=new wt([],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=U(b,j),Sr(t,n,jr,l.placeholder,r,b,j,f,c,a-d);if(j=h?r:this,y=p?j[t]:t,d=b.length,f){x=b.length;for(var m=Gu(f.length,x),w=cr(b);m--;){var A=f[m];b[m]=Gr(A,x)?w[A]:N}}else v&&d>1&&b.reverse();return s&&d>c&&(b.length=c),this&&this!==Vt&&this instanceof l&&(y=g||yr(y)),y.apply(j,b)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?N:yr(t);return l}function mr(t,n){return function(r,e){return xn(r,t,n(e))}}function wr(t){return function(n,r){var e; -if(n===N&&r===N)return 0;if(n!==N&&(e=n),r!==N){if(e===N)return r;typeof n=="string"||typeof r=="string"?(n=Gn(n),r=Gn(r)):(n=Kn(n),r=Kn(r)),e=t(n,r)}return e}}function Ar(t){return Ee(function(n){return n=1==n.length&&li(n[0])?a(n[0],A(Mr())):a(ln(n,1,Kr),A(Mr())),Ee(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Or(t,n){n=n===N?" ":Gn(n);var r=n.length;return 2>r?r?Fn(n,t):n:(r=Fn(n,Nu(t/D(n))),It.test(n)?rr(r.match(kt),0,t).join(""):r.slice(0,t))}function kr(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!==Vt&&this instanceof o?f:t;++an?1:-1:Je(e)||0;var u=-1;r=Ku(Nu((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Ir(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=Je(n), -r=Je(r)),t(n,r)}}function Sr(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:N;i=l?N:i;var h=l?o:N;return o=l?N: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(N,n),Qr(t)&&Eo(r,n),r.placeholder=e,r}function Rr(t){var n=gu[t];return function(t,r){if(t=Je(t),r=Ke(r)){var e=(He(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(He(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Wr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new yu("Expected a function"); -var a=e?e.length:0;if(a||(n&=-97,e=u=N),i=i===N?i:Ku(Ke(i),0),f=f===N?f:Ke(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=N}var h=c?N:Ao(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?ir(e,r,h[4]):r,o[4]=e?U(o[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=o[5],o[5]=e?fr(e,r,h[6]):r,o[6]=e?U(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r), -128&t&&(o[8]=null==o[8]?h[8]:Gu(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:Ku(o[9]-a,0),!f&&24&n&&(n&=-25),(h?mo:Eo)(n&&1!=n?8==n||16==n?br(t,n,f):32!=n&&33!=n||u.length?jr.apply(N,o):kr(t,n,r,e):vr(t,n,r),o)}function Br(t,n,r,e,u,o){var i=-1,f=2&u,c=1&u,a=t.length,l=n.length;if(a!=l&&!(f&&l>a))return false;if(l=o.get(t))return l==n;for(l=true,o.set(t,n);++i-1&&0==t%1&&n>t}function Jr(t,n,r){if(!ze(r))return false;var e=typeof n;return("number"==e?We(r)&&Gr(n,r.length):"string"==e&&n in r)?Se(r[n],t):false; -}function Yr(t,n){if(li(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Te(t)?true:nt.test(t)||!tt.test(t)||null!=n&&t in Object(n)}function Hr(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}function Qr(t){var n=Cr(t),r=jt[n];return typeof r=="function"&&n in Lt.prototype?t===r?true:(n=Ao(r),!!n&&t===n[0]):false}function Xr(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||xu)}function te(t,n){return function(r){ -return null==r?false:r[t]===n&&(n!==N||t in Object(r))}}function ne(t,n,r,e,u,o){return ze(t)&&ze(n)&&Rn(t,n,N,ne,o.set(n,t)),t}function re(t,n){return 1==n.length?t:_n(t,Pn(n,0,-1))}function ee(t){if(typeof t=="string"||Te(t))return t;var n=t+"";return"0"==n&&1/t==-P?"-0":n}function ue(t){if(null!=t){try{return mu.call(t)}catch(n){}return t+""}return""}function oe(t){if(t instanceof Lt)return t.clone();var n=new wt(t.__wrapped__,t.__chain__);return n.__actions__=cr(t.__actions__),n.__index__=t.__index__, -n.__values__=t.__values__,n}function ie(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),Pn(t,0>n?0:n,e)):[]}function fe(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),n=e-n,Pn(t,0,0>n?0:n)):[]}function ce(t){return t&&t.length?t[0]:N}function ae(t){var n=t?t.length:0;return n?t[n-1]:N}function le(t,n){return t&&t.length&&n&&n.length?zn(t,n):t}function se(t){return t?Qu.call(t):t}function he(t){if(!t||!t.length)return[];var n=0;return t=i(t,function(t){return Be(t)?(n=Ku(t.length,n), -!0):void 0}),m(n,function(n){return a(t,Mn(n))})}function pe(t,n){if(!t||!t.length)return[];var e=he(t);return null==n?e:a(e,function(t){return r(n,N,t)})}function _e(t){return t=jt(t),t.__chain__=true,t}function ve(t,n){return n(t)}function ge(){return this}function de(t,n){return typeof n=="function"&&li(t)?u(t,n):yo(t,Mr(n))}function ye(t,n){var r;if(typeof n=="function"&&li(t)){for(r=t.length;r--&&false!==n(t[r],r,t););r=t}else r=bo(t,Mr(n));return r}function be(t,n){return(li(t)?a:En)(t,Mr(n,3))}function xe(t,n,r){ -var e=-1,u=Ve(t),o=u.length,i=o-1;for(n=(r?Jr(t,n,r):n===N)?1:tn(Ke(n),0,o);++e=t&&(n=N),r}}function we(t,n,r){return n=r?N:n,t=Wr(t,8,N,N,N,N,N,n),t.placeholder=we.placeholder,t}function Ae(t,n,r){return n=r?N:n, -t=Wr(t,16,N,N,N,N,N,n),t.placeholder=Ae.placeholder,t}function Oe(t,n,r){function e(n){var r=c,e=a;return c=a=N,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,!p||r>=n||0>r||g&&t>=l}function o(){var t=Xo();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?Gu(t,l-r):t,h=$u(o,r)}function i(t){return Lu(h),h=N,d&&c?e(t):(c=a=N,s)}function f(){var t=Xo(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===N)return _=t=p,h=$u(o,n),v?e(t):s;if(g)return Lu(h),h=$u(o,n),e(p)}return h===N&&(h=$u(o,n)),s}var c,a,l,s,h,p=0,_=0,v=false,g=false,d=true; -if(typeof t!="function")throw new yu("Expected a function");return n=Je(n)||0,ze(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ku(Je(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==N&&Lu(h),p=_=0,c=a=h=N},f.flush=function(){return h===N?s:i(Xo())},f}function ke(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 yu("Expected a function"); -return r.cache=new(ke.Cache||Mt),r}function Ee(t,n){if(typeof t!="function")throw new yu("Expected a function");return n=Ku(n===N?t.length-1:Ke(n),0),function(){for(var e=arguments,u=-1,o=Ku(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 De(t){return!!t&&typeof t=="object"}function $e(t){return ze(t)?(Ce(t)||L(t)?Iu:vt).test(ue(t)):false}function Fe(t){return typeof t=="number"||De(t)&&"[object Number]"==ku.call(t)}function Ne(t){return!De(t)||"[object Object]"!=ku.call(t)||L(t)?false:(t=Zu(Object(t)),null===t?true:(t=wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&mu.call(t)==Ou))}function Pe(t){return ze(t)&&"[object RegExp]"==ku.call(t); -}function Ze(t){return typeof t=="string"||!li(t)&&De(t)&&"[object String]"==ku.call(t)}function Te(t){return typeof t=="symbol"||De(t)&&"[object Symbol]"==ku.call(t)}function qe(t){return De(t)&&Ue(t.length)&&!!Wt[ku.call(t)]}function Ve(t){if(!t)return[];if(We(t))return Ze(t)?t.match(kt):cr(t);if(Uu&&t[Uu])return C(t[Uu]());var n=Fr(t);return("[object Map]"==n?M:"[object Set]"==n?z:uu)(t)}function Ke(t){if(!t)return 0===t?t:0;if(t=Je(t),t===P||t===-P)return 1.7976931348623157e308*(0>t?-1:1);var n=t%1; -return t===t?n?t-n:t:0}function Ge(t){return t?tn(Ke(t),0,4294967295):0}function Je(t){if(typeof t=="number")return t;if(Te(t))return Z;if(ze(t)&&(t=Ce(t.valueOf)?t.valueOf():t,t=ze(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ot,"");var n=_t.test(t);return n||gt.test(t)?$t(t.slice(2),n?2:8):pt.test(t)?Z:+t}function Ye(t){return ar(t,nu(t))}function He(t){return null==t?"":Gn(t)}function Qe(t,n,r){return t=null==t?N:_n(t,n),t===N?r:t}function Xe(t,n){return null!=t&&Nr(t,n,yn)}function tu(t){ -var n=Xr(t);if(!n&&!We(t))return Vu(Object(t));var r,e=qr(t),u=!!e,e=e||[],o=e.length;for(r in t)!dn(t,r)||u&&("length"==r||Gr(r,o))||n&&"constructor"==r||e.push(r);return e}function nu(t){for(var n=-1,r=Xr(t),e=On(t),u=e.length,o=qr(t),i=!!o,o=o||[],f=o.length;++ne.length?qt(e,t,n):(r.array=null,r.map=new Mt(e))),(r=r.map)&&r.set(t,n),this};var yo=pr(sn),bo=pr(hn,true),xo=_r(),jo=_r(true);Cu&&!Du.call({valueOf:1},"valueOf")&&(On=function(t){return C(Cu(t))});var mo=io?function(t,n){return io.set(t,n),t}:au,wo=eo&&1/z(new eo([,-0]))[1]==P?function(t){ -return new eo(t)}:hu,Ao=io?function(t){return io.get(t)}:hu,Oo=Mn("length");Mu||($r=function(){return[]});var ko=Mu?function(t){for(var n=[];t;)l(n,$r(t)),t=Zu(Object(t));return n}:$r;(to&&"[object DataView]"!=Fr(new to(new ArrayBuffer(1)))||no&&"[object Map]"!=Fr(new no)||ro&&"[object Promise]"!=Fr(ro.resolve())||eo&&"[object Set]"!=Fr(new eo)||uo&&"[object WeakMap]"!=Fr(new uo))&&(Fr=function(t){var n=ku.call(t);if(t=(t="[object Object]"==n?t.constructor:N)?ue(t):N)switch(t){case ao:return"[object DataView]"; -case lo:return"[object Map]";case so:return"[object Promise]";case ho:return"[object Set]";case po:return"[object WeakMap]"}return n});var Eo=function(){var t=0,n=0;return function(r,e){var u=Xo(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return mo(r,e)}}(),Io=ke(function(t){var n=[];return He(t).replace(rt,function(t,r,e,u){n.push(e?u.replace(at,"$1"):r||t)}),n}),So=Ee(function(t,n){return Be(t)?on(t,ln(n,1,Be,true)):[]}),Ro=Ee(function(t,n){var r=ae(n);return Be(r)&&(r=N),Be(t)?on(t,ln(n,1,Be,true),Mr(r)):[]; -}),Wo=Ee(function(t,n){var r=ae(n);return Be(r)&&(r=N),Be(t)?on(t,ln(n,1,Be,true),N,r):[]}),Bo=Ee(function(t){var n=a(t,tr);return n.length&&n[0]===t[0]?bn(n):[]}),Lo=Ee(function(t){var n=ae(t),r=a(t,tr);return n===ae(r)?n=N:r.pop(),r.length&&r[0]===t[0]?bn(r,Mr(n)):[]}),Co=Ee(function(t){var n=ae(t),r=a(t,tr);return n===ae(r)?n=N:r.pop(),r.length&&r[0]===t[0]?bn(r,N,n):[]}),Mo=Ee(le),Uo=Ee(function(t,n){n=ln(n,1);var r=t?t.length:0,e=Xt(t,n);return Dn(t,a(n,function(t){return Gr(t,r)?+t:t}).sort(or)), -e}),zo=Ee(function(t){return Jn(ln(t,1,Be,true))}),Do=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Jn(ln(t,1,Be,true),Mr(n))}),$o=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Jn(ln(t,1,Be,true),N,n)}),Fo=Ee(function(t,n){return Be(t)?on(t,n):[]}),No=Ee(function(t){return Qn(i(t,Be))}),Po=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Qn(i(t,Be),Mr(n))}),Zo=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Qn(i(t,Be),N,n)}),To=Ee(he),qo=Ee(function(t){var n=t.length,n=n>1?t[n-1]:N,n=typeof n=="function"?(t.pop(), -n):N;return pe(t,n)}),Vo=Ee(function(t){function n(n){return Xt(n,t)}t=ln(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof Lt&&Gr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:ve,args:[n],thisArg:N}),new wt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(N),t})):this.thru(n)}),Ko=sr(function(t,n,r){wu.call(t,r)?++t[r]:t[r]=1}),Go=sr(function(t,n,r){wu.call(t,r)?t[r].push(n):t[r]=[n]}),Jo=Ee(function(t,n,e){var u=-1,o=typeof n=="function",i=Yr(n),f=We(t)?Array(t.length):[]; -return yo(t,function(t){var c=o?n:i&&null!=t?t[n]:N;f[++u]=c?r(c,t,e):jn(t,n,e)}),f}),Yo=sr(function(t,n,r){t[r]=n}),Ho=sr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Qo=Ee(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Jr(t,n[0],n[1])?n=[]:r>2&&Jr(n[0],n[1],n[2])&&(n=[n[0]]),n=1==n.length&&li(n[0])?n[0]:ln(n,1,Kr),Bn(t,n,[])}),Xo=_u.now,ti=Ee(function(t,n,r){var e=1;if(r.length)var u=U(r,Dr(ti)),e=32|e;return Wr(t,e,n,r,u)}),ni=Ee(function(t,n,r){var e=3;if(r.length)var u=U(r,Dr(ni)),e=32|e; -return Wr(n,e,t,r,u)}),ri=Ee(function(t,n){return un(t,1,n)}),ei=Ee(function(t,n,r){return un(t,Je(n)||0,r)});ke.Cache=Mt;var ui=Ee(function(t,n){n=1==n.length&&li(n[0])?a(n[0],A(Mr())):a(ln(n,1,Kr),A(Mr()));var e=n.length;return Ee(function(u){for(var o=-1,i=Gu(u.length,e);++o=n}),li=Array.isArray,si=Su?function(t){return t instanceof Su}:cu(false),hi=Ir(kn),pi=Ir(function(t,n){return n>=t}),_i=hr(function(t,n){if(fo||Xr(n)||We(n))ar(n,tu(n),t);else for(var r in n)wu.call(n,r)&&Yt(t,r,n[r])}),vi=hr(function(t,n){if(fo||Xr(n)||We(n))ar(n,nu(n),t);else for(var r in n)Yt(t,r,n[r])}),gi=hr(function(t,n,r,e){ar(n,nu(n),t,e)}),di=hr(function(t,n,r,e){ar(n,tu(n),t,e)}),yi=Ee(function(t,n){return Xt(t,ln(n,1))}),bi=Ee(function(t){return t.push(N,Gt), -r(gi,N,t)}),xi=Ee(function(t){return t.push(N,ne),r(Oi,N,t)}),ji=mr(function(t,n,r){t[n]=r},cu(au)),mi=mr(function(t,n,r){wu.call(t,n)?t[n].push(r):t[n]=[r]},Mr),wi=Ee(jn),Ai=hr(function(t,n,r){Rn(t,n,r)}),Oi=hr(function(t,n,r,e){Rn(t,n,r,e)}),ki=Ee(function(t,n){return null==t?{}:(n=a(ln(n,1),ee),Ln(t,on(vn(t,nu,ko),n)))}),Ei=Ee(function(t,n){return null==t?{}:Ln(t,a(ln(n,1),ee))}),Ii=dr(function(t,n,r){return n=n.toLowerCase(),t+(r?ou(n):n)}),Si=dr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase(); -}),Ri=dr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Wi=gr("toLowerCase"),Bi=dr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Li=dr(function(t,n,r){return t+(r?" ":"")+Mi(n)}),Ci=dr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),Mi=gr("toUpperCase"),Ui=Ee(function(t,n){try{return r(t,N,n)}catch(e){return Le(e)?e:new vu(e)}}),zi=Ee(function(t,n){return u(ln(n,1),function(n){n=ee(n),t[n]=ti(t[n],t)}),t}),Di=xr(),$i=xr(true),Fi=Ee(function(t,n){return function(r){return jn(r,t,n); -}}),Ni=Ee(function(t,n){return function(r){return jn(t,r,n)}}),Pi=Ar(a),Zi=Ar(o),Ti=Ar(p),qi=Er(),Vi=Er(true),Ki=wr(function(t,n){return t+n}),Gi=Rr("ceil"),Ji=wr(function(t,n){return t/n}),Yi=Rr("floor"),Hi=wr(function(t,n){return t*n}),Qi=Rr("round"),Xi=wr(function(t,n){return t-n});return jt.after=function(t,n){if(typeof n!="function")throw new yu("Expected a function");return t=Ke(t),function(){return 1>--t?n.apply(this,arguments):void 0}},jt.ary=je,jt.assign=_i,jt.assignIn=vi,jt.assignInWith=gi, -jt.assignWith=di,jt.at=yi,jt.before=me,jt.bind=ti,jt.bindAll=zi,jt.bindKey=ni,jt.castArray=Ie,jt.chain=_e,jt.chunk=function(t,n,r){if(n=(r?Jr(t,n,r):n===N)?1:Ku(Ke(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Nu(r/n));r>e;)o[u++]=Pn(t,e,e+=n);return o},jt.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++nt)return t?cr(n):[];for(var r=Array(t-1);t--;)r[t-1]=arguments[t]; -for(var t=ln(r,1),r=-1,e=n.length,u=-1,o=t.length,i=Array(e+o);++rr&&(r=-r>u?0:u+r),e=e===N||e>u?u:Ke(e),0>e&&(e+=u),e=r>e?0:Ge(e);e>r;)t[r++]=n; -return t},jt.filter=function(t,n){return(li(t)?i:an)(t,Mr(n,3))},jt.flatMap=function(t,n){return ln(be(t,n),1)},jt.flatMapDeep=function(t,n){return ln(be(t,n),P)},jt.flatMapDepth=function(t,n,r){return r=r===N?1:Ke(r),ln(be(t,n),r)},jt.flatten=function(t){return t&&t.length?ln(t,1):[]},jt.flattenDeep=function(t){return t&&t.length?ln(t,P):[]},jt.flattenDepth=function(t,n){return t&&t.length?(n=n===N?1:Ke(n),ln(t,n)):[]},jt.flip=function(t){return Wr(t,512)},jt.flow=Di,jt.flowRight=$i,jt.fromPairs=function(t){ -for(var n=-1,r=t?t.length:0,e={};++n>>0,r?(t=He(t))&&(typeof n=="string"||null!=n&&!Pe(n))&&(n=Gn(n),""==n&&It.test(t))?rr(t.match(kt),0,r):Xu.call(t,n,r):[]},jt.spread=function(t,n){if(typeof t!="function")throw new yu("Expected a function");return n=n===N?0:Ku(Ke(n),0),Ee(function(e){var u=e[n];return e=rr(e,0,n),u&&l(e,u),r(t,this,e)})},jt.tail=function(t){return ie(t,1)},jt.take=function(t,n,r){return t&&t.length?(n=r||n===N?1:Ke(n),Pn(t,0,0>n?0:n)):[]},jt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n), -n=e-n,Pn(t,0>n?0:n,e)):[]},jt.takeRightWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3),false,true):[]},jt.takeWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3)):[]},jt.tap=function(t,n){return n(t),t},jt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new yu("Expected a function");return ze(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Oe(t,n,{leading:e,maxWait:n,trailing:u})},jt.thru=ve,jt.toArray=Ve,jt.toPairs=ru,jt.toPairsIn=eu,jt.toPath=function(t){ -return li(t)?a(t,ee):Te(t)?[t]:cr(Io(t))},jt.toPlainObject=Ye,jt.transform=function(t,n,r){var e=li(t)||qe(t);if(n=Mr(n,4),null==r)if(e||ze(t)){var o=t.constructor;r=e?li(t)?new o:[]:Ce(o)?en(Zu(Object(t))):{}}else r={};return(e?u:sn)(t,function(t,e,u){return n(r,t,e,u)}),r},jt.unary=function(t){return je(t,1)},jt.union=zo,jt.unionBy=Do,jt.unionWith=$o,jt.uniq=function(t){return t&&t.length?Jn(t):[]},jt.uniqBy=function(t,n){return t&&t.length?Jn(t,Mr(n)):[]},jt.uniqWith=function(t,n){return t&&t.length?Jn(t,N,n):[]; -},jt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Yr(e,r)?[e]:nr(e);r=re(r,e),e=ee(ae(e)),r=!(null!=r&&dn(r,e))||delete r[e]}return r},jt.unzip=he,jt.unzipWith=pe,jt.update=function(t,n,r){return null==t?t:Nn(t,n,(typeof r=="function"?r:au)(_n(t,n)),void 0)},jt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:N,null!=t&&(t=Nn(t,n,(typeof r=="function"?r:au)(_n(t,n)),e)),t},jt.values=uu,jt.valuesIn=function(t){return null==t?[]:O(t,nu(t))},jt.without=Fo,jt.words=fu,jt.wrap=function(t,n){ -return n=null==n?au:n,oi(n,t)},jt.xor=No,jt.xorBy=Po,jt.xorWith=Zo,jt.zip=To,jt.zipObject=function(t,n){return Xn(t||[],n||[],Yt)},jt.zipObjectDeep=function(t,n){return Xn(t||[],n||[],Nn)},jt.zipWith=qo,jt.entries=ru,jt.entriesIn=eu,jt.extend=vi,jt.extendWith=gi,su(jt,jt),jt.add=Ki,jt.attempt=Ui,jt.camelCase=Ii,jt.capitalize=ou,jt.ceil=Gi,jt.clamp=function(t,n,r){return r===N&&(r=n,n=N),r!==N&&(r=Je(r),r=r===r?r:0),n!==N&&(n=Je(n),n=n===n?n:0),tn(Je(t),n,r)},jt.clone=function(t){return nn(t,false,true); -},jt.cloneDeep=function(t){return nn(t,true,true)},jt.cloneDeepWith=function(t,n){return nn(t,true,true,n)},jt.cloneWith=function(t,n){return nn(t,false,true,n)},jt.deburr=iu,jt.divide=Ji,jt.endsWith=function(t,n,r){t=He(t),n=Gn(n);var e=t.length;return r=r===N?e:tn(Ke(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},jt.eq=Se,jt.escape=function(t){return(t=He(t))&&Y.test(t)?t.replace(G,R):t},jt.escapeRegExp=function(t){return(t=He(t))&&ut.test(t)?t.replace(et,"\\$&"):t},jt.every=function(t,n,r){var e=li(t)?o:fn;return r&&Jr(t,n,r)&&(n=N), -e(t,Mr(n,3))},jt.find=function(t,n){if(n=Mr(n,3),li(t)){var r=v(t,n);return r>-1?t[r]:N}return _(t,n,yo)},jt.findIndex=function(t,n){return t&&t.length?v(t,Mr(n,3)):-1},jt.findKey=function(t,n){return _(t,Mr(n,3),sn,true)},jt.findLast=function(t,n){if(n=Mr(n,3),li(t)){var r=v(t,n,true);return r>-1?t[r]:N}return _(t,n,bo)},jt.findLastIndex=function(t,n){return t&&t.length?v(t,Mr(n,3),true):-1},jt.findLastKey=function(t,n){return _(t,Mr(n,3),hn,true)},jt.floor=Yi,jt.forEach=de,jt.forEachRight=ye,jt.forIn=function(t,n){ -return null==t?t:xo(t,Mr(n),nu)},jt.forInRight=function(t,n){return null==t?t:jo(t,Mr(n),nu)},jt.forOwn=function(t,n){return t&&sn(t,Mr(n))},jt.forOwnRight=function(t,n){return t&&hn(t,Mr(n))},jt.get=Qe,jt.gt=ci,jt.gte=ai,jt.has=function(t,n){return null!=t&&Nr(t,n,dn)},jt.hasIn=Xe,jt.head=ce,jt.identity=au,jt.includes=function(t,n,r,e){return t=We(t)?t:uu(t),r=r&&!e?Ke(r):0,e=t.length,0>r&&(r=Ku(e+r,0)),Ze(t)?e>=r&&-1r&&(r=Ku(e+r,0)),g(t,n,r)):-1},jt.inRange=function(t,n,r){return n=Je(n)||0,r===N?(r=n,n=0):r=Je(r)||0,t=Je(t),t>=Gu(n,r)&&t=-9007199254740991&&9007199254740991>=t; -},jt.isSet=function(t){return De(t)&&"[object Set]"==Fr(t)},jt.isString=Ze,jt.isSymbol=Te,jt.isTypedArray=qe,jt.isUndefined=function(t){return t===N},jt.isWeakMap=function(t){return De(t)&&"[object WeakMap]"==Fr(t)},jt.isWeakSet=function(t){return De(t)&&"[object WeakSet]"==ku.call(t)},jt.join=function(t,n){return t?qu.call(t,n):""},jt.kebabCase=Si,jt.last=ae,jt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==N&&(u=Ke(r),u=(0>u?Ku(e+u,0):Gu(u,e-1))+1),n!==n)return B(t,u,true); -for(;u--;)if(t[u]===n)return u;return-1},jt.lowerCase=Ri,jt.lowerFirst=Wi,jt.lt=hi,jt.lte=pi,jt.max=function(t){return t&&t.length?cn(t,au,gn):N},jt.maxBy=function(t,n){return t&&t.length?cn(t,Mr(n),gn):N},jt.mean=function(t){return y(t,au)},jt.meanBy=function(t,n){return y(t,Mr(n))},jt.min=function(t){return t&&t.length?cn(t,au,kn):N},jt.minBy=function(t,n){return t&&t.length?cn(t,Mr(n),kn):N},jt.multiply=Hi,jt.nth=function(t,n){return t&&t.length?Wn(t,Ke(n)):N},jt.noConflict=function(){return Vt._===this&&(Vt._=Eu), -this},jt.noop=hu,jt.now=Xo,jt.pad=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return!n||e>=n?t:(n=(n-e)/2,Or(Pu(n),r)+t+Or(Nu(n),r))},jt.padEnd=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return n&&n>e?t+Or(n-e,r):t},jt.padStart=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return n&&n>e?Or(n-e,r)+t:t},jt.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=He(t).replace(ot,""),Ju(t,n||(ht.test(t)?16:10))},jt.random=function(t,n,r){if(r&&typeof r!="boolean"&&Jr(t,n,r)&&(n=r=N),r===N&&(typeof n=="boolean"?(r=n, -n=N):typeof t=="boolean"&&(r=t,t=N)),t===N&&n===N?(t=0,n=1):(t=Je(t)||0,n===N?(n=t,t=0):n=Je(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=Yu(),Gu(t+r*(n-t+Dt("1e-"+((r+"").length-1))),n)):$n(t,n)},jt.reduce=function(t,n,r){var e=li(t)?s:b,u=3>arguments.length;return e(t,Mr(n,4),r,u,yo)},jt.reduceRight=function(t,n,r){var e=li(t)?h:b,u=3>arguments.length;return e(t,Mr(n,4),r,u,bo)},jt.repeat=function(t,n,r){return n=(r?Jr(t,n,r):n===N)?1:Ke(n),Fn(He(t),n)},jt.replace=function(){var t=arguments,n=He(t[0]); -return 3>t.length?n:Hu.call(n,t[1],t[2])},jt.result=function(t,n,r){n=Yr(n,t)?[n]:nr(n);var e=-1,u=n.length;for(u||(t=N,u=1);++e0?t[$n(0,n-1)]:N},jt.size=function(t){if(null==t)return 0;if(We(t)){var n=t.length;return n&&Ze(t)?D(t):n}return De(t)&&(n=Fr(t),"[object Map]"==n||"[object Set]"==n)?t.size:tu(t).length},jt.snakeCase=Bi, -jt.some=function(t,n,r){var e=li(t)?p:Zn;return r&&Jr(t,n,r)&&(n=N),e(t,Mr(n,3))},jt.sortedIndex=function(t,n){return Tn(t,n)},jt.sortedIndexBy=function(t,n,r){return qn(t,n,Mr(r))},jt.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Tn(t,n);if(r>e&&Se(t[e],n))return e}return-1},jt.sortedLastIndex=function(t,n){return Tn(t,n,true)},jt.sortedLastIndexBy=function(t,n,r){return qn(t,n,Mr(r),true)},jt.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(Se(t[r],n))return r}return-1; -},jt.startCase=Li,jt.startsWith=function(t,n,r){return t=He(t),r=tn(Ke(r),0,t.length),t.lastIndexOf(Gn(n),r)==r},jt.subtract=Xi,jt.sum=function(t){return t&&t.length?j(t,au):0},jt.sumBy=function(t,n){return t&&t.length?j(t,Mr(n)):0},jt.template=function(t,n,r){var e=jt.templateSettings;r&&Jr(t,n,r)&&(n=N),t=He(t),n=gi({},n,e,Gt),r=gi({},n.imports,e.imports,Gt);var u,o,i=tu(r),f=O(r,i),c=0;r=n.interpolate||bt;var a="__p+='";r=du((n.escape||bt).source+"|"+r.source+"|"+(r===X?lt:bt).source+"|"+(n.evaluate||bt).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(xt,W),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(T,""):a).replace(q,"$1").replace(V,"$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=Ui(function(){return Function(i,l+"return "+a).apply(N,f)}),n.source=a,Le(n))throw n;return n},jt.times=function(t,n){if(t=Ke(t),1>t||t>9007199254740991)return[];var r=4294967295,e=Gu(t,4294967295);for(n=Mr(n),t-=4294967295,e=m(e,n);++r=o)return t;if(o=r-D(e),1>o)return e;if(r=i?rr(i,0,o).join(""):t.slice(0,o),u===N)return r+e;if(i&&(o+=r.length-o),Pe(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=du(u.source,He(st.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===N?o:c)}}else t.indexOf(Gn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},jt.unescape=function(t){return(t=He(t))&&J.test(t)?t.replace(K,$):t},jt.uniqueId=function(t){ -var n=++Au;return He(t)+n},jt.upperCase=Ci,jt.upperFirst=Mi,jt.each=de,jt.eachRight=ye,jt.first=ce,su(jt,function(){var t={};return sn(jt,function(n,r){wu.call(jt.prototype,r)||(t[r]=n)}),t}(),{chain:false}),jt.VERSION="4.11.2",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){jt[t].placeholder=jt}),u(["drop","take"],function(t,n){Lt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Lt(this);r=r===N?1:Ku(Ke(r),0);var u=this.clone();return e?u.__takeCount__=Gu(r,u.__takeCount__):u.__views__.push({ -size:Gu(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Lt.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;Lt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Mr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Lt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right"); -Lt.prototype[t]=function(){return this.__filtered__?new Lt(this):this[r](1)}}),Lt.prototype.compact=function(){return this.filter(au)},Lt.prototype.find=function(t){return this.filter(t).head()},Lt.prototype.findLast=function(t){return this.reverse().find(t)},Lt.prototype.invokeMap=Ee(function(t,n){return typeof t=="function"?new Lt(this):this.map(function(r){return jn(r,t,n)})}),Lt.prototype.reject=function(t){return t=Mr(t,3),this.filter(function(n){return!t(n)})},Lt.prototype.slice=function(t,n){ -t=Ke(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Lt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==N&&(n=Ke(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Lt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Lt.prototype.toArray=function(){return this.take(4294967295)},sn(Lt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=jt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(jt.prototype[n]=function(){ -function n(t){return t=u.apply(jt,l([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Lt,a=f[0],s=c||li(i);s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new Lt(this),i=t.apply(i,f),i.__actions__.push({func:ve,args:[n],thisArg:N}),new wt(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=bu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t); -jt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(li(u)?u:[],t)}return this[r](function(r){return n.apply(li(r)?r:[],t)})}}),sn(Lt.prototype,function(t,n){var r=jt[n];if(r){var e=r.name+"";(co[e]||(co[e]=[])).push({name:n,func:r})}}),co[jr(N,2).name]=[{name:"wrapper",func:N}],Lt.prototype.clone=function(){var t=new Lt(this.__wrapped__);return t.__actions__=cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cr(this.__iteratees__), -t.__takeCount__=this.__takeCount__,t.__views__=cr(this.__views__),t},Lt.prototype.reverse=function(){if(this.__filtered__){var t=new Lt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},Lt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=li(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 Hn(n,this.__actions__);e=[];t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o=this.__values__.length,n=t?N:this.__values__[this.__index__++];return{done:t,value:n}},jt.prototype.plant=function(t){for(var n,r=this;r instanceof mt;){var e=oe(r);e.__index__=0,e.__values__=N,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},jt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Lt?(this.__actions__.length&&(t=new Lt(this)),t=t.reverse(),t.__actions__.push({func:ve, -args:[se],thisArg:N}),new wt(t,this.__chain__)):this.thru(se)},jt.prototype.toJSON=jt.prototype.valueOf=jt.prototype.value=function(){return Hn(this.__wrapped__,this.__actions__)},Uu&&(jt.prototype[Uu]=ge),jt}var N,P=1/0,Z=NaN,T=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,V=/(__e\(.*?\)|\b__t\))\+'';/g,K=/&(?:amp|lt|gt|quot|#39|#96);/g,G=/[&<>"'`]/g,J=RegExp(K.source),Y=RegExp(G.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,et=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(et.source),ot=/^\s+|\s+$/g,it=/^\s+/,ft=/\s+$/,ct=/[a-zA-Z0-9]+/g,at=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ht=/^0x/i,pt=/^[-+]0x[0-9a-f]+$/i,_t=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,bt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,jt="[\\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])?)*",mt="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+jt,wt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",At=RegExp("['\u2019]","g"),Ot=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),kt=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+wt+jt,"g"),Et=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+",mt].join("|"),"g"),It=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),St=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rt="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(" "),Wt={}; -Wt["[object Float32Array]"]=Wt["[object Float64Array]"]=Wt["[object Int8Array]"]=Wt["[object Int16Array]"]=Wt["[object Int32Array]"]=Wt["[object Uint8Array]"]=Wt["[object Uint8ClampedArray]"]=Wt["[object Uint16Array]"]=Wt["[object Uint32Array]"]=true,Wt["[object Arguments]"]=Wt["[object Array]"]=Wt["[object ArrayBuffer]"]=Wt["[object Boolean]"]=Wt["[object DataView]"]=Wt["[object Date]"]=Wt["[object Error]"]=Wt["[object Function]"]=Wt["[object Map]"]=Wt["[object Number]"]=Wt["[object Object]"]=Wt["[object RegExp]"]=Wt["[object Set]"]=Wt["[object String]"]=Wt["[object WeakMap]"]=false; -var Bt={};Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object DataView]"]=Bt["[object Boolean]"]=Bt["[object Date]"]=Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object Symbol]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=true, -Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object WeakMap]"]=false;var Lt={"\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"},Ct={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Mt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ut={"function":true,object:true},zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" -},Dt=parseFloat,$t=parseInt,Ft=Ut[typeof exports]&&exports&&!exports.nodeType?exports:N,Nt=Ut[typeof module]&&module&&!module.nodeType?module:N,Pt=Nt&&Nt.exports===Ft?Ft:N,Zt=I(Ut[typeof self]&&self),Tt=I(Ut[typeof window]&&window),qt=I(Ut[typeof this]&&this),Vt=I(Ft&&Nt&&typeof global=="object"&&global)||Tt!==(qt&&qt.window)&&Tt||Zt||qt||Function("return this")(),Kt=F();(Tt||Zt||{})._=Kt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Kt}):Ft&&Nt?(Pt&&((Nt.exports=Kt)._=Kt), -Ft._=Kt):Vt._=Kt}).call(this); \ No newline at end of file +;(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.length;++u=t?t:r), +n!==T&&(t=t>=n?t:n)),t}function nn(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(!Ue(t))return t;if(o=ai(t)){if(c=Tr(t),!n)return cr(t,c)}else{var a=Pr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(li(t))return er(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=qr(l?{}:t),!n)return lr(t,Qt(c,t))}else{if(!Ct[a])return i?t:{};c=Vr(t,a,nn,n)}}if(f||(f=new Zt),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?vn(t,nu,Nr):nu(t); +return u(s||t,function(u,o){s&&(o=u,u=t[o]),Kt(c,o,nn(u,n,r,e,o,t,f))}),c}function rn(t){var n=nu(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 en(t){return Ue(t)?zu(t):{}}function un(t,n,r){if(typeof t!="function")throw new du("Expected a function");return Du(function(){t.apply(T,r)},n)}function on(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 $t(n));t:for(;++u0&&r(f)?n>1?ln(f,n-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function sn(t,n){return t&&bo(t,n,nu)}function hn(t,n){return t&&xo(t,n,nu)}function pn(t,n){return f(n,function(n){return Me(t[n])})}function _n(t,n){n=Qr(n,t)?[n]:nr(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[ue(n[r++])];return r&&r==e?t:T}function vn(t,n,r){return n=n(t),ai(t)?n:s(n,r(t))}function gn(t,n){return t>n}function dn(t,n){return wu.call(t,n)||typeof t=="object"&&n in t&&null===Pu(Object(t)); +}function yn(t,n){return n in Object(t)}function bn(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=Ku(p.length,s),f[i]=!r&&(n||u>=120&&p.length>=120)?new $t(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 xn(t,n,r){var e={};return sn(t,function(t,u,o){n(e,r(t),u,o); +}),e}function jn(t,n,e){return Qr(n,t)||(n=nr(n),t=ee(t,n),n=le(n)),n=null==t?t:t[ue(n)],null==n?T:r(n,t,e)}function wn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Ue(t)&&!De(n))n=t!==t&&n!==n;else t:{var o=ai(t),i=ai(n),f="[object Array]",c="[object Array]";o||(f=Pr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Pr(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 Zt),n=o||qe(t)?Lr(t,n,wn,r,e,u):Mr(t,n,f,wn,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 Zt),n=wn(t,n,r,e,u);break t}if(c)n:if(u||(u=new Zt),o=2&e,f=nu(t),i=f.length,c=nu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:dn(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 En(t,n){var r=-1,e=We(t)?Array(t.length):[];return go(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function In(t){var n=Fr(t);return 1==n.length&&n[0][2]?ne(n[0][0],n[0][1]):function(r){return r===t||mn(r,t,n)}}function Sn(t,n){return Qr(t)&&n===n&&!Ue(n)?ne(ue(t),n):function(r){ +var e=Xe(r,t);return e===T&&e===n?tu(r,t):wn(n,e,T,3)}}function Rn(t,n,r,e,o){if(t!==n){if(!ai(n)&&!qe(n))var i=ru(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),Ue(u)){o||(o=new Zt);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Vt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):T,p=h===T;p&&(h=s,ai(s)||qe(s)?ai(l)?h=l:Be(l)?h=cr(l):(p=false,h=nn(s,true)):Ne(s)||Re(s)?Re(l)?h=He(l):!Ue(l)||r&&Me(l)?(p=false,h=nn(s,true)):h=l:p=false),a.set(s,h),p&&Rn(h,s,r,e,a),a["delete"](s),Vt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):T,c===T&&(c=u), +Vt(t,f,c)})}}function Wn(t,n){var r=t.length;return r?(n+=0>n?r:0,Yr(n,r)?t[n]:T):void 0}function Bn(t,n,r){var e=-1;return n=l(n.length?n:[cu],O(Ur())),t=En(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 Ln(t,n){return t=Object(t),h(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Mn(t,n){for(var r=-1,e=vn(t,ru,Oo),u=e.length,o={};++rn||n>9007199254740991)return r;do n%2&&(r+=t),(n=Nu(n/2))&&(t+=t);while(n);return r}function Nn(t,n,r,e){n=Qr(n,t)?[n]:nr(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&&!Te(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u}return qn(t,n,cu,r)}function qn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Te(n),a=n===T;o>u;){var l=Nu((u+o)/2),s=r(t[l]),h=s!==T,p=null===s,_=s===s,v=Te(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 Ku(o,4294967294)}function Vn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r=200){if(u=n?null:wo(t))return F(u);i=false,u=E,l=new $t}else l=n?[]:f;t:for(;++ee?n[e]:T);return i}function tr(t){return Be(t)?t:[]}function nr(t){return ai(t)?t:Eo(t)}function rr(t,n,r){var e=t.length;return r=r===T?e:r,!n&&r>=e?t:Pn(t,n,r)}function er(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ur(t){var n=new t.constructor(t.byteLength);return new Wu(n).set(new Wu(t)),n}function or(t,n){if(t!==n){var r=t!==T,e=null===t,u=t===t,o=Te(t),i=n!==T,f=null===n,c=n===n,a=Te(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 ir(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Vu(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 fr(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Vu(o-f,0),s=Array(l+a);for(e=!e;++uu)&&(s[l+r[i]]=t[u++]); +return s}function cr(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&&Hr(r[0],r[1],i)&&(o=3>u?T:o, +u=1),n=Object(n);++ei&&f[0]!==a&&f[i-1]!==a?[]:D(f,a),i-=c.length,e>i?Sr(t,n,jr,u.placeholder,T,f,c,T,T,e-i):r(this&&this!==Jt&&this instanceof u?o:t,this,f)}var o=yr(t);return u}function xr(t){return Ie(function(n){n=ln(n,1);var r=n.length,e=r,u=kt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e]; +if(typeof o!="function")throw new du("Expected a function");if(u&&!i&&"wrapper"==Cr(o))var i=new kt([],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=D(y,j),Sr(t,n,jr,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=Ku(f.length,x),m=cr(y);w--;){var A=f[w];y[w]=Yr(A,x)?m[A]:T}}else v&&d>1&&y.reverse();return s&&d>c&&(y.length=c),this&&this!==Jt&&this instanceof l&&(b=g||yr(b)),b.apply(j,y)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?T:yr(t); +return l}function wr(t,n){return function(r,e){return xn(r,t,n(e))}}function mr(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=Gn(n),r=Gn(r)):(n=Kn(n),r=Kn(r)),e=t(n,r)}return e}}function Ar(t){return Ie(function(n){return n=1==n.length&&ai(n[0])?l(n[0],O(Ur())):l(ln(n,1,Jr),O(Ur())),Ie(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Or(t,n){n=n===T?" ":Gn(n);var r=n.length;return 2>r?r?$n(n,t):n:(r=$n(n,$u(t/N(n))), +Wt.test(n)?rr(r.match(St),0,t).join(""):r.slice(0,t))}function kr(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!==Jt&&this instanceof o?f:t;++an?1:-1:Ye(e)||0;var u=-1;r=Vu($u((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n, +n+=e;return o}}function Ir(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=Ye(n),r=Ye(r)),t(n,r)}}function Sr(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),Xr(t)&&ko(r,n),r.placeholder=e,r}function Rr(t){var n=vu[t];return function(t,r){if(t=Ye(t),r=Ge(r)){var e=(Qe(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(Qe(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t); +}}function Wr(t){return function(n){var r=Pr(n);return"[object Map]"==r?U(n):"[object Set]"==r?$(n):A(n,t(n))}}function Br(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new du("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=T),i=i===T?i:Vu(Ge(i),0),f=f===T?f:Ge(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=T}var h=c?T:mo(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?ir(e,r,h[4]):r,o[4]=e?D(o[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=o[5],o[5]=e?fr(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]:Ku(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:Vu(o[9]-a,0),!f&&24&n&&(n&=-25),(h?jo:ko)(n&&1!=n?8==n||16==n?br(t,n,f):32!=n&&33!=n||u.length?jr.apply(T,o):kr(t,n,r,e):vr(t,n,r),o)}function Lr(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 $t:T;for(o.set(t,n);++c-1&&0==t%1&&n>t}function Hr(t,n,r){if(!Ue(r))return false;var e=typeof n;return("number"==e?We(r)&&Yr(n,r.length):"string"==e&&n in r)?Se(r[n],t):false}function Qr(t,n){if(ai(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Te(t)?true:ut.test(t)||!et.test(t)||null!=n&&t in Object(n); +}function Xr(t){var n=Cr(t),r=At[n];return typeof r=="function"&&n in zt.prototype?t===r?true:(n=mo(r),!!n&&t===n[0]):false}function te(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||bu)}function ne(t,n){return function(r){return null==r?false:r[t]===n&&(n!==T||t in Object(r))}}function re(t,n,r,e,u,o){return Ue(t)&&Ue(n)&&Rn(t,n,T,re,o.set(n,t)),t}function ee(t,n){return 1==n.length?t:_n(t,Pn(n,0,-1))}function ue(t){if(typeof t=="string"||Te(t))return t;var n=t+"";return"0"==n&&1/t==-q?"-0":n; +}function oe(t){if(null!=t){try{return ju.call(t)}catch(n){}return t+""}return""}function ie(t){if(t instanceof zt)return t.clone();var n=new kt(t.__wrapped__,t.__chain__);return n.__actions__=cr(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function fe(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ge(n),Pn(t,0>n?0:n,e)):[]}function ce(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ge(n),n=e-n,Pn(t,0,0>n?0:n)):[]}function ae(t){return t&&t.length?t[0]:T}function le(t){var n=t?t.length:0; +return n?t[n-1]:T}function se(t,n){return t&&t.length&&n&&n.length?Un(t,n):t}function he(t){return t?Hu.call(t):t}function pe(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){return Be(t)?(n=Vu(t.length,n),true):void 0}),m(n,function(n){return l(t,Cn(n))})}function _e(t,n){if(!t||!t.length)return[];var e=pe(t);return null==n?e:l(e,function(t){return r(n,T,t)})}function ve(t){return t=At(t),t.__chain__=true,t}function ge(t,n){return n(t)}function de(){return this}function ye(t,n){return(ai(t)?u:go)(t,Ur(n,3)); +}function be(t,n){return(ai(t)?o:yo)(t,Ur(n,3))}function xe(t,n){return(ai(t)?l:En)(t,Ur(n,3))}function je(t,n,r){var e=-1,u=Ve(t),o=u.length,i=o-1;for(n=(r?Hr(t,n,r):n===T)?1:tn(Ge(n),0,o);++e=t&&(n=T),r}}function Ae(t,n,r){ +return n=r?T:n,t=Br(t,8,T,T,T,T,T,n),t.placeholder=Ae.placeholder,t}function Oe(t,n,r){return n=r?T:n,t=Br(t,16,T,T,T,T,T,n),t.placeholder=Oe.placeholder,t}function ke(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||r>=n||0>r||g&&t>=l}function o(){var t=Qo();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?Ku(t,l-r):t,h=Du(o,r)}function i(t){return Bu(h),h=T,d&&c?e(t):(c=a=T,s)}function f(){var t=Qo(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===T)return _=t=p, +h=Du(o,n),v?e(t):s;if(g)return Bu(h),h=Du(o,n),e(p)}return h===T&&(h=Du(o,n)),s}var c,a,l,s,h,p=0,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new du("Expected a function");return n=Ye(n)||0,Ue(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Vu(Ye(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&Bu(h),p=_=0,c=a=h=T},f.flush=function(){return h===T?s:i(Qo())},f}function Ee(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 du("Expected a function");return r.cache=new(Ee.Cache||Ft),r}function Ie(t,n){if(typeof t!="function")throw new du("Expected a function");return n=Vu(n===T?t.length-1:Ge(n),0),function(){for(var e=arguments,u=-1,o=Vu(e.length-n,0),i=Array(o);++u-1&&0==t%1&&9007199254740991>=t}function Ue(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function De(t){return!!t&&typeof t=="object"}function Fe(t){return Ue(t)?(Me(t)||C(t)?Eu:yt).test(oe(t)):false}function $e(t){return typeof t=="number"||De(t)&&"[object Number]"==Ou.call(t)}function Ne(t){return!De(t)||"[object Object]"!=Ou.call(t)||C(t)?false:(t=Pu(Object(t)),null===t?true:(t=wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&ju.call(t)==Au)); +}function Pe(t){return Ue(t)&&"[object RegExp]"==Ou.call(t)}function Ze(t){return typeof t=="string"||!ai(t)&&De(t)&&"[object String]"==Ou.call(t)}function Te(t){return typeof t=="symbol"||De(t)&&"[object Symbol]"==Ou.call(t)}function qe(t){return De(t)&&ze(t.length)&&!!Mt[Ou.call(t)]}function Ve(t){if(!t)return[];if(We(t))return Ze(t)?t.match(St):cr(t);if(Cu&&t[Cu])return z(t[Cu]());var n=Pr(t);return("[object Map]"==n?U:"[object Set]"==n?F:eu)(t)}function Ke(t){return t?(t=Ye(t),t===q||t===-q?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0; +}function Ge(t){t=Ke(t);var n=t%1;return t===t?n?t-n:t:0}function Je(t){return t?tn(Ge(t),0,4294967295):0}function Ye(t){if(typeof t=="number")return t;if(Te(t))return V;if(Ue(t)&&(t=Me(t.valueOf)?t.valueOf():t,t=Ue(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)?Pt(t.slice(2),n?2:8):gt.test(t)?V:+t}function He(t){return ar(t,ru(t))}function Qe(t){return null==t?"":Gn(t)}function Xe(t,n,r){return t=null==t?T:_n(t,n),t===T?r:t}function tu(t,n){ +return null!=t&&Zr(t,n,yn)}function nu(t){var n=te(t);if(!n&&!We(t))return qu(Object(t));var r,e=Kr(t),u=!!e,e=e||[],o=e.length;for(r in t)!dn(t,r)||u&&("length"==r||Yr(r,o))||n&&"constructor"==r||e.push(r);return e}function ru(t){for(var n=-1,r=te(t),e=On(t),u=e.length,o=Kr(t),i=!!o,o=o||[],f=o.length;++nt?false:(t==n.length-1?n.pop():Fu.call(n,t,1),true)},Dt.prototype.get=function(t){ +var n=this.__data__;return t=Gt(n,t),0>t?T:n[t][1]},Dt.prototype.has=function(t){return-1e?r.push([t,n]):r[e][1]=n,this},Ft.prototype.clear=function(){this.__data__={hash:new Ut,map:new(to||Dt),string:new Ut}},Ft.prototype["delete"]=function(t){return Dr(this,t)["delete"](t)},Ft.prototype.get=function(t){return Dr(this,t).get(t)},Ft.prototype.has=function(t){return Dr(this,t).has(t)},Ft.prototype.set=function(t,n){ +return Dr(this,t).set(t,n),this},$t.prototype.add=$t.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},$t.prototype.has=function(t){return this.__data__.has(t)},Zt.prototype.clear=function(){this.__data__=new Dt},Zt.prototype["delete"]=function(t){return this.__data__["delete"](t)},Zt.prototype.get=function(t){return this.__data__.get(t)},Zt.prototype.has=function(t){return this.__data__.has(t)},Zt.prototype.set=function(t,n){var r=this.__data__;return r instanceof Dt&&200==r.__data__.length&&(r=this.__data__=new Ft(r.__data__)), +r.set(t,n),this};var go=pr(sn),yo=pr(hn,true),bo=_r(),xo=_r(true);Lu&&!Uu.call({valueOf:1},"valueOf")&&(On=function(t){return z(Lu(t))});var jo=oo?function(t,n){return oo.set(t,n),t}:cu,wo=ro&&1/F(new ro([,-0]))[1]==q?function(t){return new ro(t)}:su,mo=oo?function(t){return oo.get(t)}:su,Ao=Cn("length");Mu||(Nr=function(){return[]});var Oo=Mu?function(t){for(var n=[];t;)s(n,Nr(t)),t=Pu(Object(t));return n}:Nr;(Xu&&"[object DataView]"!=Pr(new Xu(new ArrayBuffer(1)))||to&&"[object Map]"!=Pr(new to)||no&&"[object Promise]"!=Pr(no.resolve())||ro&&"[object Set]"!=Pr(new ro)||eo&&"[object WeakMap]"!=Pr(new eo))&&(Pr=function(t){ +var n=Ou.call(t);if(t=(t="[object Object]"==n?t.constructor:T)?oe(t):T)switch(t){case co:return"[object DataView]";case ao:return"[object Map]";case lo:return"[object Promise]";case so:return"[object Set]";case ho:return"[object WeakMap]"}return n});var ko=function(){var t=0,n=0;return function(r,e){var u=Qo(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return jo(r,e)}}(),Eo=Ee(function(t){var n=[];return Qe(t).replace(ot,function(t,r,e,u){n.push(e?u.replace(ht,"$1"):r||t)}),n}),Io=Ie(function(t,n){ +return Be(t)?on(t,ln(n,1,Be,true)):[]}),So=Ie(function(t,n){var r=le(n);return Be(r)&&(r=T),Be(t)?on(t,ln(n,1,Be,true),Ur(r)):[]}),Ro=Ie(function(t,n){var r=le(n);return Be(r)&&(r=T),Be(t)?on(t,ln(n,1,Be,true),T,r):[]}),Wo=Ie(function(t){var n=l(t,tr);return n.length&&n[0]===t[0]?bn(n):[]}),Bo=Ie(function(t){var n=le(t),r=l(t,tr);return n===le(r)?n=T:r.pop(),r.length&&r[0]===t[0]?bn(r,Ur(n)):[]}),Lo=Ie(function(t){var n=le(t),r=l(t,tr);return n===le(r)?n=T:r.pop(),r.length&&r[0]===t[0]?bn(r,T,n):[]}),Mo=Ie(se),Co=Ie(function(t,n){ +n=ln(n,1);var r=t?t.length:0,e=Xt(t,n);return Dn(t,l(n,function(t){return Yr(t,r)?+t:t}).sort(or)),e}),zo=Ie(function(t){return Jn(ln(t,1,Be,true))}),Uo=Ie(function(t){var n=le(t);return Be(n)&&(n=T),Jn(ln(t,1,Be,true),Ur(n))}),Do=Ie(function(t){var n=le(t);return Be(n)&&(n=T),Jn(ln(t,1,Be,true),T,n)}),Fo=Ie(function(t,n){return Be(t)?on(t,n):[]}),$o=Ie(function(t){return Qn(f(t,Be))}),No=Ie(function(t){var n=le(t);return Be(n)&&(n=T),Qn(f(t,Be),Ur(n))}),Po=Ie(function(t){var n=le(t);return Be(n)&&(n=T), +Qn(f(t,Be),T,n)}),Zo=Ie(pe),To=Ie(function(t){var n=t.length,n=n>1?t[n-1]:T,n=typeof n=="function"?(t.pop(),n):T;return _e(t,n)}),qo=Ie(function(t){function n(n){return Xt(n,t)}t=ln(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof zt&&Yr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:ge,args:[n],thisArg:T}),new kt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(T),t})):this.thru(n)}),Vo=sr(function(t,n,r){wu.call(t,r)?++t[r]:t[r]=1; +}),Ko=sr(function(t,n,r){wu.call(t,r)?t[r].push(n):t[r]=[n]}),Go=Ie(function(t,n,e){var u=-1,o=typeof n=="function",i=Qr(n),f=We(t)?Array(t.length):[];return go(t,function(t){var c=o?n:i&&null!=t?t[n]:T;f[++u]=c?r(c,t,e):jn(t,n,e)}),f}),Jo=sr(function(t,n,r){t[r]=n}),Yo=sr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Ho=Ie(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Hr(t,n[0],n[1])?n=[]:r>2&&Hr(n[0],n[1],n[2])&&(n=[n[0]]),n=1==n.length&&ai(n[0])?n[0]:ln(n,1,Jr),Bn(t,n,[]); +}),Qo=pu.now,Xo=Ie(function(t,n,r){var e=1;if(r.length)var u=D(r,zr(Xo)),e=32|e;return Br(t,e,n,r,u)}),ti=Ie(function(t,n,r){var e=3;if(r.length)var u=D(r,zr(ti)),e=32|e;return Br(n,e,t,r,u)}),ni=Ie(function(t,n){return un(t,1,n)}),ri=Ie(function(t,n,r){return un(t,Ye(n)||0,r)});Ee.Cache=Ft;var ei=Ie(function(t,n){n=1==n.length&&ai(n[0])?l(n[0],O(Ur())):l(ln(n,1,Jr),O(Ur()));var e=n.length;return Ie(function(u){for(var o=-1,i=Ku(u.length,e);++o=n}),ai=Array.isArray,li=Iu?function(t){return t instanceof Iu}:fu(false),si=Ir(kn),hi=Ir(function(t,n){return n>=t}),pi=hr(function(t,n){if(io||te(n)||We(n))ar(n,nu(n),t);else for(var r in n)wu.call(n,r)&&Kt(t,r,n[r])}),_i=hr(function(t,n){if(io||te(n)||We(n))ar(n,ru(n),t);else for(var r in n)Kt(t,r,n[r])}),vi=hr(function(t,n,r,e){ +ar(n,ru(n),t,e)}),gi=hr(function(t,n,r,e){ar(n,nu(n),t,e)}),di=Ie(function(t,n){return Xt(t,ln(n,1))}),yi=Ie(function(t){return t.push(T,Tt),r(vi,T,t)}),bi=Ie(function(t){return t.push(T,re),r(Ai,T,t)}),xi=wr(function(t,n,r){t[n]=r},fu(cu)),ji=wr(function(t,n,r){wu.call(t,n)?t[n].push(r):t[n]=[r]},Ur),wi=Ie(jn),mi=hr(function(t,n,r){Rn(t,n,r)}),Ai=hr(function(t,n,r,e){Rn(t,n,r,e)}),Oi=Ie(function(t,n){return null==t?{}:(n=l(ln(n,1),ue),Ln(t,on(vn(t,ru,Oo),n)))}),ki=Ie(function(t,n){return null==t?{}:Ln(t,l(ln(n,1),ue)); +}),Ei=Wr(nu),Ii=Wr(ru),Si=dr(function(t,n,r){return n=n.toLowerCase(),t+(r?uu(n):n)}),Ri=dr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),Wi=dr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Bi=gr("toLowerCase"),Li=dr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Mi=dr(function(t,n,r){return t+(r?" ":"")+zi(n)}),Ci=dr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),zi=gr("toUpperCase"),Ui=Ie(function(t,n){try{return r(t,T,n)}catch(e){return Le(e)?e:new _u(e)}}),Di=Ie(function(t,n){ +return u(ln(n,1),function(n){n=ue(n),t[n]=Xo(t[n],t)}),t}),Fi=xr(),$i=xr(true),Ni=Ie(function(t,n){return function(r){return jn(r,t,n)}}),Pi=Ie(function(t,n){return function(r){return jn(t,r,n)}}),Zi=Ar(l),Ti=Ar(i),qi=Ar(_),Vi=Er(),Ki=Er(true),Gi=mr(function(t,n){return t+n}),Ji=Rr("ceil"),Yi=mr(function(t,n){return t/n}),Hi=Rr("floor"),Qi=mr(function(t,n){return t*n}),Xi=Rr("round"),tf=mr(function(t,n){return t-n});return At.after=function(t,n){if(typeof n!="function")throw new du("Expected a function"); +return t=Ge(t),function(){return 1>--t?n.apply(this,arguments):void 0}},At.ary=we,At.assign=pi,At.assignIn=_i,At.assignInWith=vi,At.assignWith=gi,At.at=di,At.before=me,At.bind=Xo,At.bindAll=Di,At.bindKey=ti,At.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ai(t)?t:[t]},At.chain=ve,At.chunk=function(t,n,r){if(n=(r?Hr(t,n,r):n===T)?1:Vu(Ge(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array($u(r/n));r>e;)o[u++]=Pn(t,e,e+=n);return o},At.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:Ge(e),0>e&&(e+=u),e=r>e?0:Je(e);e>r;)t[r++]=n;return t},At.filter=function(t,n){return(ai(t)?f:an)(t,Ur(n,3))},At.flatMap=function(t,n){return ln(xe(t,n),1)},At.flatMapDeep=function(t,n){return ln(xe(t,n),q)},At.flatMapDepth=function(t,n,r){return r=r===T?1:Ge(r),ln(xe(t,n),r)},At.flatten=function(t){return t&&t.length?ln(t,1):[]},At.flattenDeep=function(t){return t&&t.length?ln(t,q):[]},At.flattenDepth=function(t,n){return t&&t.length?(n=n===T?1:Ge(n),ln(t,n)):[]; +},At.flip=function(t){return Br(t,512)},At.flow=Fi,At.flowRight=$i,At.fromPairs=function(t){for(var n=-1,r=t?t.length:0,e={};++n>>0,r?(t=Qe(t))&&(typeof n=="string"||null!=n&&!Pe(n))&&(n=Gn(n),""==n&&Wt.test(t))?rr(t.match(St),0,r):Qu.call(t,n,r):[]},At.spread=function(t,n){if(typeof t!="function")throw new du("Expected a function");return n=n===T?0:Vu(Ge(n),0),Ie(function(e){var u=e[n];return e=rr(e,0,n),u&&s(e,u),r(t,this,e)})},At.tail=function(t){return fe(t,1)},At.take=function(t,n,r){return t&&t.length?(n=r||n===T?1:Ge(n), +Pn(t,0,0>n?0:n)):[]},At.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ge(n),n=e-n,Pn(t,0>n?0:n,e)):[]},At.takeRightWhile=function(t,n){return t&&t.length?Yn(t,Ur(n,3),false,true):[]},At.takeWhile=function(t,n){return t&&t.length?Yn(t,Ur(n,3)):[]},At.tap=function(t,n){return n(t),t},At.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new du("Expected a function");return Ue(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ke(t,n,{leading:e,maxWait:n, +trailing:u})},At.thru=ge,At.toArray=Ve,At.toPairs=Ei,At.toPairsIn=Ii,At.toPath=function(t){return ai(t)?l(t,ue):Te(t)?[t]:cr(Eo(t))},At.toPlainObject=He,At.transform=function(t,n,r){var e=ai(t)||qe(t);if(n=Ur(n,4),null==r)if(e||Ue(t)){var o=t.constructor;r=e?ai(t)?new o:[]:Me(o)?en(Pu(Object(t))):{}}else r={};return(e?u:sn)(t,function(t,e,u){return n(r,t,e,u)}),r},At.unary=function(t){return we(t,1)},At.union=zo,At.unionBy=Uo,At.unionWith=Do,At.uniq=function(t){return t&&t.length?Jn(t):[]},At.uniqBy=function(t,n){ +return t&&t.length?Jn(t,Ur(n)):[]},At.uniqWith=function(t,n){return t&&t.length?Jn(t,T,n):[]},At.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Qr(e,r)?[e]:nr(e);r=ee(r,e),e=ue(le(e)),r=!(null!=r&&dn(r,e))||delete r[e]}return r},At.unzip=pe,At.unzipWith=_e,At.update=function(t,n,r){return null==t?t:Nn(t,n,(typeof r=="function"?r:cu)(_n(t,n)),void 0)},At.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null!=t&&(t=Nn(t,n,(typeof r=="function"?r:cu)(_n(t,n)),e)),t},At.values=eu, +At.valuesIn=function(t){return null==t?[]:k(t,ru(t))},At.without=Fo,At.words=iu,At.wrap=function(t,n){return n=null==n?cu:n,ui(n,t)},At.xor=$o,At.xorBy=No,At.xorWith=Po,At.zip=Zo,At.zipObject=function(t,n){return Xn(t||[],n||[],Kt)},At.zipObjectDeep=function(t,n){return Xn(t||[],n||[],Nn)},At.zipWith=To,At.entries=Ei,At.entriesIn=Ii,At.extend=_i,At.extendWith=vi,lu(At,At),At.add=Gi,At.attempt=Ui,At.camelCase=Si,At.capitalize=uu,At.ceil=Ji,At.clamp=function(t,n,r){return r===T&&(r=n,n=T),r!==T&&(r=Ye(r), +r=r===r?r:0),n!==T&&(n=Ye(n),n=n===n?n:0),tn(Ye(t),n,r)},At.clone=function(t){return nn(t,false,true)},At.cloneDeep=function(t){return nn(t,true,true)},At.cloneDeepWith=function(t,n){return nn(t,true,true,n)},At.cloneWith=function(t,n){return nn(t,false,true,n)},At.deburr=ou,At.divide=Yi,At.endsWith=function(t,n,r){t=Qe(t),n=Gn(n);var e=t.length;return r=r===T?e:tn(Ge(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},At.eq=Se,At.escape=function(t){return(t=Qe(t))&&X.test(t)?t.replace(H,B):t},At.escapeRegExp=function(t){ +return(t=Qe(t))&&ft.test(t)?t.replace(it,"\\$&"):t},At.every=function(t,n,r){var e=ai(t)?i:fn;return r&&Hr(t,n,r)&&(n=T),e(t,Ur(n,3))},At.find=function(t,n){if(n=Ur(n,3),ai(t)){var r=g(t,n);return r>-1?t[r]:T}return v(t,n,go)},At.findIndex=function(t,n){return t&&t.length?g(t,Ur(n,3)):-1},At.findKey=function(t,n){return v(t,Ur(n,3),sn,true)},At.findLast=function(t,n){if(n=Ur(n,3),ai(t)){var r=g(t,n,true);return r>-1?t[r]:T}return v(t,n,yo)},At.findLastIndex=function(t,n){return t&&t.length?g(t,Ur(n,3),true):-1; +},At.findLastKey=function(t,n){return v(t,Ur(n,3),hn,true)},At.floor=Hi,At.forEach=ye,At.forEachRight=be,At.forIn=function(t,n){return null==t?t:bo(t,Ur(n,3),ru)},At.forInRight=function(t,n){return null==t?t:xo(t,Ur(n,3),ru)},At.forOwn=function(t,n){return t&&sn(t,Ur(n,3))},At.forOwnRight=function(t,n){return t&&hn(t,Ur(n,3))},At.get=Xe,At.gt=fi,At.gte=ci,At.has=function(t,n){return null!=t&&Zr(t,n,dn)},At.hasIn=tu,At.head=ae,At.identity=cu,At.includes=function(t,n,r,e){return t=We(t)?t:eu(t),r=r&&!e?Ge(r):0, +e=t.length,0>r&&(r=Vu(e+r,0)),Ze(t)?e>=r&&-1r&&(r=Vu(e+r,0)),d(t,n,r)):-1},At.inRange=function(t,n,r){return n=Ye(n)||0,r===T?(r=n,n=0):r=Ye(r)||0,t=Ye(t),t>=Ku(n,r)&&t=-9007199254740991&&9007199254740991>=t},At.isSet=function(t){return De(t)&&"[object Set]"==Pr(t)},At.isString=Ze,At.isSymbol=Te,At.isTypedArray=qe,At.isUndefined=function(t){return t===T},At.isWeakMap=function(t){return De(t)&&"[object WeakMap]"==Pr(t)},At.isWeakSet=function(t){return De(t)&&"[object WeakSet]"==Ou.call(t)},At.join=function(t,n){return t?Tu.call(t,n):""},At.kebabCase=Ri,At.last=le,At.lastIndexOf=function(t,n,r){var e=t?t.length:0; +if(!e)return-1;var u=e;if(r!==T&&(u=Ge(r),u=(0>u?Vu(e+u,0):Ku(u,e-1))+1),n!==n)return M(t,u,true);for(;u--;)if(t[u]===n)return u;return-1},At.lowerCase=Wi,At.lowerFirst=Bi,At.lt=si,At.lte=hi,At.max=function(t){return t&&t.length?cn(t,cu,gn):T},At.maxBy=function(t,n){return t&&t.length?cn(t,Ur(n),gn):T},At.mean=function(t){return b(t,cu)},At.meanBy=function(t,n){return b(t,Ur(n))},At.min=function(t){return t&&t.length?cn(t,cu,kn):T},At.minBy=function(t,n){return t&&t.length?cn(t,Ur(n),kn):T},At.multiply=Qi, +At.nth=function(t,n){return t&&t.length?Wn(t,Ge(n)):T},At.noConflict=function(){return Jt._===this&&(Jt._=ku),this},At.noop=su,At.now=Qo,At.pad=function(t,n,r){t=Qe(t);var e=(n=Ge(n))?N(t):0;return!n||e>=n?t:(n=(n-e)/2,Or(Nu(n),r)+t+Or($u(n),r))},At.padEnd=function(t,n,r){t=Qe(t);var e=(n=Ge(n))?N(t):0;return n&&n>e?t+Or(n-e,r):t},At.padStart=function(t,n,r){t=Qe(t);var e=(n=Ge(n))?N(t):0;return n&&n>e?Or(n-e,r)+t:t},At.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=Qe(t).replace(ct,""), +Gu(t,n||(vt.test(t)?16:10))},At.random=function(t,n,r){if(r&&typeof r!="boolean"&&Hr(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=Ye(t)||0,n===T?(n=t,t=0):n=Ye(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=Ju(),Ku(t+r*(n-t+Nt("1e-"+((r+"").length-1))),n)):Fn(t,n)},At.reduce=function(t,n,r){var e=ai(t)?h:x,u=3>arguments.length;return e(t,Ur(n,4),r,u,go)},At.reduceRight=function(t,n,r){var e=ai(t)?p:x,u=3>arguments.length;return e(t,Ur(n,4),r,u,yo); +},At.repeat=function(t,n,r){return n=(r?Hr(t,n,r):n===T)?1:Ge(n),$n(Qe(t),n)},At.replace=function(){var t=arguments,n=Qe(t[0]);return 3>t.length?n:Yu.call(n,t[1],t[2])},At.result=function(t,n,r){n=Qr(n,t)?[n]:nr(n);var e=-1,u=n.length;for(u||(t=T,u=1);++e0?t[Fn(0,n-1)]:T},At.size=function(t){if(null==t)return 0;if(We(t)){var n=t.length; +return n&&Ze(t)?N(t):n}return De(t)&&(n=Pr(t),"[object Map]"==n||"[object Set]"==n)?t.size:nu(t).length},At.snakeCase=Li,At.some=function(t,n,r){var e=ai(t)?_:Zn;return r&&Hr(t,n,r)&&(n=T),e(t,Ur(n,3))},At.sortedIndex=function(t,n){return Tn(t,n)},At.sortedIndexBy=function(t,n,r){return qn(t,n,Ur(r))},At.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Tn(t,n);if(r>e&&Se(t[e],n))return e}return-1},At.sortedLastIndex=function(t,n){return Tn(t,n,true)},At.sortedLastIndexBy=function(t,n,r){return qn(t,n,Ur(r),true); +},At.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(Se(t[r],n))return r}return-1},At.startCase=Mi,At.startsWith=function(t,n,r){return t=Qe(t),r=tn(Ge(r),0,t.length),t.lastIndexOf(Gn(n),r)==r},At.subtract=tf,At.sum=function(t){return t&&t.length?w(t,cu):0},At.sumBy=function(t,n){return t&&t.length?w(t,Ur(n)):0},At.template=function(t,n,r){var e=At.templateSettings;r&&Hr(t,n,r)&&(n=T),t=Qe(t),n=vi({},n,e,Tt),r=vi({},n.imports,e.imports,Tt);var u,o,i=nu(r),f=k(r,i),c=0;r=n.interpolate||wt; +var a="__p+='";r=gu((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=Ui(function(){return Function(i,l+"return "+a).apply(T,f)}),n.source=a,Le(n))throw n;return n},At.times=function(t,n){if(t=Ge(t),1>t||t>9007199254740991)return[];var r=4294967295,e=Ku(t,4294967295);for(n=Ur(n),t-=4294967295,e=m(e,n);++r=o)return t;if(o=r-N(e),1>o)return e;if(r=i?rr(i,0,o).join(""):t.slice(0,o),u===T)return r+e;if(i&&(o+=r.length-o),Pe(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=gu(u.source,Qe(_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(Gn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},At.unescape=function(t){return(t=Qe(t))&&Q.test(t)?t.replace(Y,P):t},At.uniqueId=function(t){ +var n=++mu;return Qe(t)+n},At.upperCase=Ci,At.upperFirst=zi,At.each=ye,At.eachRight=be,At.first=ae,lu(At,function(){var t={};return sn(At,function(n,r){wu.call(At.prototype,r)||(t[r]=n)}),t}(),{chain:false}),At.VERSION="4.12.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){At[t].placeholder=At}),u(["drop","take"],function(t,n){zt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new zt(this);r=r===T?1:Vu(Ge(r),0);var u=this.clone();return e?u.__takeCount__=Ku(r,u.__takeCount__):u.__views__.push({ +size:Ku(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},zt.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;zt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Ur(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");zt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right"); +zt.prototype[t]=function(){return this.__filtered__?new zt(this):this[r](1)}}),zt.prototype.compact=function(){return this.filter(cu)},zt.prototype.find=function(t){return this.filter(t).head()},zt.prototype.findLast=function(t){return this.reverse().find(t)},zt.prototype.invokeMap=Ie(function(t,n){return typeof t=="function"?new zt(this):this.map(function(r){return jn(r,t,n)})}),zt.prototype.reject=function(t){return t=Ur(t,3),this.filter(function(n){return!t(n)})},zt.prototype.slice=function(t,n){ +t=Ge(t);var r=this;return r.__filtered__&&(t>0||0>n)?new zt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==T&&(n=Ge(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},zt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zt.prototype.toArray=function(){return this.take(4294967295)},sn(zt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=At[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(At.prototype[n]=function(){ +function n(t){return t=u.apply(At,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof zt,a=f[0],l=c||ai(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 zt(this),i=t.apply(i,f),i.__actions__.push({func:ge,args:[n],thisArg:T}),new kt(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=yu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t); +At.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(ai(u)?u:[],t)}return this[r](function(r){return n.apply(ai(r)?r:[],t)})}}),sn(zt.prototype,function(t,n){var r=At[n];if(r){var e=r.name+"";(fo[e]||(fo[e]=[])).push({name:n,func:r})}}),fo[jr(T,2).name]=[{name:"wrapper",func:T}],zt.prototype.clone=function(){var t=new zt(this.__wrapped__);return t.__actions__=cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cr(this.__iteratees__), +t.__takeCount__=this.__takeCount__,t.__views__=cr(this.__views__),t},zt.prototype.reverse=function(){if(this.__filtered__){var t=new zt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},zt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=ai(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 Hn(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}},At.prototype.plant=function(t){for(var n,r=this;r instanceof Ot;){var e=ie(r);e.__index__=0,e.__values__=T,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},At.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof zt?(this.__actions__.length&&(t=new zt(this)),t=t.reverse(),t.__actions__.push({func:ge, +args:[he],thisArg:T}),new kt(t,this.__chain__)):this.thru(he)},At.prototype.toJSON=At.prototype.valueOf=At.prototype.value=function(){return Hn(this.__wrapped__,this.__actions__)},Cu&&(At.prototype[Cu]=de),At}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)\]/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"),It=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),St=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 _ clearTimeout 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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Dt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ft={"function":true,object:true},$t={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" +},Nt=parseFloat,Pt=parseInt,Zt=Ft[typeof exports]&&exports&&!exports.nodeType?exports:T,Tt=Ft[typeof module]&&module&&!module.nodeType?module:T,qt=Tt&&Tt.exports===Zt?Zt:T,Vt=R(Ft[typeof self]&&self),Kt=R(Ft[typeof window]&&window),Gt=R(Ft[typeof this]&&this),Jt=R(Zt&&Tt&&typeof global=="object"&&global)||Kt!==(Gt&&Gt.window)&&Kt||Vt||Gt||Function("return this")(),Yt=Z();(Kt||Vt||{})._=Yt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Yt}):Zt&&Tt?(qt&&((Tt.exports=Yt)._=Yt), +Zt._=Yt):Jt._=Yt}).call(this); \ No newline at end of file diff --git a/dist/mapping.fp.js b/dist/mapping.fp.js index 8adef992e1..f74fb2acf9 100644 --- a/dist/mapping.fp.js +++ b/dist/mapping.fp.js @@ -120,7 +120,7 @@ return /******/ (function(modules) { // webpackBootstrap 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', - 'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', + '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', diff --git a/doc/README.md b/doc/README.md index f9da2b3d44..066750e240 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,4 +1,4 @@ -# lodash v4.11.2 +# lodash v4.12.0 @@ -194,6 +194,7 @@ * `_.lt` * `_.lte` * `_.toArray` +* `_.toFinite` * `_.toInteger` * `_.toLength` * `_.toNumber` @@ -407,7 +408,7 @@ ### `_.chunk(array, [size=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L5982 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6050 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") 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 @@ -420,7 +421,7 @@ elements. 2. `[size=1]` *(number)*: The length of each chunk #### Returns -*(Array)*: Returns the new array containing chunks. +*(Array)*: Returns the new array of chunks. #### Example ```js @@ -437,7 +438,7 @@ _.chunk(['a', 'b', 'c', 'd'], 3); ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6017 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6085 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are falsey. @@ -462,7 +463,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.concat(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6054 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6122 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") Creates a new array concatenating `array` with any additional arrays and/or values. @@ -494,7 +495,7 @@ console.log(array); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6087 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6155 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") 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) @@ -522,7 +523,7 @@ _.difference([3, 2, 1], [4, 2]); ### `_.differenceBy(array, [values], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6117 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6185 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") This method is like `_.difference` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion @@ -555,7 +556,7 @@ _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); ### `_.differenceWith(array, [values], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6148 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6216 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") This method is like `_.difference` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. Result values @@ -586,7 +587,7 @@ _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); ### `_.drop(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6183 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6251 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") Creates a slice of `array` with `n` elements dropped from the beginning. @@ -620,7 +621,7 @@ _.drop([1, 2, 3], 0); ### `_.dropRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6217 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6285 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") Creates a slice of `array` with `n` elements dropped from the end. @@ -654,7 +655,7 @@ _.dropRight([1, 2, 3], 0); ### `_.dropRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6331 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is @@ -699,7 +700,7 @@ _.dropRightWhile(users, 'active'); ### `_.dropWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") Creates a slice of `array` excluding elements dropped from the beginning. Elements are dropped until `predicate` returns falsey. The predicate is @@ -744,7 +745,7 @@ _.dropWhile(users, 'active'); ### `_.fill(array, value, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6340 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6408 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") Fills elements of `array` with `value` from `start` up to, but not including, `end`. @@ -784,7 +785,7 @@ _.fill([4, 6, 8, 10], '*', 1, 3); ### `_.findIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6387 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6455 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") This method is like `_.find` except that it returns the index of the first element `predicate` returns truthy for instead of the element itself. @@ -828,7 +829,7 @@ _.findIndex(users, 'active'); ### `_.findLastIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6496 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. @@ -872,7 +873,7 @@ _.findLastIndex(users, 'active'); ### `_.flatten(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") Flattens `array` a single level deep. @@ -896,7 +897,7 @@ _.flatten([1, [2, [3, [4]], 5]]); ### `_.flattenDeep(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6467 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6535 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") Recursively flattens `array`. @@ -920,7 +921,7 @@ _.flattenDeep([1, [2, [3, [4]], 5]]); ### `_.flattenDepth(array, [depth=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6560 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package") Recursively flatten `array` up to `depth` times. @@ -950,7 +951,7 @@ _.flattenDepth(array, 2); ### `_.fromPairs(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6584 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") The inverse of `_.toPairs`; this method returns an object composed from key-value `pairs`. @@ -975,7 +976,7 @@ _.fromPairs([['fred', 30], ['barney', 40]]); ### `_.head(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6546 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6614 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") Gets the first element of `array`. @@ -1005,7 +1006,7 @@ _.head([]); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6573 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6641 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") 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) @@ -1038,7 +1039,7 @@ _.indexOf([1, 2, 1, 2], 2, 2); ### `_.initial(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6667 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") Gets all but the last element of `array`. @@ -1062,7 +1063,7 @@ _.initial([1, 2, 3]); ### `_.intersection([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6620 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6688 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") 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) @@ -1089,7 +1090,7 @@ _.intersection([2, 1], [4, 2], [1, 2]); ### `_.intersectionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6650 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6718 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") This method is like `_.intersection` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion @@ -1121,7 +1122,7 @@ _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.intersectionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6685 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6753 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") This method is like `_.intersection` except that it accepts `comparator` which is invoked to compare elements of `arrays`. Result values are chosen @@ -1152,7 +1153,7 @@ _.intersectionWith(objects, others, _.isEqual); ### `_.join(array, [separator=','])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6714 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6782 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") Converts all elements in `array` into a string separated by `separator`. @@ -1177,7 +1178,7 @@ _.join(['a', 'b', 'c'], '~'); ### `_.last(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6800 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") Gets the last element of `array`. @@ -1201,7 +1202,7 @@ _.last([1, 2, 3]); ### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6758 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6826 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") This method is like `_.indexOf` except that it iterates over elements of `array` from right to left. @@ -1232,10 +1233,10 @@ _.lastIndexOf([1, 2, 1, 2], 2, 2); ### `_.nth(array, [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6804 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.nth "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6872 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.nth "See the npm package") -Gets the nth element of `array`. If `n` is negative, the nth element -from the end is returned. +Gets the element at `n` index of `array`. If `n` is negative, the nth +element from the end is returned. #### Since 4.11.0 @@ -1263,7 +1264,7 @@ _.nth(array, -2); ### `_.pull(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6831 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6899 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") Removes all given values from `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1297,7 +1298,7 @@ console.log(array); ### `_.pullAll(array, values)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6853 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6921 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") This method is like `_.pull` except that it accepts an array of values to remove.
@@ -1328,7 +1329,7 @@ console.log(array); ### `_.pullAllBy(array, values, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6883 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6951 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") This method is like `_.pullAll` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion @@ -1362,7 +1363,7 @@ console.log(array); ### `_.pullAllWith(array, values, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6912 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L6980 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallwith "See the npm package") This method is like `_.pullAll` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. The comparator is @@ -1396,7 +1397,7 @@ console.log(array); ### `_.pullAt(array, [indexes])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6942 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7010 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") Removes elements from `array` corresponding to `indexes` and returns an array of removed elements. @@ -1431,7 +1432,7 @@ console.log(evens); ### `_.remove(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7052 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") Removes all elements from `array` that `predicate` returns truthy for and returns an array of the removed elements. The predicate is invoked @@ -1470,7 +1471,7 @@ console.log(evens); ### `_.reverse(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7028 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7096 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") Reverses `array` so that the first element becomes the last, the second element becomes the second to last, and so on. @@ -1504,7 +1505,7 @@ console.log(array); ### `_.slice(array, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7048 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7116 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") Creates a slice of `array` from `start` up to, but not including, `end`.
@@ -1530,7 +1531,7 @@ returned. ### `_.sortedIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7152 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") Uses a binary search to determine the lowest index at which `value` should be inserted into `array` in order to maintain its sort order. @@ -1559,7 +1560,7 @@ _.sortedIndex([4, 5], 4); ### `_.sortedIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7182 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") This method is like `_.sortedIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1593,7 +1594,7 @@ _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7134 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7202 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") This method is like `_.indexOf` except that it performs a binary search on a sorted `array`. @@ -1619,7 +1620,7 @@ _.sortedIndexOf([1, 1, 2, 2], 2); ### `_.sortedLastIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7163 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7231 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") This method is like `_.sortedIndex` except that it returns the highest index at which `value` should be inserted into `array` in order to @@ -1646,7 +1647,7 @@ _.sortedLastIndex([4, 5], 4); ### `_.sortedLastIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7188 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7256 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") This method is like `_.sortedLastIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1675,7 +1676,7 @@ _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedLastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7208 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7276 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") This method is like `_.lastIndexOf` except that it performs a binary search on a sorted `array`. @@ -1701,7 +1702,7 @@ _.sortedLastIndexOf([1, 1, 2, 2], 2); ### `_.sortedUniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7302 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") This method is like `_.uniq` except that it's designed and optimized for sorted arrays. @@ -1726,7 +1727,7 @@ _.sortedUniq([1, 1, 2]); ### `_.sortedUniqBy(array, [iteratee])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7256 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7324 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") This method is like `_.uniqBy` except that it's designed and optimized for sorted arrays. @@ -1752,7 +1753,7 @@ _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); ### `_.tail(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7276 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7344 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") Gets all but the first element of `array`. @@ -1776,7 +1777,7 @@ _.tail([1, 2, 3]); ### `_.take(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") Creates a slice of `array` with `n` elements taken from the beginning. @@ -1810,7 +1811,7 @@ _.take([1, 2, 3], 0); ### `_.takeRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7338 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7406 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") Creates a slice of `array` with `n` elements taken from the end. @@ -1844,7 +1845,7 @@ _.takeRight([1, 2, 3], 0); ### `_.takeRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7384 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7452 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") Creates a slice of `array` with elements taken from the end. Elements are taken until `predicate` returns falsey. The predicate is invoked with @@ -1889,7 +1890,7 @@ _.takeRightWhile(users, 'active'); ### `_.takeWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7426 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7494 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") Creates a slice of `array` with elements taken from the beginning. Elements are taken until `predicate` returns falsey. The predicate is invoked with @@ -1934,7 +1935,7 @@ _.takeWhile(users, 'active'); ### `_.union([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") Creates an array of unique values, in order, from all given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1960,7 +1961,7 @@ _.union([2, 1], [4, 2], [1, 2]); ### `_.unionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7475 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7543 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") This method is like `_.union` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by @@ -1992,7 +1993,7 @@ _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.unionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7503 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") This method is like `_.union` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked @@ -2022,7 +2023,7 @@ _.unionWith(objects, others, _.isEqual); ### `_.uniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7596 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") Creates a duplicate-free version of an array, using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -2049,7 +2050,7 @@ _.uniq([2, 1, 2]); ### `_.uniqBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7624 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") This method is like `_.uniq` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -2080,7 +2081,7 @@ _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.uniqWith(array, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7581 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") This method is like `_.uniq` except that it accepts `comparator` which is invoked to compare elements of `array`. The comparator is invoked with @@ -2109,7 +2110,7 @@ _.uniqWith(objects, _.isEqual); ### `_.unzip(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7606 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7674 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") 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 @@ -2138,7 +2139,7 @@ _.unzip(zipped); ### `_.unzipWith(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7643 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7711 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") This method is like `_.unzip` except that it accepts `iteratee` to specify how regrouped values should be combined. The iteratee is invoked with the @@ -2168,7 +2169,7 @@ _.unzipWith(zipped, _.add); ### `_.without(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7674 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7742 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") Creates an array excluding all given values using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -2177,7 +2178,7 @@ for equality comparisons. #### Since 0.1.0 #### Arguments -1. `array` *(Array)*: The array to filter. +1. `array` *(Array)*: The array to inspect. 2. `[values]` *(...*)*: The values to exclude. #### Returns @@ -2195,7 +2196,7 @@ _.without([1, 2, 1, 3], 1, 2); ### `_.xor([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) @@ -2208,7 +2209,7 @@ they occur in the arrays. 1. `[arrays]` *(...Array)*: The arrays to inspect. #### Returns -*(Array)*: Returns the new array of values. +*(Array)*: Returns the new array of filtered values. #### Example ```js @@ -2222,7 +2223,7 @@ _.xor([2, 1], [4, 2]); ### `_.xorBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7725 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") This method is like `_.xor` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by @@ -2236,7 +2237,7 @@ which by which they're compared. The iteratee is invoked with one argument:
2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element. #### Returns -*(Array)*: Returns the new array of values. +*(Array)*: Returns the new array of filtered values. #### Example ```js @@ -2254,7 +2255,7 @@ _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.xorWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7753 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7821 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") This method is like `_.xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked with @@ -2267,7 +2268,7 @@ two arguments: *(arrVal, othVal)*. 2. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns -*(Array)*: Returns the new array of values. +*(Array)*: Returns the new array of filtered values. #### Example ```js @@ -2284,7 +2285,7 @@ _.xorWith(objects, others, _.isEqual); ### `_.zip([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7777 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7845 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") 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,7 +2311,7 @@ _.zip(['fred', 'barney'], [30, 40], [true, false]); ### `_.zipObject([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7863 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") This method is like `_.fromPairs` except that it accepts two arrays, one of property identifiers and one of corresponding values. @@ -2336,7 +2337,7 @@ _.zipObject(['a', 'b'], [1, 2]); ### `_.zipObjectDeep([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7814 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7882 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") This method is like `_.zipObject` except that it supports property paths. @@ -2361,7 +2362,7 @@ _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); ### `_.zipWith([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7837 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7905 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") This method is like `_.zip` except that it accepts `iteratee` to specify how grouped values should be combined. The iteratee is invoked with the @@ -2396,7 +2397,7 @@ _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { ### `_.countBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8220 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8288 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The corresponding value of @@ -2427,7 +2428,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8261 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8329 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") Checks if `predicate` returns truthy for **all** elements of `collection`. Iteration is stopped once `predicate` returns falsey. The predicate is @@ -2471,7 +2472,7 @@ _.every(users, 'active'); ### `_.filter(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") Iterates over elements of `collection`, returning an array of all elements `predicate` returns truthy for. The predicate is invoked with three @@ -2515,7 +2516,7 @@ _.filter(users, 'active'); ### `_.find(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8414 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") Iterates over elements of `collection`, returning the first element `predicate` returns truthy for. The predicate is invoked with three @@ -2560,7 +2561,7 @@ _.find(users, 'active'); ### `_.findLast(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8374 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8442 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") This method is like `_.find` except that it iterates over elements of `collection` from right to left. @@ -2588,7 +2589,7 @@ _.findLast([1, 2, 3, 4], function(n) { ### `_.flatMap(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8405 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8473 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") Creates a flattened array of values by running each element in `collection` thru `iteratee` and flattening the mapped results. The iteratee is invoked @@ -2619,7 +2620,7 @@ _.flatMap([1, 2], duplicate); ### `_.flatMapDeep(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8430 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8498 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package") This method is like `_.flatMap` except that it recursively flattens the mapped results. @@ -2649,7 +2650,7 @@ _.flatMapDeep([1, 2], duplicate); ### `_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8456 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8524 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package") This method is like `_.flatMap` except that it recursively flattens the mapped results up to `depth` times. @@ -2680,7 +2681,7 @@ _.flatMapDepth([1, 2], duplicate, 2); ### `_.forEach(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8491 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8559 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") Iterates over elements of `collection` and invokes `iteratee` for each element. The iteratee is invoked with three arguments: *(value, index|key, collection)*. @@ -2722,7 +2723,7 @@ _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.forEachRight(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8517 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8584 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") This method is like `_.forEach` except that it iterates over elements of `collection` from right to left. @@ -2753,7 +2754,7 @@ _.forEachRight([1, 2], function(value) { ### `_.groupBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8547 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8613 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The order of grouped values @@ -2786,7 +2787,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.includes(collection, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8585 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8651 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") Checks if `value` is in `collection`. If `collection` is a string, it's checked for a substring of `value`, otherwise @@ -2825,7 +2826,7 @@ _.includes('pebbles', 'eb'); ### `_.invokeMap(collection, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") Invokes the method at `path` of each element in `collection`, returning an array of the results of each invoked method. Any additional arguments @@ -2857,7 +2858,7 @@ _.invokeMap([123, 456], String.prototype.split, ''); ### `_.keyBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8663 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8729 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The corresponding value of @@ -2895,7 +2896,7 @@ _.keyBy(array, 'dir'); ### `_.map(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8710 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8776 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") Creates an array of values by running each element in `collection` thru `iteratee`. The iteratee is invoked with three arguments:
@@ -2949,7 +2950,7 @@ _.map(users, 'user'); ### `_.orderBy(collection, [iteratees=[_.identity]], [orders])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8810 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") 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 @@ -2986,7 +2987,7 @@ _.orderBy(users, ['user', 'age'], ['asc', 'desc']); ### `_.partition(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8861 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") Creates an array of elements split into two groups, the first of which contains elements `predicate` returns truthy for, the second of which @@ -3032,7 +3033,7 @@ _.partition(users, 'active'); ### `_.reduce(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8836 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8902 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") Reduces `collection` to a value which is the accumulated result of running each element in `collection` thru `iteratee`, where each successive @@ -3080,7 +3081,7 @@ _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.reduceRight(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8865 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8931 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") This method is like `_.reduce` except that it iterates over elements of `collection` from right to left. @@ -3111,7 +3112,7 @@ _.reduceRight(array, function(flattened, other) { ### `_.reject(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8907 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8973 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") The opposite of `_.filter`; this method returns the elements of `collection` that `predicate` does **not** return truthy for. @@ -3154,7 +3155,7 @@ _.reject(users, 'active'); ### `_.sample(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8929 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8995 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") Gets a random element from `collection`. @@ -3178,7 +3179,7 @@ _.sample([1, 2, 3, 4]); ### `_.sampleSize(collection, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8956 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9022 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") Gets `n` random elements at unique keys from `collection` up to the size of `collection`. @@ -3207,7 +3208,7 @@ _.sampleSize([1, 2, 3], 4); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8993 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9059 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") Creates an array of shuffled values, using a version of the [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). @@ -3232,7 +3233,7 @@ _.shuffle([1, 2, 3, 4]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") Gets the size of `collection` by returning its length for array-like values or the number of own enumerable string keyed properties for objects. @@ -3263,7 +3264,7 @@ _.size('pebbles'); ### `_.some(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9072 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9138 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") Checks if `predicate` returns truthy for **any** element of `collection`. Iteration is stopped once `predicate` returns truthy. The predicate is @@ -3307,7 +3308,7 @@ _.some(users, 'active'); ### `_.sortBy(collection, [iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9180 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method @@ -3356,7 +3357,7 @@ _.sortBy(users, 'user', function(o) { ### `_.now()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9150 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9216 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. @@ -3386,7 +3387,7 @@ _.defer(function(stamp) { ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9244 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") The opposite of `_.before`; this method creates a function that invokes `func` once it's called `n` or more times. @@ -3420,7 +3421,7 @@ _.forEach(saves, function(type) { ### `_.ary(func, [n=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9273 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") Creates a function that invokes `func`, with up to `n` arguments, ignoring any additional arguments. @@ -3432,7 +3433,7 @@ ignoring any additional arguments. 2. `[n=func.length]` *(number)*: The arity cap. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new capped function. #### Example ```js @@ -3446,7 +3447,7 @@ _.map(['6', '8', '10'], _.ary(parseInt, 1)); ### `_.before(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9230 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9296 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") 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 @@ -3473,7 +3474,7 @@ jQuery(element).on('click', _.before(5, addContactToList)); ### `_.bind(func, thisArg, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9282 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9348 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") Creates a function that invokes `func` with the `this` binding of `thisArg` and `partials` prepended to the arguments it receives. @@ -3520,7 +3521,7 @@ bound('hi'); ### `_.bindKey(object, key, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9402 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") Creates a function that invokes the method at `object[key]` with `partials` prepended to the arguments it receives. @@ -3577,7 +3578,7 @@ bound('hi'); ### `_.curry(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9386 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9452 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") Creates a function that accepts arguments of `func` and either invokes `func` returning its result, if at least `arity` number of arguments have @@ -3629,7 +3630,7 @@ curried(1)(_, 3)(2); ### `_.curryRight(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9497 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") This method is like `_.curry` except that arguments are applied to `func` in the manner of `_.partialRight` instead of `_.partial`. @@ -3678,7 +3679,7 @@ curried(3)(1, _)(2); ### `_.debounce(func, [wait=0], [options={}], [options.leading=false], [options.maxWait], [options.trailing=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9488 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9554 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was @@ -3737,7 +3738,7 @@ jQuery(window).on('popstate', debounced.cancel); ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9696 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") Defers invoking the `func` until the current call stack has cleared. Any additional arguments are provided to `func` when it's invoked. @@ -3765,7 +3766,7 @@ _.defer(function(text) { ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9653 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9719 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") Invokes `func` after `wait` milliseconds. Any additional arguments are provided to `func` when it's invoked. @@ -3794,7 +3795,7 @@ _.delay(function(text) { ### `_.flip(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9675 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9741 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") Creates a function that invokes `func` with arguments reversed. @@ -3804,7 +3805,7 @@ Creates a function that invokes `func` with arguments reversed. 1. `func` *(Function)*: The function to flip arguments for. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new flipped function. #### Example ```js @@ -3822,7 +3823,7 @@ flipped('a', 'b', 'c', 'd'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9723 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9789 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") 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 @@ -3844,7 +3845,7 @@ method interface of `delete`, `get`, `has`, and `set`. 2. `[resolver]` *(Function)*: The function to resolve the cache key. #### Returns -*(Function)*: Returns the new memoizing function. +*(Function)*: Returns the new memoized function. #### Example ```js @@ -3877,7 +3878,7 @@ _.memoize.Cache = WeakMap; ### `_.negate(predicate)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9832 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") Creates a function that negates the result of the predicate `func`. The `func` predicate is invoked with the `this` binding and arguments of the @@ -3889,7 +3890,7 @@ created function. 1. `predicate` *(Function)*: The predicate to negate. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new negated function. #### Example ```js @@ -3907,7 +3908,7 @@ _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9859 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") 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 @@ -3935,7 +3936,7 @@ initialize(); ### `_.overArgs(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9829 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9895 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") Creates a function that invokes `func` with arguments transformed by corresponding `transforms`. @@ -3975,7 +3976,7 @@ func(10, 5); ### `_.partial(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9879 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9945 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") Creates a function that invokes `func` with `partials` prepended to the arguments it receives. This method is like `_.bind` except it does **not** @@ -4020,7 +4021,7 @@ greetFred('hi'); ### `_.partialRight(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9916 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L9982 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") This method is like `_.partial` except that partially applied arguments are appended to the arguments it receives. @@ -4064,7 +4065,7 @@ sayHelloTo('fred'); ### `_.rearg(func, indexes)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9943 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10009 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") Creates a function that invokes `func` with arguments arranged according to the specified `indexes` where the argument value at the first index is @@ -4096,7 +4097,7 @@ rearged('b', 'c', 'a') ### `_.rest(func, [start=func.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10038 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") Creates a function that invokes `func` with the `this` binding of the created function and arguments from `start` and beyond provided as @@ -4132,7 +4133,7 @@ say('hello', 'fred', 'barney', 'pebbles'); ### `_.spread(func, [start=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10101 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") Creates a function that invokes `func` with the `this` binding of the create function and an array of arguments much like @@ -4177,7 +4178,7 @@ numbers.then(_.spread(function(x, y) { ### `_.throttle(func, [wait=0], [options={}], [options.leading=true], [options.trailing=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10092 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10158 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds. The throttled function comes with a `cancel` @@ -4228,7 +4229,7 @@ jQuery(window).on('popstate', throttled.cancel); ### `_.unary(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10125 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10191 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") Creates a function that accepts up to one argument, ignoring any additional arguments. @@ -4239,7 +4240,7 @@ additional arguments. 1. `func` *(Function)*: The function to cap arguments for. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new capped function. #### Example ```js @@ -4253,7 +4254,7 @@ _.map(['6', '8', '10'], _.unary(parseInt)); ### `_.wrap(value, [wrapper=identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10151 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10217 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") Creates a function that provides `value` to the wrapper function as its first argument. Any additional arguments provided to the function are @@ -4291,7 +4292,7 @@ p('fred, barney, & pebbles'); ### `_.castArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10191 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10257 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package") Casts `value` as an array if it's not one. @@ -4334,7 +4335,7 @@ console.log(_.castArray(array) === array); ### `_.clone(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10225 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10291 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") Creates a shallow clone of `value`.
@@ -4370,7 +4371,7 @@ console.log(shallow[0] === objects[0]); ### `_.cloneDeep(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10282 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10348 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") This method is like `_.clone` except that it recursively clones `value`. @@ -4397,7 +4398,7 @@ console.log(deep[0] === objects[0]); ### `_.cloneDeepWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10314 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10380 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") This method is like `_.cloneWith` except that it recursively clones `value`. @@ -4434,7 +4435,7 @@ console.log(el.childNodes.length); ### `_.cloneWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10260 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10326 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") This method is like `_.clone` except that it accepts `customizer` which is invoked to produce the cloned value. If `customizer` returns `undefined`, @@ -4474,7 +4475,7 @@ console.log(el.childNodes.length); ### `_.eq(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10350 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10416 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -4516,7 +4517,7 @@ _.eq(NaN, NaN); ### `_.gt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10377 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10443 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") Checks if `value` is greater than `other`. @@ -4547,7 +4548,7 @@ _.gt(1, 3); ### `_.gte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10402 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10468 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") Checks if `value` is greater than or equal to `other`. @@ -4578,7 +4579,7 @@ _.gte(1, 3); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10424 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10490 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") Checks if `value` is likely an `arguments` object. @@ -4605,7 +4606,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10455 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10521 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") Checks if `value` is classified as an `Array` object. @@ -4638,7 +4639,7 @@ _.isArray(_.noop); ### `_.isArrayBuffer(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10475 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10541 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package") Checks if `value` is classified as an `ArrayBuffer` object. @@ -4665,7 +4666,7 @@ _.isArrayBuffer(new Array(2)); ### `_.isArrayLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10504 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10570 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") 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 @@ -4700,7 +4701,7 @@ _.isArrayLike(_.noop); ### `_.isArrayLikeObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10533 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") This method is like `_.isArrayLike` except that it also checks if `value` is an object. @@ -4734,7 +4735,7 @@ _.isArrayLikeObject(_.noop); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10555 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") Checks if `value` is classified as a boolean primitive or object. @@ -4761,7 +4762,7 @@ _.isBoolean(null); ### `_.isBuffer(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10577 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10643 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package") Checks if `value` is a buffer. @@ -4788,7 +4789,7 @@ _.isBuffer(new Uint8Array(2)); ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10665 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") Checks if `value` is classified as a `Date` object. @@ -4815,7 +4816,7 @@ _.isDate('Mon April 23 2012'); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") Checks if `value` is likely a DOM element. @@ -4842,7 +4843,7 @@ _.isElement(''); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10658 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10724 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") Checks if `value` is an empty object, collection, map, or set.
@@ -4887,7 +4888,7 @@ _.isEmpty({ 'a': 1 }); ### `_.isEqual(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10707 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10773 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") Performs a deep comparison between two values to determine if they are equivalent. @@ -4926,7 +4927,7 @@ object === other; ### `_.isEqualWith(value, other, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10810 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") This method is like `_.isEqual` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined`, comparisons @@ -4968,7 +4969,7 @@ _.isEqualWith(array, other, customizer); ### `_.isError(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10769 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10835 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object. @@ -4996,7 +4997,7 @@ _.isError(Error); ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10804 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10870 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") Checks if `value` is a finite primitive number.
@@ -5017,14 +5018,14 @@ Checks if `value` is a finite primitive number. _.isFinite(3); // => true -_.isFinite(Number.MAX_VALUE); -// => true - -_.isFinite(3.14); +_.isFinite(Number.MIN_VALUE); // => true _.isFinite(Infinity); // => false + +_.isFinite('3'); +// => false ``` * * * @@ -5033,7 +5034,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10826 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10892 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") Checks if `value` is classified as a `Function` object. @@ -5060,7 +5061,7 @@ _.isFunction(/abc/); ### `_.isInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10860 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10926 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") Checks if `value` is an integer.
@@ -5097,7 +5098,7 @@ _.isInteger('3'); ### `_.isLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10891 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10957 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") Checks if `value` is a valid array-like length.
@@ -5134,7 +5135,7 @@ _.isLength('3'); ### `_.isMap(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11038 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package") Checks if `value` is classified as a `Map` object. @@ -5161,7 +5162,7 @@ _.isMap(new WeakMap); ### `_.isMatch(object, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11000 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11066 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") Performs a partial deep comparison between `object` and `source` to determine if `object` contains equivalent property values. This method is @@ -5196,7 +5197,7 @@ _.isMatch(object, { 'age': 36 }); ### `_.isMatchWith(object, source, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11036 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11102 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") This method is like `_.isMatch` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined`, comparisons @@ -5238,7 +5239,7 @@ _.isMatchWith(object, source, customizer); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11069 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11135 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") Checks if `value` is `NaN`.
@@ -5277,7 +5278,7 @@ _.isNaN(undefined); ### `_.isNative(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11094 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11160 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") Checks if `value` is a native function. @@ -5304,7 +5305,7 @@ _.isNative(_); ### `_.isNil(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11143 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11209 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") Checks if `value` is `null` or `undefined`. @@ -5334,7 +5335,7 @@ _.isNil(NaN); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11119 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11185 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") Checks if `value` is `null`. @@ -5361,7 +5362,7 @@ _.isNull(void 0); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11174 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11240 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") Checks if `value` is classified as a `Number` primitive or object.
@@ -5398,7 +5399,7 @@ _.isNumber('3'); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10921 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L10987 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") Checks if `value` is the [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) @@ -5433,7 +5434,7 @@ _.isObject(null); ### `_.isObjectLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10950 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11016 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") Checks if `value` is object-like. A value is object-like if it's not `null` and has a `typeof` result of "object". @@ -5467,7 +5468,7 @@ _.isObjectLike(null); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11208 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11274 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") Checks if `value` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`. @@ -5505,7 +5506,7 @@ _.isPlainObject(Object.create(null)); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11240 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11306 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") Checks if `value` is classified as a `RegExp` object. @@ -5532,7 +5533,7 @@ _.isRegExp('/abc/'); ### `_.isSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11272 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11338 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") 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. @@ -5570,7 +5571,7 @@ _.isSafeInteger('3'); ### `_.isSet(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11294 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package") Checks if `value` is classified as a `Set` object. @@ -5597,7 +5598,7 @@ _.isSet(new WeakSet); ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11316 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11382 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") Checks if `value` is classified as a `String` primitive or object. @@ -5624,7 +5625,7 @@ _.isString(1); ### `_.isSymbol(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11405 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") Checks if `value` is classified as a `Symbol` primitive or object. @@ -5651,7 +5652,7 @@ _.isSymbol('abc'); ### `_.isTypedArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11362 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") Checks if `value` is classified as a typed array. @@ -5678,7 +5679,7 @@ _.isTypedArray([]); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11384 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11450 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") Checks if `value` is `undefined`. @@ -5705,7 +5706,7 @@ _.isUndefined(null); ### `_.isWeakMap(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11406 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11472 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package") Checks if `value` is classified as a `WeakMap` object. @@ -5732,7 +5733,7 @@ _.isWeakMap(new Map); ### `_.isWeakSet(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11494 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package") Checks if `value` is classified as a `WeakSet` object. @@ -5759,7 +5760,7 @@ _.isWeakSet(new Set); ### `_.lt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11455 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11521 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") Checks if `value` is less than `other`. @@ -5790,7 +5791,7 @@ _.lt(3, 1); ### `_.lte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11480 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11546 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") Checks if `value` is less than or equal to `other`. @@ -5821,7 +5822,7 @@ _.lte(3, 1); ### `_.toArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11507 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11573 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") Converts `value` to an array. @@ -5853,8 +5854,41 @@ _.toArray(null); +### `_.toFinite(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11612 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tofinite "See the npm package") + +Converts `value` to a finite number. + +#### Since +4.12.0 +#### Arguments +1. `value` *(*)*: The value to convert. + +#### Returns +*(number)*: Returns the converted number. + +#### Example +```js +_.toFinite(3.2); +// => 3.2 + +_.toFinite(Number.MIN_VALUE); +// => 5e-324 + +_.toFinite(Infinity); +// => 1.7976931348623157e+308 + +_.toFinite('3.2'); +// => 3.2 +``` +* * * + + + + + ### `_.toInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11549 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11650 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") Converts `value` to an integer.
@@ -5872,7 +5906,7 @@ Converts `value` to an integer. #### Example ```js -_.toInteger(3); +_.toInteger(3.2); // => 3 _.toInteger(Number.MIN_VALUE); @@ -5881,7 +5915,7 @@ _.toInteger(Number.MIN_VALUE); _.toInteger(Infinity); // => 1.7976931348623157e+308 -_.toInteger('3'); +_.toInteger('3.2'); // => 3 ``` * * * @@ -5891,7 +5925,7 @@ _.toInteger('3'); ### `_.toLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11589 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11684 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") Converts `value` to an integer suitable for use as the length of an array-like object. @@ -5910,7 +5944,7 @@ array-like object. #### Example ```js -_.toLength(3); +_.toLength(3.2); // => 3 _.toLength(Number.MIN_VALUE); @@ -5919,7 +5953,7 @@ _.toLength(Number.MIN_VALUE); _.toLength(Infinity); // => 4294967295 -_.toLength('3'); +_.toLength('3.2'); // => 3 ``` * * * @@ -5929,7 +5963,7 @@ _.toLength('3'); ### `_.toNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11616 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11711 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") Converts `value` to a number. @@ -5943,8 +5977,8 @@ Converts `value` to a number. #### Example ```js -_.toNumber(3); -// => 3 +_.toNumber(3.2); +// => 3.2 _.toNumber(Number.MIN_VALUE); // => 5e-324 @@ -5952,8 +5986,8 @@ _.toNumber(Number.MIN_VALUE); _.toNumber(Infinity); // => Infinity -_.toNumber('3'); -// => 3 +_.toNumber('3.2'); +// => 3.2 ``` * * * @@ -5962,7 +5996,7 @@ _.toNumber('3'); ### `_.toPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11661 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11756 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") Converts `value` to a plain object flattening inherited enumerable string keyed properties of `value` to own properties of the plain object. @@ -5996,7 +6030,7 @@ _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); ### `_.toSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11689 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11784 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") Converts `value` to a safe integer. A safe integer can be compared and represented correctly. @@ -6011,7 +6045,7 @@ represented correctly. #### Example ```js -_.toSafeInteger(3); +_.toSafeInteger(3.2); // => 3 _.toSafeInteger(Number.MIN_VALUE); @@ -6020,7 +6054,7 @@ _.toSafeInteger(Number.MIN_VALUE); _.toSafeInteger(Infinity); // => 9007199254740991 -_.toSafeInteger('3'); +_.toSafeInteger('3.2'); // => 3 ``` * * * @@ -6030,7 +6064,7 @@ _.toSafeInteger('3'); ### `_.toString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11714 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11809 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") Converts `value` to a string. An empty string is returned for `null` and `undefined` values. The sign of `-0` is preserved. @@ -6067,7 +6101,7 @@ _.toString([1, 2, 3]); ### `_.add(augend, addend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15229 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15322 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") Adds two numbers. @@ -6092,7 +6126,7 @@ _.add(6, 4); ### `_.ceil(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15254 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15347 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") Computes `number` rounded up to `precision`. @@ -6123,7 +6157,7 @@ _.ceil(6040, -2); ### `_.divide(dividend, divisor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.divide "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15364 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.divide "See the npm package") Divide two numbers. @@ -6148,7 +6182,7 @@ _.divide(6, 4); ### `_.floor(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15296 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15389 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") Computes `number` rounded down to `precision`. @@ -6179,7 +6213,7 @@ _.floor(4060, -2); ### `_.max(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15316 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15409 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") Computes the maximum value of `array`. If `array` is empty or falsey, `undefined` is returned. @@ -6207,7 +6241,7 @@ _.max([]); ### `_.maxBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15439 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") This method is like `_.max` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -6240,7 +6274,7 @@ _.maxBy(objects, 'n'); ### `_.mean(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15366 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15459 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") Computes the mean of the values in `array`. @@ -6264,7 +6298,7 @@ _.mean([4, 2, 8, 6]); ### `_.meanBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.meanby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15487 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.meanby "See the npm package") 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. @@ -6297,7 +6331,7 @@ _.meanBy(objects, 'n'); ### `_.min(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15416 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15509 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") Computes the minimum value of `array`. If `array` is empty or falsey, `undefined` is returned. @@ -6325,7 +6359,7 @@ _.min([]); ### `_.minBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15446 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15539 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") This method is like `_.min` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -6358,7 +6392,7 @@ _.minBy(objects, 'n'); ### `_.multiply(multiplier, multiplicand)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15467 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.multiply "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15560 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.multiply "See the npm package") Multiply two numbers. @@ -6383,7 +6417,7 @@ _.multiply(6, 4); ### `_.round(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15585 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") Computes `number` rounded to `precision`. @@ -6414,7 +6448,7 @@ _.round(4060, -2); ### `_.subtract(minuend, subtrahend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15509 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") Subtract two numbers. @@ -6439,7 +6473,7 @@ _.subtract(6, 4); ### `_.sum(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15527 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15620 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") Computes the sum of the values in `array`. @@ -6463,7 +6497,7 @@ _.sum([4, 2, 8, 6]); ### `_.sumBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15557 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15650 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") 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. @@ -6502,7 +6536,7 @@ _.sumBy(objects, 'n'); ### `_.clamp(number, [lower], upper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13139 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13232 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") Clamps `number` within the inclusive `lower` and `upper` bounds. @@ -6531,7 +6565,7 @@ _.clamp(10, -5, 5); ### `_.inRange(number, [start=0], end)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13193 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13286 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") 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`. @@ -6578,7 +6612,7 @@ _.inRange(-3, -2, -6); ### `_.random([lower=0], [upper=1], [floating])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13236 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13329 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") 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 @@ -6626,7 +6660,7 @@ _.random(1.2, 5.2); ### `_.assign(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11847 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. @@ -6668,7 +6702,7 @@ _.assign({ 'a': 1 }, new Foo, new Bar); ### `_.assignIn(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11890 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") This method is like `_.assign` except that it iterates over own and inherited source properties. @@ -6711,7 +6745,7 @@ _.assignIn({ 'a': 1 }, new Foo, new Bar); ### `_.assignInWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11834 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11929 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") This method is like `_.assignIn` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns @@ -6752,7 +6786,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.assignWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11866 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11961 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") This method is like `_.assign` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns @@ -6790,7 +6824,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.at(object, [paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11890 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L11985 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") Creates an array of values corresponding to `paths` of `object`. @@ -6801,7 +6835,7 @@ Creates an array of values corresponding to `paths` of `object`. 2. `[paths]` *(...(string|string[]))*: The property paths of elements to pick. #### Returns -*(Array)*: Returns the new array of picked elements. +*(Array)*: Returns the picked values. #### Example ```js @@ -6820,7 +6854,7 @@ _.at(['a', 'b', 'c'], 0, 2); ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11928 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12023 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") Creates an object that inherits from the `prototype` object. If a `properties` object is given, its own enumerable string keyed properties @@ -6864,7 +6898,7 @@ circle instanceof Shape; ### `_.defaults(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11954 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12049 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that @@ -6895,7 +6929,7 @@ _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); ### `_.defaultsDeep(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11979 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12074 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") This method is like `_.defaults` except that it recursively assigns default properties. @@ -6924,7 +6958,7 @@ _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'ag ### `_.findKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12020 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12115 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") This method is like `_.find` except that it returns the key of the first element `predicate` returns truthy for instead of the element itself. @@ -6968,7 +7002,7 @@ _.findKey(users, 'active'); ### `_.findLastKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12155 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") This method is like `_.findKey` except that it iterates over elements of a collection in the opposite order. @@ -7012,7 +7046,7 @@ _.findLastKey(users, 'active'); ### `_.forIn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12092 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12187 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") Iterates over own and inherited enumerable string keyed properties of an object and invokes `iteratee` for each property. The iteratee is invoked @@ -7049,7 +7083,7 @@ _.forIn(new Foo, function(value, key) { ### `_.forInRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12124 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12219 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") This method is like `_.forIn` except that it iterates over properties of `object` in the opposite order. @@ -7084,7 +7118,7 @@ _.forInRight(new Foo, function(value, key) { ### `_.forOwn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12158 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12253 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") Iterates over own enumerable string keyed properties of an object and invokes `iteratee` for each property. The iteratee is invoked with three @@ -7121,7 +7155,7 @@ _.forOwn(new Foo, function(value, key) { ### `_.forOwnRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12188 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") This method is like `_.forOwn` except that it iterates over properties of `object` in the opposite order. @@ -7156,7 +7190,7 @@ _.forOwnRight(new Foo, function(value, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12215 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12310 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") Creates an array of function property names from own enumerable properties of `object`. @@ -7167,7 +7201,7 @@ of `object`. 1. `object` *(Object)*: The object to inspect. #### Returns -*(Array)*: Returns the new array of property names. +*(Array)*: Returns the function names. #### Example ```js @@ -7188,7 +7222,7 @@ _.functions(new Foo); ### `_.functionsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12242 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12337 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") Creates an array of function property names from own and inherited enumerable properties of `object`. @@ -7199,7 +7233,7 @@ enumerable properties of `object`. 1. `object` *(Object)*: The object to inspect. #### Returns -*(Array)*: Returns the new array of property names. +*(Array)*: Returns the function names. #### Example ```js @@ -7220,7 +7254,7 @@ _.functionsIn(new Foo); ### `_.get(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12366 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") Gets the value at `path` of `object`. If the resolved value is `undefined`, the `defaultValue` is used in its place. @@ -7255,7 +7289,7 @@ _.get(object, 'a.b.c', 'default'); ### `_.has(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12303 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12398 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") Checks if `path` is a direct property of `object`. @@ -7292,7 +7326,7 @@ _.has(other, 'a'); ### `_.hasIn(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12333 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") Checks if `path` is a direct or inherited property of `object`. @@ -7328,7 +7362,7 @@ _.hasIn(object, 'b'); ### `_.invert(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12355 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12450 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") Creates an object composed of the inverted keys and values of `object`. If `object` contains duplicate values, subsequent values overwrite @@ -7356,7 +7390,7 @@ _.invert(object); ### `_.invertBy(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12386 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12481 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") This method is like `_.invert` except that the inverted object is generated from the results of running each element of `object` thru `iteratee`. The @@ -7392,7 +7426,7 @@ _.invertBy(object, function(value) { ### `_.invoke(object, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12412 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12507 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") Invokes the method at `path` of `object`. @@ -7420,7 +7454,7 @@ _.invoke(object, 'a[0].b.c.slice', 1, 3); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12442 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12537 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") Creates an array of the own enumerable property names of `object`.
@@ -7459,7 +7493,7 @@ _.keys('hi'); ### `_.keysIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12485 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") Creates an array of the own and inherited enumerable property names of `object`.
@@ -7493,7 +7527,7 @@ _.keysIn(new Foo); ### `_.mapKeys(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12527 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12622 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") The opposite of `_.mapValues`; this method creates an object with the same values as `object` and keys generated by running each own enumerable @@ -7523,7 +7557,7 @@ _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.mapValues(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12566 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12661 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") Creates an object with the same keys as `object` and values generated by running each own enumerable string keyed property of `object` thru @@ -7560,13 +7594,13 @@ _.mapValues(users, 'age'); ### `_.merge(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12607 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12702 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") This method is like `_.assign` except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination object. Source properties that resolve to `undefined` are skipped if a destination value exists. Array and plain object properties -are merged recursively.Other objects and value types are overridden by +are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.
@@ -7602,7 +7636,7 @@ _.merge(users, ages); ### `_.mergeWith(object, sources, customizer)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") This method is like `_.merge` except that it accepts `customizer` which is invoked to produce the merged values of the destination and source @@ -7651,7 +7685,7 @@ _.mergeWith(object, other, customizer); ### `_.omit(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12672 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12767 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") The opposite of `_.pick`; this method creates an object composed of the own and inherited enumerable string keyed properties of `object` that are @@ -7680,7 +7714,7 @@ _.omit(object, ['a', 'c']); ### `_.omitBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12701 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12796 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") The opposite of `_.pickBy`; this method creates an object composed of the own and inherited enumerable string keyed properties of `object` that @@ -7710,7 +7744,7 @@ _.omitBy(object, _.isNumber); ### `_.pick(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12725 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12820 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") Creates an object composed of the picked `object` properties. @@ -7737,7 +7771,7 @@ _.pick(object, ['a', 'c']); ### `_.pickBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12748 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12843 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") Creates an object composed of the `object` properties `predicate` returns truthy for. The predicate is invoked with two arguments: *(value, key)*. @@ -7765,7 +7799,7 @@ _.pickBy(object, _.isNumber); ### `_.result(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12781 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12876 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") 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 @@ -7804,7 +7838,7 @@ _.result(object, 'a[0].b.c3', _.constant('default')); ### `_.set(object, path, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12831 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12926 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") 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 @@ -7843,7 +7877,7 @@ console.log(object.x[0].y.z); ### `_.setWith(object, path, value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12859 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12954 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") This method is like `_.set` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` @@ -7878,10 +7912,11 @@ _.setWith(object, '[0][1]', 'a', Object); ### `_.toPairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12887 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L12983 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") Creates an array of own enumerable string keyed-value pairs for `object` -which can be consumed by `_.fromPairs`. +which can be consumed by `_.fromPairs`. If `object` is a map or set, its +entries are returned. #### Since 4.0.0 @@ -7892,7 +7927,7 @@ which can be consumed by `_.fromPairs`. 1. `object` *(Object)*: The object to query. #### Returns -*(Array)*: Returns the new array of key-value pairs. +*(Array)*: Returns the key-value pairs. #### Example ```js @@ -7913,10 +7948,11 @@ _.toPairs(new Foo); ### `_.toPairsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13009 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") Creates an array of own and inherited enumerable string keyed-value pairs -for `object` which can be consumed by `_.fromPairs`. +for `object` which can be consumed by `_.fromPairs`. If `object` is a map +or set, its entries are returned. #### Since 4.0.0 @@ -7927,7 +7963,7 @@ for `object` which can be consumed by `_.fromPairs`. 1. `object` *(Object)*: The object to query. #### Returns -*(Array)*: Returns the new array of key-value pairs. +*(Array)*: Returns the key-value pairs. #### Example ```js @@ -7939,7 +7975,7 @@ function Foo() { Foo.prototype.c = 3; _.toPairsIn(new Foo); -// => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) +// => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) ``` * * * @@ -7948,7 +7984,7 @@ _.toPairsIn(new Foo); ### `_.transform(object, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12947 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13040 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own @@ -7987,7 +8023,7 @@ _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.unset(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12996 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13089 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") Removes the property at `path` of `object`.
@@ -8025,7 +8061,7 @@ console.log(object); ### `_.update(object, path, updater)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13027 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.update "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13120 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.update "See the npm package") This method is like `_.set` except that accepts `updater` to produce the value to set. Use `_.updateWith` to customize `path` creation. The `updater` @@ -8063,7 +8099,7 @@ console.log(object.x[0].y.z); ### `_.updateWith(object, path, updater, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13055 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.updatewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13148 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.updatewith "See the npm package") This method is like `_.update` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` @@ -8098,7 +8134,7 @@ _.updateWith(object, '[0][1]', _.constant('a'), Object); ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13086 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13179 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") Creates an array of the own enumerable string keyed property values of `object`.
@@ -8135,7 +8171,7 @@ _.values('hi'); ### `_.valuesIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") Creates an array of the own and inherited enumerable string keyed property values of `object`. @@ -8176,7 +8212,7 @@ _.valuesIn(new Foo); ### `_(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1457 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1462 "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, @@ -8259,10 +8295,10 @@ The wrapper methods that are **not** chainable by default are:
`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`, +`isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, +`isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, +`isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, +`isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, @@ -8271,9 +8307,9 @@ The wrapper methods that are **not** chainable by default are:
`pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, -`startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, -`toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, -`toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, +`startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, +`toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, +`toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` #### Arguments @@ -8310,7 +8346,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7876 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7944 "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 @@ -8349,7 +8385,7 @@ var youngest = _ ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7905 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L7973 "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 @@ -8382,7 +8418,7 @@ _([1, 2, 3]) ### `_.thru(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7933 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8001 "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 @@ -8415,7 +8451,7 @@ _(' abc ') ### `_.prototype[Symbol.iterator]()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8092 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8160 "View in source") [Ⓣ][1] Enables the wrapper to be iterable. @@ -8441,7 +8477,7 @@ Array.from(wrapped); ### `_.prototype.at([paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7956 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8024 "View in source") [Ⓣ][1] This method is the wrapper version of `_.at`. @@ -8470,7 +8506,7 @@ _(['a', 'b', 'c']).at(0, 2).value(); ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8008 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8076 "View in source") [Ⓣ][1] Creates a `lodash` wrapper instance with explicit method chain sequences enabled. @@ -8505,7 +8541,7 @@ _(users) ### `_.prototype.commit()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8038 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8106 "View in source") [Ⓣ][1] Executes the chain sequence and returns the wrapped result. @@ -8539,7 +8575,7 @@ console.log(array); ### `_.prototype.next()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8064 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8132 "View in source") [Ⓣ][1] Gets the next value on a wrapped object following the [iterator protocol](https://mdn.io/iteration_protocols#iterator). @@ -8569,7 +8605,7 @@ wrapped.next(); ### `_.prototype.plant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8120 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8188 "View in source") [Ⓣ][1] Creates a clone of the chain sequence planting `value` as the wrapped value. @@ -8603,7 +8639,7 @@ wrapped.value(); ### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8160 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8228 "View in source") [Ⓣ][1] This method is the wrapper version of `_.reverse`.
@@ -8632,7 +8668,7 @@ console.log(array); ### `_.prototype.value()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8192 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L8260 "View in source") [Ⓣ][1] Executes the chain sequence to resolve the unwrapped value. @@ -8662,7 +8698,7 @@ _([1, 2, 3]).value(); ### `_.camelCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13297 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13390 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). @@ -8692,7 +8728,7 @@ _.camelCase('__FOO_BAR__'); ### `_.capitalize([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13317 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13410 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") Converts the first character of `string` to upper case and the remaining to lower case. @@ -8717,7 +8753,7 @@ _.capitalize('FRED'); ### `_.deburr([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13338 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) @@ -8744,7 +8780,7 @@ _.deburr('déjà vu'); ### `_.endsWith([string=''], [target], [position=string.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13366 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13459 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") Checks if `string` ends with the given target string. @@ -8776,7 +8812,7 @@ _.endsWith('abc', 'b', 2); ### `_.escape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13413 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13506 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to their corresponding HTML entities. @@ -8824,7 +8860,7 @@ _.escape('fred, barney, & pebbles'); ### `_.escapeRegExp([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13435 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. @@ -8849,7 +8885,7 @@ _.escapeRegExp('[lodash](https://lodash.com/)'); ### `_.kebabCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13463 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). @@ -8880,7 +8916,7 @@ _.kebabCase('__FOO_BAR__'); ### `_.lowerCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13487 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") Converts `string`, as space separated words, to lower case. @@ -8910,7 +8946,7 @@ _.lowerCase('__FOO_BAR__'); ### `_.lowerFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13508 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13601 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") Converts the first character of `string` to lower case. @@ -8937,7 +8973,7 @@ _.lowerFirst('FRED'); ### `_.pad([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13533 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13626 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") 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`. @@ -8970,7 +9006,7 @@ _.pad('abc', 3); ### `_.padEnd([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13572 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13665 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") Pads `string` on the right side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -9003,7 +9039,7 @@ _.padEnd('abc', 3); ### `_.padStart([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13605 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") Pads `string` on the left side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -9036,7 +9072,7 @@ _.padStart('abc', 3); ### `_.parseInt(string, [radix=10])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13639 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") 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 @@ -9070,7 +9106,7 @@ _.map(['6', '08', '10'], _.parseInt); ### `_.repeat([string=''], [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13673 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") Repeats the given string `n` times. @@ -9101,7 +9137,7 @@ _.repeat('abc', 0); ### `_.replace([string=''], pattern, replacement)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13701 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13794 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") Replaces matches for `pattern` in `string` with `replacement`.
@@ -9131,7 +9167,7 @@ _.replace('Hi Fred', 'Fred', 'Barney'); ### `_.snakeCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13729 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13822 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). @@ -9162,7 +9198,7 @@ _.snakeCase('--FOO-BAR--'); ### `_.split([string=''], separator, [limit])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13845 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") Splits `string` by `separator`.
@@ -9178,7 +9214,7 @@ Splits `string` by `separator`. 3. `[limit]` *(number)*: The length to truncate results to. #### Returns -*(Array)*: Returns the new array of string segments. +*(Array)*: Returns the string segments. #### Example ```js @@ -9192,7 +9228,7 @@ _.split('a-b-c', '-', 2); ### `_.startCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13794 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13887 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). @@ -9223,7 +9259,7 @@ _.startCase('__FOO_BAR__'); ### `_.startsWith([string=''], [target], [position=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13821 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L13914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") Checks if `string` starts with the given target string. @@ -9255,7 +9291,7 @@ _.startsWith('abc', 'b', 1); ### `_.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.11.2/lodash.js#L13930 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14023 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in @@ -9318,12 +9354,6 @@ var compiled = _.template('hello ${ user }!'); compiled({ 'user': 'pebbles' }); // => 'hello pebbles!' -// Use custom template delimiters. -_.templateSettings.interpolate = /{{([\s\S]+?)}}/g; -var compiled = _.template('hello {{ user }}!'); -compiled({ 'user': 'mustache' }); -// => 'hello mustache!' - // Use backslashes to treat delimiters as plain text. var compiled = _.template('<%= "\\<%- value %\\>" %>'); compiled({ 'value': 'ignored' }); @@ -9349,9 +9379,15 @@ compiled.source; // return __p; // } +// Use custom template delimiters. +_.templateSettings.interpolate = /{{([\s\S]+?)}}/g; +var compiled = _.template('hello {{ user }}!'); +compiled({ 'user': 'mustache' }); +// => 'hello mustache!' + // Use the `source` property to inline compiled templates for meaningful // line numbers in error messages and stack traces. -fs.writeFileSync(path.join(cwd, 'jst.js'), '\ +fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ var JST = {\ "main": ' + _.template(mainText).source + '\ };\ @@ -9364,7 +9400,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.toLower([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14059 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14152 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") Converts `string`, as a whole, to lower case just like [String#toLowerCase](https://mdn.io/toLowerCase). @@ -9395,7 +9431,7 @@ _.toLower('__FOO_BAR__'); ### `_.toUpper([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14177 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") Converts `string`, as a whole, to upper case just like [String#toUpperCase](https://mdn.io/toUpperCase). @@ -9426,7 +9462,7 @@ _.toUpper('__foo_bar__'); ### `_.trim([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14110 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14203 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") Removes leading and trailing whitespace or specified characters from `string`. @@ -9457,7 +9493,7 @@ _.map([' foo ', ' bar '], _.trim); ### `_.trimEnd([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14145 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14238 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") Removes trailing whitespace or specified characters from `string`. @@ -9485,7 +9521,7 @@ _.trimEnd('-_-abc-_-', '_-'); ### `_.trimStart([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") Removes leading whitespace or specified characters from `string`. @@ -9513,7 +9549,7 @@ _.trimStart('-_-abc-_-', '_-'); ### `_.truncate([string=''], [options={}], [options.length=30], [options.omission='...'], [options.separator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14229 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14322 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") Truncates `string` if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission @@ -9560,7 +9596,7 @@ _.truncate('hi-diddly-ho there, neighborino', { ### `_.unescape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14304 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14397 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, `'`, and ``` in `string` to @@ -9590,7 +9626,7 @@ _.unescape('fred, barney, & pebbles'); ### `_.upperCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14331 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14424 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") Converts `string`, as space separated words, to upper case. @@ -9620,7 +9656,7 @@ _.upperCase('__foo_bar__'); ### `_.upperFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14352 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14445 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") Converts the first character of `string` to upper case. @@ -9647,7 +9683,7 @@ _.upperFirst('FRED'); ### `_.words([string=''], [pattern])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14466 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") Splits `string` into an array of its words. @@ -9681,7 +9717,7 @@ _.words('fred, barney, & pebbles', /[^, ]+/g); ### `_.attempt(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14407 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14500 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") Attempts to invoke `func`, returning either the result or the caught error object. Any additional arguments are provided to `func` when it's invoked. @@ -9713,7 +9749,7 @@ if (_.isError(elements)) { ### `_.bindAll(object, methodNames)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14441 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14534 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") Binds methods of an object to the object itself, overwriting the existing method. @@ -9750,7 +9786,7 @@ jQuery(element).on('click', view.onClick); ### `_.cond(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14478 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") Creates a function that iterates over `pairs` and invokes the corresponding function of the first predicate to return truthy. The predicate-function @@ -9763,7 +9799,7 @@ function. 1. `pairs` *(Array)*: The predicate-function pairs. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new composite function. #### Example ```js @@ -9789,7 +9825,7 @@ func({ 'a': '1', 'b': '2' }); ### `_.conforms(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14521 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14614 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") Creates a function that invokes the predicate properties of `source` with the corresponding property values of a given object, returning `true` if @@ -9801,7 +9837,7 @@ all predicates return truthy, else `false`. 1. `source` *(Object)*: The object of property predicates to conform to. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new spec function. #### Example ```js @@ -9820,7 +9856,7 @@ _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14542 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14635 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") Creates a function that returns `value`. @@ -9830,7 +9866,7 @@ Creates a function that returns `value`. 1. `value` *(*)*: The value to return from the new function. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new constant function. #### Example ```js @@ -9847,7 +9883,7 @@ getter() === object; ### `_.flow([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14570 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14663 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") Creates a function that returns the result of invoking the given functions with the `this` binding of the created function, where each successive @@ -9859,7 +9895,7 @@ invocation is supplied the return value of the previous. 1. `[funcs]` *(...(Function|Function[]))*: Functions to invoke. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new composite function. #### Example ```js @@ -9878,7 +9914,7 @@ addSquare(1, 2); ### `_.flowRight([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14593 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14686 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") This method is like `_.flow` except that it creates a function that invokes the given functions from right to left. @@ -9889,7 +9925,7 @@ invokes the given functions from right to left. 1. `[funcs]` *(...(Function|Function[]))*: Functions to invoke. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new composite function. #### Example ```js @@ -9908,7 +9944,7 @@ addSquare(1, 2); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14611 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14704 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") This method returns the first argument given to it. @@ -9934,7 +9970,7 @@ _.identity(object) === object; ### `_.iteratee([func=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14657 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14750 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") Creates a function that invokes `func` with the arguments of the created function. If `func` is a property name, the created function returns the @@ -9986,7 +10022,7 @@ _.filter(['abc', 'def'], /ef/); ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14685 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14778 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") Creates a function that performs a partial deep comparison between a given object and `source`, returning `true` if the given object has equivalent @@ -10002,7 +10038,7 @@ property values, else `false`. The created function is equivalent to 1. `source` *(Object)*: The object of property values to match. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new spec function. #### Example ```js @@ -10021,7 +10057,7 @@ _.filter(users, _.matches({ 'age': 40, 'active': false })); ### `_.matchesProperty(path, srcValue)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14713 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14806 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") Creates a function that performs a partial deep comparison between the value at `path` of a given object to `srcValue`, returning `true` if the @@ -10037,7 +10073,7 @@ object value is equivalent, else `false`. 2. `srcValue` *(*)*: The value to match. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new spec function. #### Example ```js @@ -10056,7 +10092,7 @@ _.find(users, _.matchesProperty('user', 'fred')); ### `_.method(path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14741 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14834 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") Creates a function that invokes the method at `path` of a given object. Any additional arguments are provided to the invoked method. @@ -10068,7 +10104,7 @@ Any additional arguments are provided to the invoked method. 2. `[args]` *(...*)*: The arguments to invoke the method with. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new invoker function. #### Example ```js @@ -10090,7 +10126,7 @@ _.map(objects, _.method(['a', 'b'])); ### `_.methodOf(object, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14770 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14863 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") The opposite of `_.method`; this method creates a function that invokes the method at a given path of `object`. Any additional arguments are @@ -10103,7 +10139,7 @@ provided to the invoked method. 2. `[args]` *(...*)*: The arguments to invoke the method with. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new invoker function. #### Example ```js @@ -10123,7 +10159,7 @@ _.map([['a', '2'], ['c', '0']], _.methodOf(object)); ### `_.mixin([object=lodash], source, [options={}], [options.chain=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14812 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14905 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") Adds all own enumerable string keyed function properties of a source object to the destination object. If `object` is a function, then methods @@ -10170,7 +10206,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14861 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14954 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") Reverts the `_` variable to its previous value and returns a reference to the `lodash` function. @@ -10191,7 +10227,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14883 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L14976 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") A no-operation function that returns `undefined` regardless of the arguments it receives. @@ -10212,9 +10248,9 @@ _.noop(object) === undefined; ### `_.nthArg([n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14907 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15000 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") -Creates a function that returns its nth argument. If `n` is negative, +Creates a function that gets the argument at `n` index. If `n` is negative, the nth argument from the end is returned. #### Since @@ -10223,7 +10259,7 @@ the nth argument from the end is returned. 1. `[n=0]` *(number)*: The index of the argument to return. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new pass-thru function. #### Example ```js @@ -10242,7 +10278,7 @@ func('a', 'b', 'c', 'd'); ### `_.over([iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14932 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15025 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") Creates a function that invokes `iteratees` with the arguments it receives and returns their results. @@ -10269,7 +10305,7 @@ func(1, 2, 3, 4); ### `_.overEvery([predicates=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14958 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15051 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") Creates a function that checks if **all** of the `predicates` return truthy when invoked with the arguments it receives. @@ -10302,7 +10338,7 @@ func(NaN); ### `_.overSome([predicates=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15077 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") Creates a function that checks if **any** of the `predicates` return truthy when invoked with the arguments it receives. @@ -10335,7 +10371,7 @@ func(NaN); ### `_.property(path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15008 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15101 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") Creates a function that returns the value at `path` of a given object. @@ -10345,7 +10381,7 @@ Creates a function that returns the value at `path` of a given object. 1. `path` *(Array|string)*: The path of the property to get. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new accessor function. #### Example ```js @@ -10367,7 +10403,7 @@ _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); ### `_.propertyOf(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15033 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15126 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") The opposite of `_.property`; this method creates a function that returns the value at a given path of `object`. @@ -10378,7 +10414,7 @@ the value at a given path of `object`. 1. `object` *(Object)*: The object to query. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new accessor function. #### Example ```js @@ -10398,7 +10434,7 @@ _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15080 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15173 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") 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 @@ -10417,7 +10453,7 @@ floating-point values which can produce unexpected results. 3. `[step=1]` *(number)*: The value to increment or decrement by. #### Returns -*(Array)*: Returns the new array of numbers. +*(Array)*: Returns the range of numbers. #### Example ```js @@ -10449,7 +10485,7 @@ _.range(0); ### `_.rangeRight([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15118 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15211 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") This method is like `_.range` except that it populates values in descending order. @@ -10462,7 +10498,7 @@ descending order. 3. `[step=1]` *(number)*: The value to increment or decrement by. #### Returns -*(Array)*: Returns the new array of numbers. +*(Array)*: Returns the range of numbers. #### Example ```js @@ -10494,7 +10530,7 @@ _.rangeRight(0); ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1239 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1244 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") Create a new pristine `lodash` function using the `context` object. @@ -10540,7 +10576,7 @@ var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; ### `_.times(n, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15139 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15232 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") Invokes the iteratee `n` times, returning an array of the results of each invocation. The iteratee is invoked with one argument; *(index)*. @@ -10569,7 +10605,7 @@ _.times(3, String); ### `_.toPath(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15183 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15276 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") Converts `value` to a property path array. @@ -10605,7 +10641,7 @@ console.log(path === newPath); ### `_.uniqueId([prefix=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15300 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") Generates a unique ID. If `prefix` is given, the ID is appended to it. @@ -10638,7 +10674,7 @@ _.uniqueId(); ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15894 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L15988 "View in source") [Ⓣ][1] (string): The semantic version number. @@ -10649,7 +10685,7 @@ _.uniqueId(); ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1502 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1507 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") (Object): By default, the template delimiters used by lodash are like those in embedded Ruby *(ERB)*. Change the following template settings to use @@ -10662,7 +10698,7 @@ alternative delimiters. ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1510 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1515 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to be HTML-escaped. @@ -10673,7 +10709,7 @@ alternative delimiters. ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1518 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1523 "View in source") [Ⓣ][1] (RegExp): Used to detect code to be evaluated. @@ -10684,7 +10720,7 @@ alternative delimiters. ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1542 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1547 "View in source") [Ⓣ][1] (Object): Used to import variables into the compiled template. @@ -10695,7 +10731,7 @@ alternative delimiters. ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1526 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1531 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to inject. @@ -10706,7 +10742,7 @@ alternative delimiters. ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1534 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1539 "View in source") [Ⓣ][1] (string): Used to reference the data object in the template text. @@ -10723,7 +10759,7 @@ alternative delimiters. ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1550 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.12.0/lodash.js#L1555 "View in source") [Ⓣ][1] A reference to the `lodash` function. diff --git a/lodash.js b/lodash.js index 1ca558afd7..4bcb6ca88c 100644 --- a/lodash.js +++ b/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.11.2'; + var VERSION = '4.12.0'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/package.json b/package.json index ca7fab3976..44bcb934d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "4.11.2", + "version": "4.12.0", "license": "MIT", "private": true, "main": "lodash.js", From 43fffe32002fc46c11b9d9e268b50a74123aa80d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 7 May 2016 01:09:24 -0700 Subject: [PATCH 57/57] Bump to v4.12.0. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fe1455922e..514bc309a2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# lodash v4.11.2 +# lodash v4.12.0 [Site](https://lodash.com/) | [Docs](https://lodash.com/docs) | [FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide) | -[Contributing](https://github.com/lodash/lodash/blob/4.11.2/.github/CONTRIBUTING.md) | +[Contributing](https://github.com/lodash/lodash/blob/4.12.0/.github/CONTRIBUTING.md) | [Wiki](https://github.com/lodash/lodash/wiki "Changelog, Roadmap, etc.") | [Code of Conduct](https://jquery.org/conduct/) | [Twitter](https://twitter.com/bestiejs) | @@ -20,11 +20,11 @@ $ lodash core -o ./dist/lodash.core.js ## Download -Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.11.2/LICENSE) & supports [modern environments](#support).
+Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.12.0/LICENSE) & supports [modern environments](#support).
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one that’s right for you. - * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.core.min.js)) - * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.min.js)) + * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.core.min.js)) + * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.min.js)) * [CDN copies](https://www.jsdelivr.com/projects/lodash) ## Why Lodash? @@ -43,4 +43,4 @@ Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & * [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized) * [lodash-amd](https://www.npmjs.com/package/lodash-amd) * [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash) - * [lodash/fp](https://github.com/lodash/lodash/tree/4.11.2-npm/fp) + * [lodash/fp](https://github.com/lodash/lodash/tree/4.12.0-npm/fp)