Compare commits

...

6 Commits

Author SHA1 Message Date
John-David Dalton
5c7ff7a9f3 Bump to v4.6.0. 2019-07-09 21:54:47 -07:00
John-David Dalton
529ca45adf Bump to v4.5.7. 2019-07-09 21:54:46 -07:00
John-David Dalton
6c68ea87c8 Bump to v4.5.6. 2019-07-09 21:54:46 -07:00
John-David Dalton
826825a40a Bump to v4.5.5. 2019-07-09 21:54:46 -07:00
John-David Dalton
75c7a81c5c Bump to v4.5.4. 2019-07-09 21:54:45 -07:00
John-David Dalton
5338f5758c Bump to v4.5.3. 2019-07-09 21:54:45 -07:00
206 changed files with 38098 additions and 7437 deletions

View File

@@ -1,4 +1,4 @@
# lodash v4.5.2 # lodash v4.6.0
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.

View File

@@ -1,18 +0,0 @@
# lodash._baseclone v4.5.2
The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash._baseclone
```
In Node.js:
```js
var baseClone = require('lodash._baseclone');
```
See the [package source](https://github.com/lodash/lodash/blob/4.5.2-npm-packages/lodash._baseclone) for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +1,47 @@
The MIT License (MIT) Copyright jQuery Foundation and other contributors <https://jquery.org/>
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Based on Underscore.js, copyright Jeremy Ashkenas,
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining a copy This software consists of voluntary contributions made by many
of this software and associated documentation files (the "Software"), to deal individuals. For exact contribution history, see the revision history
in the Software without restriction, including without limitation the rights available at https://github.com/lodash/lodash
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The following license applies to all parts of this software except as
copies or substantial portions of the Software. documented below:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ====
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE Permission is hereby granted, free of charge, to any person obtaining
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER a copy of this software and associated documentation files (the
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "Software"), to deal in the Software without restriction, including
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE without limitation the rights to use, copy, modify, merge, publish,
SOFTWARE. distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -1,4 +1,4 @@
# lodash._baseiteratee v4.5.2 # lodash._baseiteratee v4.6.0
The internal [lodash](https://lodash.com/) function `baseIteratee` exported as a [Node.js](https://nodejs.org/) module. The internal [lodash](https://lodash.com/) function `baseIteratee` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var baseIteratee = require('lodash._baseiteratee'); var baseIteratee = require('lodash._baseiteratee');
``` ```
See the [package source](https://github.com/lodash/lodash/blob/4.5.2-npm-packages/lodash._baseiteratee) for more details. See the [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash._baseiteratee) for more details.

View File

@@ -1,11 +1,12 @@
/** /**
* lodash 4.5.2 (Custom Build) <https://lodash.com/> * lodash 4.6.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/ */
var stringToPath = require('lodash._stringtopath');
/** Used as the size to enable large array optimizations. */ /** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200; var LARGE_ARRAY_SIZE = 200;
@@ -18,8 +19,7 @@ var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2; PARTIAL_COMPARE_FLAG = 2;
/** Used as references for various `Number` constants. */ /** Used as references for various `Number` constants. */
var INFINITY = 1 / 0, var MAX_SAFE_INTEGER = 9007199254740991;
MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */ /** `Object#toString` result references. */
var argsTag = '[object Arguments]', var argsTag = '[object Arguments]',
@@ -32,6 +32,7 @@ var argsTag = '[object Arguments]',
mapTag = '[object Map]', mapTag = '[object Map]',
numberTag = '[object Number]', numberTag = '[object Number]',
objectTag = '[object Object]', objectTag = '[object Object]',
promiseTag = '[object Promise]',
regexpTag = '[object RegExp]', regexpTag = '[object RegExp]',
setTag = '[object Set]', setTag = '[object Set]',
stringTag = '[object String]', stringTag = '[object String]',
@@ -39,6 +40,7 @@ var argsTag = '[object Arguments]',
weakMapTag = '[object WeakMap]'; weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]', var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]', float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]', float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]', int8Tag = '[object Int8Array]',
@@ -51,16 +53,12 @@ var arrayBufferTag = '[object ArrayBuffer]',
/** Used to match property names within property paths. */ /** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/, reIsPlainProp = /^\w*$/;
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */ /** Used to detect host constructors (Safari). */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */ /** Used to detect unsigned integer values. */
@@ -75,11 +73,12 @@ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true; typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/** Used to determine if values are of the language type `Object`. */ /** Used to determine if values are of the language type `Object`. */
var objectTypes = { var objectTypes = {
@@ -146,7 +145,8 @@ function arrayMap(array, iteratee) {
* @private * @private
* @param {Array} array The array to iterate over. * @param {Array} array The array to iterate over.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. * @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/ */
function arraySome(array, predicate) { function arraySome(array, predicate) {
var index = -1, var index = -1,
@@ -297,28 +297,31 @@ var reIsNative = RegExp('^' +
/** Built-in value references. */ /** Built-in value references. */
var Symbol = root.Symbol, var Symbol = root.Symbol,
Uint8Array = root.Uint8Array, Uint8Array = root.Uint8Array,
getPrototypeOf = Object.getPrototypeOf,
propertyIsEnumerable = objectProto.propertyIsEnumerable, propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = Object.keys; var nativeGetPrototype = Object.getPrototypeOf,
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'), var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'), Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap'), WeakMap = getNative(root, 'WeakMap'),
nativeCreate = getNative(Object, 'create'); nativeCreate = getNative(Object, 'create');
/** Used to detect maps, sets, and weakmaps. */ /** Used to detect maps, sets, and weakmaps. */
var mapCtorString = Map ? funcToString.call(Map) : '', var dataViewCtorString = DataView ? (DataView + '') : '',
mapCtorString = Map ? funcToString.call(Map) : '',
promiseCtorString = Promise ? funcToString.call(Promise) : '',
setCtorString = Set ? funcToString.call(Set) : '', setCtorString = Set ? funcToString.call(Set) : '',
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
/** Used to convert symbols to primitives and strings. */ /** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined, var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
symbolToString = symbolProto ? symbolProto.toString : undefined;
/** /**
* Creates an hash object. * Creates an hash object.
@@ -381,6 +384,9 @@ function hashSet(hash, key, value) {
hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
} }
// Avoid inheriting from `Object.prototype` when possible.
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
/** /**
* Creates a map cache object to store key-value pairs. * Creates a map cache object to store key-value pairs.
* *
@@ -473,7 +479,7 @@ function mapHas(key) {
* @memberOf MapCache * @memberOf MapCache
* @param {string} key The key of the value to set. * @param {string} key The key of the value to set.
* @param {*} value The value to set. * @param {*} value The value to set.
* @returns {Object} Returns the map cache object. * @returns {Object} Returns the map cache instance.
*/ */
function mapSet(key, value) { function mapSet(key, value) {
var data = this.__data__; var data = this.__data__;
@@ -487,6 +493,13 @@ function mapSet(key, value) {
return this; 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;
/** /**
* Creates a stack cache object to store key-value pairs. * Creates a stack cache object to store key-value pairs.
* *
@@ -572,7 +585,7 @@ function stackHas(key) {
* @memberOf Stack * @memberOf Stack
* @param {string} key The key of the value to set. * @param {string} key The key of the value to set.
* @param {*} value The value to set. * @param {*} value The value to set.
* @returns {Object} Returns the stack cache object. * @returns {Object} Returns the stack cache instance.
*/ */
function stackSet(key, value) { function stackSet(key, value) {
var data = this.__data__, var data = this.__data__,
@@ -593,11 +606,18 @@ function stackSet(key, value) {
return this; return this;
} }
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/** /**
* Removes `key` and its value from the associative array. * Removes `key` and its value from the associative array.
* *
* @private * @private
* @param {Array} array The array to query. * @param {Array} array The array to modify.
* @param {string} key The key of the value to remove. * @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/ */
@@ -641,8 +661,7 @@ function assocHas(array, key) {
} }
/** /**
* Gets the index at which the first occurrence of `key` is found in `array` * Gets the index at which the `key` is found in `array` of key-value pairs.
* of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to search.
@@ -696,7 +715,7 @@ function baseCastPath(value) {
* @returns {*} Returns the resolved value. * @returns {*} Returns the resolved value.
*/ */
function baseGet(object, path) { function baseGet(object, path) {
path = isKey(path, object) ? [path + ''] : baseCastPath(path); path = isKey(path, object) ? [path] : baseCastPath(path);
var index = 0, var index = 0,
length = path.length; length = path.length;
@@ -720,7 +739,7 @@ function baseHas(object, key) {
// that are composed entirely of index properties, return `false` for // that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them. // `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) || return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null); (typeof object == 'object' && key in object && getPrototype(object) === null);
} }
/** /**
@@ -770,7 +789,8 @@ function baseIsEqual(value, other, customizer, bitmask, stack) {
* @param {Object} other The other object to compare. * @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons. * @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/ */
@@ -803,8 +823,11 @@ function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) { if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack); stack || (stack = new Stack);
return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
} }
} }
if (!isSameTag) { if (!isSameTag) {
@@ -853,9 +876,10 @@ function baseIsMatch(object, source, matchData, customizer) {
return false; return false;
} }
} else { } else {
var stack = new Stack, var stack = new Stack;
result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined if (!(result === undefined
? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
: result : result
@@ -875,14 +899,15 @@ function baseIsMatch(object, source, matchData, customizer) {
* @returns {Function} Returns the iteratee. * @returns {Function} Returns the iteratee.
*/ */
function baseIteratee(value) { function baseIteratee(value) {
var type = typeof value; // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
if (type == 'function') { // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value; return value;
} }
if (value == null) { if (value == null) {
return identity; return identity;
} }
if (type == 'object') { if (typeof value == 'object') {
return isArray(value) return isArray(value)
? baseMatchesProperty(value[0], value[1]) ? baseMatchesProperty(value[0], value[1])
: baseMatches(value); : baseMatches(value);
@@ -971,36 +996,6 @@ function basePropertyDeep(path) {
}; };
} }
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
/** /**
* A specialized version of `baseIsEqualDeep` for arrays with support for * A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons. * partial deep comparisons.
@@ -1010,7 +1005,8 @@ function baseSlice(array, start, end) {
* @param {Array} other The other array to compare. * @param {Array} other The other array to compare.
* @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons. * @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `array` and `other` objects. * @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/ */
@@ -1052,12 +1048,16 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
// Recursively compare arrays (susceptible to call stack limits). // Recursively compare arrays (susceptible to call stack limits).
if (isUnordered) { if (isUnordered) {
if (!arraySome(other, function(othValue) { if (!arraySome(other, function(othValue) {
return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); return arrValue === othValue ||
equalFunc(arrValue, othValue, customizer, bitmask, stack);
})) { })) {
result = false; result = false;
break; break;
} }
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { } else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, customizer, bitmask, stack)
)) {
result = false; result = false;
break; break;
} }
@@ -1079,12 +1079,21 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
* @param {string} tag The `toStringTag` of the objects to compare. * @param {string} tag The `toStringTag` of the objects to compare.
* @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons. * @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects. * @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/ */
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
switch (tag) { switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag: case arrayBufferTag:
if ((object.byteLength != other.byteLength) || if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) { !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
@@ -1094,8 +1103,9 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case boolTag: case boolTag:
case dateTag: case dateTag:
// Coerce dates and booleans to numbers, dates to milliseconds and booleans // Coerce dates and booleans to numbers, dates to milliseconds and
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal. // booleans to `1` or `0` treating invalid dates coerced to `NaN` as
// not equal.
return +object == +other; return +object == +other;
case errorTag: case errorTag:
@@ -1107,8 +1117,8 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings primitives and string // Coerce regexes to strings and treat strings, primitives and objects,
// objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. // as equal. See https://es5.github.io/#x15.10.6.4 for more details.
return object == (other + ''); return object == (other + '');
case mapTag: case mapTag:
@@ -1126,8 +1136,11 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
if (stacked) { if (stacked) {
return stacked == other; return stacked == other;
} }
bitmask |= UNORDERED_COMPARE_FLAG;
stack.set(object, other);
// Recursively compare objects (susceptible to call stack limits). // Recursively compare objects (susceptible to call stack limits).
return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other)); return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
case symbolTag: case symbolTag:
if (symbolValueOf) { if (symbolValueOf) {
@@ -1146,7 +1159,8 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
* @param {Object} other The other object to compare. * @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons. * @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects. * @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/ */
@@ -1215,8 +1229,9 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
/** /**
* Gets the "length" property value of `object`. * Gets the "length" property value of `object`.
* *
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * **Note:** This function is used to avoid a
* that affects Safari on at least iOS 8.1-8.3 ARM64. * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
@@ -1254,6 +1269,17 @@ function getNative(object, key) {
return isNative(value) ? value : undefined; return isNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
function getPrototype(value) {
return nativeGetPrototype(Object(value));
}
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1265,8 +1291,11 @@ function getTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. // Fallback for data views, maps, sets, and weak maps in IE 11,
if ((Map && getTag(new Map) != mapTag) || // for data views in Edge, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) || (Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) { (WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) { getTag = function(value) {
@@ -1276,7 +1305,9 @@ if ((Map && getTag(new Map) != mapTag) ||
if (ctorString) { if (ctorString) {
switch (ctorString) { switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag; case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag; case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag; case weakMapCtorString: return weakMapTag;
} }
@@ -1301,10 +1332,16 @@ function hasPath(object, path, hasFunc) {
var result = hasFunc(object, path); var result = hasFunc(object, path);
if (!result && !isKey(path)) { if (!result && !isKey(path)) {
path = baseCastPath(path); path = baseCastPath(path);
object = parent(object, path);
if (object != null) { var index = -1,
path = last(path); length = path.length;
result = hasFunc(object, path);
while (object != null && ++index < length) {
var key = path[index];
if (!(result = hasFunc(object, key))) {
break;
}
object = object[key];
} }
} }
var length = object ? object.length : undefined; var length = object ? object.length : undefined;
@@ -1340,11 +1377,12 @@ function indexKeys(object) {
* @returns {boolean} Returns `true` if `value` is a property name, else `false`. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/ */
function isKey(value, object) { function isKey(value, object) {
if (typeof value == 'number') { var type = typeof value;
if (type == 'number' || type == 'symbol') {
return true; return true;
} }
return !isArray(value) && return !isArray(value) &&
(reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object))); (object != null && value in Object(object)));
} }
@@ -1388,56 +1426,13 @@ function isStrictComparable(value) {
} }
/** /**
* Gets the parent value at `path` of `object`. * Performs a
* * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
function stringToPath(string) {
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
}
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array ? array.length : 0;
return length ? array[length - 1] : undefined;
}
/**
* Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to compare. * @param {*} value The value to compare.
* @param {*} other The other value to compare. * @param {*} other The other value to compare.
@@ -1471,9 +1466,11 @@ function eq(value, other) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isArguments(function() { return arguments; }()); * _.isArguments(function() { return arguments; }());
@@ -1493,10 +1490,12 @@ function isArguments(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @type {Function} * @type {Function}
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isArray([1, 2, 3]); * _.isArray([1, 2, 3]);
@@ -1520,6 +1519,7 @@ var isArray = Array.isArray;
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
@@ -1547,9 +1547,11 @@ function isArrayLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. * @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example * @example
* *
* _.isArrayLikeObject([1, 2, 3]); * _.isArrayLikeObject([1, 2, 3]);
@@ -1573,9 +1575,11 @@ function isArrayLikeObject(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -1595,13 +1599,16 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * **Note:** This function is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @returns {boolean} Returns `true` if `value` is a valid length,
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1627,6 +1634,7 @@ function isLength(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
@@ -1655,6 +1663,7 @@ function isObject(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
@@ -1681,9 +1690,11 @@ function isObjectLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`. * @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example * @example
* *
* _.isNative(Array.prototype.push); * _.isNative(Array.prototype.push);
@@ -1707,10 +1718,12 @@ function isNative(value) {
* Checks if `value` is classified as a `String` primitive or object. * Checks if `value` is classified as a `String` primitive or object.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isString('abc'); * _.isString('abc');
@@ -1729,9 +1742,11 @@ function isString(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isSymbol(Symbol.iterator); * _.isSymbol(Symbol.iterator);
@@ -1750,9 +1765,11 @@ function isSymbol(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isTypedArray(new Uint8Array); * _.isTypedArray(new Uint8Array);
@@ -1766,51 +1783,17 @@ function isTypedArray(value) {
isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
} }
/**
* Converts `value` to a string if it's not one. An empty string is returned
* for `null` and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (value == null) {
return '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/** /**
* Gets the value at `path` of `object`. If the resolved value is * Gets the value at `path` of `object`. If the resolved value is
* `undefined` the `defaultValue` is used in its place. * `undefined` the `defaultValue` is used in its place.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.7.0
* @category Object * @category Object
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get. * @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned if the resolved value is `undefined`. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value. * @returns {*} Returns the resolved value.
* @example * @example
* *
@@ -1835,6 +1818,7 @@ function get(object, path, defaultValue) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Object * @category Object
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @param {Array|string} path The path to check. * @param {Array|string} path The path to check.
@@ -1867,6 +1851,7 @@ function hasIn(object, path) {
* for more details. * for more details.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Object * @category Object
* @param {Object} object The object to query. * @param {Object} object The object to query.
@@ -1907,11 +1892,13 @@ function keys(object) {
} }
/** /**
* Creates an array of own enumerable key-value pairs for `object` which * Creates an array of own enumerable string keyed-value pairs for `object`
* can be consumed by `_.fromPairs`. * which can be consumed by `_.fromPairs`.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @alias entries
* @category Object * @category Object
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the new array of key-value pairs. * @returns {Array} Returns the new array of key-value pairs.
@@ -1935,6 +1922,7 @@ function toPairs(object) {
* This method returns the first argument given to it. * This method returns the first argument given to it.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Util * @category Util
* @param {*} value Any value. * @param {*} value Any value.
@@ -1955,6 +1943,7 @@ function identity(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 2.4.0
* @category Util * @category Util
* @param {Array|string} path The path of the property to get. * @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new function. * @returns {Function} Returns the new function.
@@ -1975,21 +1964,4 @@ function property(path) {
return isKey(path) ? baseProperty(path) : basePropertyDeep(path); return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
} }
// Avoid inheriting from `Object.prototype` when possible.
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
// Add functions to the `MapCache`.
MapCache.prototype.clear = mapClear;
MapCache.prototype['delete'] = mapDelete;
MapCache.prototype.get = mapGet;
MapCache.prototype.has = mapHas;
MapCache.prototype.set = mapSet;
// Add functions to the `Stack` cache.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = baseIteratee; module.exports = baseIteratee;

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash._baseiteratee", "name": "lodash._baseiteratee",
"version": "4.5.2", "version": "4.6.0",
"description": "The internal lodash function `baseIteratee` exported as a module.", "description": "The internal lodash function `baseIteratee` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -12,5 +12,8 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
"dependencies": {
"lodash._stringtopath": "~4.7.0"
}
} }

View File

@@ -0,0 +1,18 @@
# lodash._basepullall v4.6.0
The internal [lodash](https://lodash.com/) function `basePullAll` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash._basepullall
```
In Node.js:
```js
var basePullAll = require('lodash._basepullall');
```
See the [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash._basepullall) for more details.

View File

@@ -1,5 +1,5 @@
/** /**
* lodash 4.1.0 (Custom Build) <https://lodash.com/> * lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -51,6 +51,41 @@ function baseIndexOf(array, value, fromIndex) {
return -1; return -1;
} }
/**
* This function is like `baseIndexOf` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @param {Function} comparator The comparator invoked per element.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOfWith(array, value, fromIndex, comparator) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (comparator(array[index], value)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.unary` without support for storing wrapper metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
/** /**
* Gets the index at which the first occurrence of `NaN` is found in `array`. * Gets the index at which the first occurrence of `NaN` is found in `array`.
* *
@@ -87,22 +122,24 @@ var splice = arrayProto.splice;
* @param {Array} array The array to modify. * @param {Array} array The array to modify.
* @param {Array} values The values to remove. * @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`. * @returns {Array} Returns `array`.
*/ */
function basePullAllBy(array, values, iteratee) { function basePullAll(array, values, iteratee, comparator) {
var index = -1, var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
index = -1,
length = values.length, length = values.length,
seen = array; seen = array;
if (iteratee) { if (iteratee) {
seen = arrayMap(array, function(value) { return iteratee(value); }); seen = arrayMap(array, baseUnary(iteratee));
} }
while (++index < length) { while (++index < length) {
var fromIndex = 0, var fromIndex = 0,
value = values[index], value = values[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) { while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
if (seen !== array) { if (seen !== array) {
splice.call(seen, fromIndex, 1); splice.call(seen, fromIndex, 1);
} }
@@ -112,4 +149,4 @@ function basePullAllBy(array, values, iteratee) {
return array; return array;
} }
module.exports = basePullAllBy; module.exports = basePullAll;

View File

@@ -1,7 +1,7 @@
{ {
"name": "lodash._baseclone", "name": "lodash._basepullall",
"version": "4.5.2", "version": "4.6.0",
"description": "The internal lodash function `baseClone` exported as a module.", "description": "The internal lodash function `basePullAll` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
"license": "MIT", "license": "MIT",

View File

@@ -1,18 +0,0 @@
# lodash._basepullallby v4.1.0
The internal [lodash](https://lodash.com/) function `basePullAllBy` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash._basepullallby
```
In Node.js:
```js
var basePullAllBy = require('lodash._basepullallby');
```
See the [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash._basepullallby) for more details.

View File

@@ -1,23 +1,47 @@
The MIT License (MIT) Copyright jQuery Foundation and other contributors <https://jquery.org/>
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Based on Underscore.js, copyright Jeremy Ashkenas,
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining a copy This software consists of voluntary contributions made by many
of this software and associated documentation files (the "Software"), to deal individuals. For exact contribution history, see the revision history
in the Software without restriction, including without limitation the rights available at https://github.com/lodash/lodash
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The following license applies to all parts of this software except as
copies or substantial portions of the Software. documented below:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ====
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE Permission is hereby granted, free of charge, to any person obtaining
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER a copy of this software and associated documentation files (the
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "Software"), to deal in the Software without restriction, including
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE without limitation the rights to use, copy, modify, merge, publish,
SOFTWARE. distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -1,4 +1,4 @@
# lodash._baseuniq v4.5.1 # lodash._baseuniq v4.6.0
The internal [lodash](https://lodash.com/) function `baseUniq` exported as a [Node.js](https://nodejs.org/) module. The internal [lodash](https://lodash.com/) function `baseUniq` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var baseUniq = require('lodash._baseuniq'); var baseUniq = require('lodash._baseuniq');
``` ```
See the [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash._baseuniq) for more details. See the [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash._baseuniq) for more details.

View File

@@ -1,13 +1,13 @@
/** /**
* lodash 4.5.1 (Custom Build) <https://lodash.com/> * lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/ */
var SetCache = require('lodash._setcache'), var createSet = require('lodash._createset'),
createSet = require('lodash._createset'); root = require('lodash._root');
/** Used as the size to enable large array optimizations. */ /** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200; var LARGE_ARRAY_SIZE = 200;
@@ -15,6 +15,19 @@ var LARGE_ARRAY_SIZE = 200;
/** Used to stand-in for `undefined` hash values. */ /** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__'; var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** /**
* A specialized version of `_.includes` for arrays without support for * A specialized version of `_.includes` for arrays without support for
* specifying an index to search from. * specifying an index to search from.
@@ -73,6 +86,18 @@ function baseIndexOf(array, value, fromIndex) {
return -1; return -1;
} }
/**
* 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);
}
/** /**
* Gets the index at which the first occurrence of `NaN` is found in `array`. * Gets the index at which the first occurrence of `NaN` is found in `array`.
* *
@@ -96,11 +121,30 @@ function indexOfNaN(array, fromIndex, fromRight) {
} }
/** /**
* Converts `set` to an array. * Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `set` to an array of its values.
* *
* @private * @private
* @param {Object} set The set to convert. * @param {Object} set The set to convert.
* @returns {Array} Returns the converted array. * @returns {Array} Returns the values.
*/ */
function setToArray(set) { function setToArray(set) {
var index = -1, var index = -1,
@@ -112,23 +156,406 @@ function setToArray(set) {
return result; return result;
} }
/** Used for built-in method references. */
var arrayProto = Array.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Checks if `value` is in `cache`. * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
/**
* Creates a hash object.
* *
* @private * @private
* @param {Object} cache The set cache to search. * @constructor
* @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.
*
* @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(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @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(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @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 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;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(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 map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
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 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 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 mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for. * @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`. * @returns {number} Returns `true` if `value` is found, else `false`.
*/ */
function cacheHas(cache, value) { function setCacheHas(value) {
var map = cache.__data__; return this.__data__.has(value);
if (isKeyable(value)) { }
var data = map.__data__,
hash = typeof value == 'string' ? data.string : data.hash;
return hash[value] === HASH_UNDEFINED; // Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/**
* 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 map.has(value); return -1;
} }
/** /**
@@ -169,6 +596,7 @@ function baseUniq(array, iteratee, comparator) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var seenIndex = seen.length; var seenIndex = seen.length;
while (seenIndex--) { while (seenIndex--) {
@@ -191,6 +619,34 @@ function baseUniq(array, iteratee, comparator) {
return result; return result;
} }
/**
* 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 native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object[key];
return isNative(value) ? value : undefined;
}
/** /**
* Checks if `value` is suitable for use as unique object key. * Checks if `value` is suitable for use as unique object key.
* *
@@ -200,8 +656,146 @@ function baseUniq(array, iteratee, comparator) {
*/ */
function isKeyable(value) { function isKeyable(value) {
var type = typeof value; var type = typeof value;
return type == 'number' || type == 'boolean' || return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
(type == 'string' && value != '__proto__') || value == null; ? (value !== '__proto__')
: (value === null);
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'user': 'fred' };
* var other = { 'user': 'fred' };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (!isObject(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
} }
module.exports = baseUniq; module.exports = baseUniq;

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash._baseuniq", "name": "lodash._baseuniq",
"version": "4.5.1", "version": "4.6.0",
"description": "The internal lodash function `baseUniq` exported as a module.", "description": "The internal lodash function `baseUniq` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -15,6 +15,6 @@
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
"dependencies": { "dependencies": {
"lodash._createset": "~4.0.0", "lodash._createset": "~4.0.0",
"lodash._setcache": "~4.1.0" "lodash._root": "~3.0.0"
} }
} }

View File

@@ -1,4 +1,4 @@
# lodash.at v4.5.1 # lodash.at v4.6.0
The [lodash](https://lodash.com/) method `_.at` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.at` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var at = require('lodash.at'); var at = require('lodash.at');
``` ```
See the [documentation](https://lodash.com/docs#at) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.at) for more details. See the [documentation](https://lodash.com/docs#at) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.at) for more details.

View File

@@ -31,7 +31,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -89,19 +89,6 @@ function arrayPush(array, values) {
return array; return array;
} }
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/** /**
* Gets the value at `key` of `object`. * Gets the value at `key` of `object`.
* *
@@ -135,6 +122,7 @@ function isHostObject(value) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -147,14 +135,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -490,7 +478,7 @@ MapCache.prototype.set = mapCacheSet;
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -654,19 +642,6 @@ function castPath(value) {
return isArray(value) ? value : stringToPath(value); return isArray(value) ? value : stringToPath(value);
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -817,7 +792,7 @@ function toSource(func) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -876,7 +851,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -929,7 +904,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -985,7 +960,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1036,8 +1011,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1045,16 +1019,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1076,7 +1049,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.at", "name": "lodash.at",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.at` exported as a module.", "description": "The lodash method `_.at` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.countby v4.5.1 # lodash.countby v4.6.0
The [lodash](https://lodash.com/) method `_.countBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.countBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var countBy = require('lodash.countby'); var countBy = require('lodash.countby');
``` ```
See the [documentation](https://lodash.com/docs#countBy) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.countby) for more details. See the [documentation](https://lodash.com/docs#countBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.countby) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -259,7 +259,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -291,6 +291,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -303,14 +304,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -328,8 +329,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -797,11 +797,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -899,23 +926,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1118,14 +1128,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1401,7 +1421,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1463,7 +1483,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1514,19 +1534,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1575,15 +1582,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1594,7 +1592,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1646,24 +1644,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1863,7 +1844,7 @@ var countBy = createAggregator(function(result, value, key) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1922,7 +1903,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1975,7 +1956,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2031,7 +2012,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2082,8 +2063,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2091,16 +2071,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2122,7 +2101,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2178,28 +2157,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2330,7 +2287,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2355,23 +2312,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.countby", "name": "lodash.countby",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.countBy` exported as a module.", "description": "The lodash method `_.countBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.defaultsdeep v4.5.1 # lodash.defaultsdeep v4.6.0
The [lodash](https://lodash.com/) method `_.defaultsDeep` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.defaultsDeep` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var defaultsDeep = require('lodash.defaultsdeep'); var defaultsDeep = require('lodash.defaultsdeep');
``` ```
See the [documentation](https://lodash.com/docs#defaultsDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.defaultsdeep) for more details. See the [documentation](https://lodash.com/docs#defaultsDeep) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.defaultsdeep) for more details.

View File

@@ -48,7 +48,7 @@ var arrayBufferTag = '[object ArrayBuffer]',
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -237,19 +237,6 @@ function arrayReduce(array, iteratee, accumulator, initAccum) {
return accumulator; return accumulator;
} }
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/** /**
* The base implementation of `_.times` without support for iteratee shorthands * The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks. * or max array length checks.
@@ -313,23 +300,6 @@ function isHostObject(value) {
return result; return result;
} }
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/** /**
* Converts `map` to its key-value pairs. * Converts `map` to its key-value pairs.
* *
@@ -348,7 +318,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -380,6 +350,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -392,7 +363,7 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
@@ -402,7 +373,7 @@ var objectCtorString = funcToString.call(Object);
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -415,19 +386,17 @@ var reIsNative = RegExp('^' +
/** Built-in value references. */ /** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined, var Buffer = moduleExports ? root.Buffer : undefined,
Reflect = root.Reflect,
Symbol = root.Symbol, Symbol = root.Symbol,
Uint8Array = root.Uint8Array, Uint8Array = root.Uint8Array,
enumerate = Reflect ? Reflect.enumerate : undefined, getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create, objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable, propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeGetSymbols = Object.getOwnPropertySymbols,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeKeys = Object.keys, nativeKeys = overArg(Object.keys, Object),
nativeMax = Math.max; nativeMax = Math.max;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
@@ -845,6 +814,33 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* This function is like `assignValue` except that it doesn't assign * This function is like `assignValue` except that it doesn't assign
* `undefined` values. * `undefined` values.
@@ -863,7 +859,7 @@ function assignMergeValue(object, key, value) {
/** /**
* Assigns `value` to `key` of `object` if the existing value is not equivalent * Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *
* @private * @private
@@ -883,7 +879,7 @@ function assignValue(object, key, value) {
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -1024,23 +1020,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.isNative` without bad shim checks. * The base implementation of `_.isNative` without bad shim checks.
* *
@@ -1070,40 +1049,47 @@ function baseIsTypedArray(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.keysIn` which doesn't skip the constructor * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
function baseKeysIn(object) { function baseKeysIn(object) {
object = object == null ? object : Object(object); if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
var result = [];
for (var key in object) { for (var key in object) {
result.push(key); if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
} }
return result; return result;
} }
// Fallback for IE < 9 with es6-shim.
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
baseKeysIn = function(object) {
return iteratorToArray(enumerate(object));
};
}
/** /**
* The base implementation of `_.merge` without support for multiple sources. * The base implementation of `_.merge` without support for multiple sources.
* *
@@ -1120,7 +1106,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
return; return;
} }
if (!(isArray(source) || isTypedArray(source))) { if (!(isArray(source) || isTypedArray(source))) {
var props = keysIn(source); var props = baseKeysIn(source);
} }
arrayEach(props || source, function(srcValue, key) { arrayEach(props || source, function(srcValue, key) {
if (props) { if (props) {
@@ -1453,19 +1439,6 @@ function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols); return baseGetAllKeys(object, keys, getSymbols);
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1494,15 +1467,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Creates an array of the own enumerable symbol properties of `object`. * Creates an array of the own enumerable symbol properties of `object`.
* *
@@ -1522,7 +1486,7 @@ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArra
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1627,23 +1591,6 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) {
} }
} }
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
/** /**
* Checks if `value` is a valid array-like index. * Checks if `value` is a valid array-like index.
* *
@@ -1745,6 +1692,25 @@ function mergeDefaults(objValue, srcValue, key, object, source, stack) {
return objValue; return objValue;
} }
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/** /**
* Converts `func` to its source code. * Converts `func` to its source code.
* *
@@ -1766,7 +1732,7 @@ function toSource(func) {
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1819,7 +1785,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1875,7 +1841,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1945,8 +1911,7 @@ var isBuffer = nativeIsBuffer || stubFalse;
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1954,16 +1919,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1985,7 +1949,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2050,8 +2014,7 @@ function isObjectLike(value) {
* @since 0.8.0 * @since 0.8.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* else `false`.
* @example * @example
* *
* function Foo() { * function Foo() {
@@ -2084,28 +2047,6 @@ function isPlainObject(value) {
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a typed array. * Checks if `value` is classified as a typed array.
* *
@@ -2181,7 +2122,7 @@ var defaultsDeep = baseRest(function(args) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2206,23 +2147,7 @@ var defaultsDeep = baseRest(function(args) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**
@@ -2249,23 +2174,7 @@ function keys(object) {
* // => ['a', 'b', 'c'] (iteration order is not guaranteed) * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/ */
function keysIn(object) { function keysIn(object) {
var index = -1, return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
isProto = isPrototype(object),
props = baseKeysIn(object),
propsLength = props.length,
indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
while (++index < propsLength) {
var key = props[index];
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.defaultsdeep", "name": "lodash.defaultsdeep",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.defaultsDeep` exported as a module.", "description": "The lodash method `_.defaultsDeep` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.differenceby v4.5.0 # lodash.differenceby v4.6.0
The [lodash](https://lodash.com/) method `_.differenceBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.differenceBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var differenceBy = require('lodash.differenceby'); var differenceBy = require('lodash.differenceby');
``` ```
See the [documentation](https://lodash.com/docs#differenceBy) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.differenceby) for more details. See the [documentation](https://lodash.com/docs#differenceBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.differenceby) for more details.

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.differenceby", "name": "lodash.differenceby",
"version": "4.5.0", "version": "4.6.0",
"description": "The lodash method `_.differenceBy` exported as a module.", "description": "The lodash method `_.differenceBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -17,7 +17,7 @@
"dependencies": { "dependencies": {
"lodash._basedifference": "~4.5.0", "lodash._basedifference": "~4.5.0",
"lodash._baseflatten": "~4.2.0", "lodash._baseflatten": "~4.2.0",
"lodash._baseiteratee": "~4.6.0", "lodash._baseiteratee": "~4.7.0",
"lodash.rest": "^4.0.0" "lodash.rest": "^4.0.0"
} }
} }

View File

@@ -1,4 +1,4 @@
# lodash.droprightwhile v4.5.1 # lodash.droprightwhile v4.6.0
The [lodash](https://lodash.com/) method `_.dropRightWhile` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.dropRightWhile` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var dropRightWhile = require('lodash.droprightwhile'); var dropRightWhile = require('lodash.droprightwhile');
``` ```
See the [documentation](https://lodash.com/docs#dropRightWhile) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.droprightwhile) for more details. See the [documentation](https://lodash.com/docs#dropRightWhile) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.droprightwhile) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -238,7 +238,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -270,6 +270,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -282,14 +283,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -307,8 +308,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -776,11 +776,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -825,23 +852,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1044,14 +1054,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1310,7 +1330,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1372,7 +1392,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1423,19 +1443,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1484,15 +1491,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1503,7 +1501,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1555,24 +1553,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1786,7 +1767,7 @@ function dropRightWhile(array, predicate) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1845,7 +1826,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1898,7 +1879,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1954,7 +1935,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2005,8 +1986,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2014,16 +1994,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2045,7 +2024,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2101,28 +2080,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2253,7 +2210,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2278,23 +2235,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.droprightwhile", "name": "lodash.droprightwhile",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.dropRightWhile` exported as a module.", "description": "The lodash method `_.dropRightWhile` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.dropwhile v4.5.1 # lodash.dropwhile v4.6.0
The [lodash](https://lodash.com/) method `_.dropWhile` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.dropWhile` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var dropWhile = require('lodash.dropwhile'); var dropWhile = require('lodash.dropwhile');
``` ```
See the [documentation](https://lodash.com/docs#dropWhile) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.dropwhile) for more details. See the [documentation](https://lodash.com/docs#dropWhile) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.dropwhile) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -238,7 +238,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -270,6 +270,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -282,14 +283,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -307,8 +308,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -776,11 +776,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -825,23 +852,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1044,14 +1054,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1310,7 +1330,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1372,7 +1392,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1423,19 +1443,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1484,15 +1491,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1503,7 +1501,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1555,24 +1553,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1787,7 +1768,7 @@ function dropWhile(array, predicate) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1846,7 +1827,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1899,7 +1880,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1955,7 +1936,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2006,8 +1987,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2015,16 +1995,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2046,7 +2025,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2102,28 +2081,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2254,7 +2211,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2279,23 +2236,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.dropwhile", "name": "lodash.dropwhile",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.dropWhile` exported as a module.", "description": "The lodash method `_.dropWhile` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.every v4.5.1 # lodash.every v4.6.0
The [lodash](https://lodash.com/) method `_.every` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.every` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var every = require('lodash.every'); var every = require('lodash.every');
``` ```
See the [documentation](https://lodash.com/docs#every) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.every) for more details. See the [documentation](https://lodash.com/docs#every) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.every) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -260,7 +260,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -292,6 +292,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -304,14 +305,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -329,8 +330,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -798,11 +798,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -900,23 +927,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1119,14 +1129,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1385,7 +1405,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1447,7 +1467,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1498,19 +1518,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1559,15 +1566,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1578,7 +1576,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1630,24 +1628,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1839,6 +1820,11 @@ function toSource(func) {
* Iteration is stopped once `predicate` returns falsey. The predicate is * Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection). * invoked with three arguments: (value, index|key, collection).
* *
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0 * @since 0.1.0
@@ -1889,7 +1875,7 @@ function every(collection, predicate, guard) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1948,7 +1934,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -2001,7 +1987,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2057,7 +2043,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2108,8 +2094,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2117,16 +2102,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2148,7 +2132,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2204,28 +2188,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2356,7 +2318,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2381,23 +2343,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.every", "name": "lodash.every",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.every` exported as a module.", "description": "The lodash method `_.every` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.filter v4.5.1 # lodash.filter v4.6.0
The [lodash](https://lodash.com/) method `_.filter` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.filter` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var filter = require('lodash.filter'); var filter = require('lodash.filter');
``` ```
See the [documentation](https://lodash.com/docs#filter) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.filter) for more details. See the [documentation](https://lodash.com/docs#filter) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.filter) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -262,7 +262,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -294,6 +294,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -306,14 +307,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -331,8 +332,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -800,11 +800,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -902,23 +929,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1121,14 +1131,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1387,7 +1407,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1449,7 +1469,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1500,19 +1520,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1561,15 +1568,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1580,7 +1578,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1632,24 +1630,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1865,7 +1846,7 @@ function filter(collection, predicate) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1924,7 +1905,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1977,7 +1958,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2033,7 +2014,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2084,8 +2065,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2093,16 +2073,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2124,7 +2103,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2180,28 +2159,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2332,7 +2289,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2357,23 +2314,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.filter", "name": "lodash.filter",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.filter` exported as a module.", "description": "The lodash method `_.filter` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.find v4.5.1 # lodash.find v4.6.0
The [lodash](https://lodash.com/) method `_.find` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.find` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var find = require('lodash.find'); var find = require('lodash.find');
``` ```
See the [documentation](https://lodash.com/docs#find) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.find) for more details. See the [documentation](https://lodash.com/docs#find) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.find) for more details.

View File

@@ -64,7 +64,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -166,7 +166,7 @@ function arraySome(array, predicate) {
* support for iteratee shorthands. * support for iteratee shorthands.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from. * @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left. * @param {boolean} [fromRight] Specify iterating from right to left.
@@ -278,7 +278,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -310,6 +310,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -322,14 +323,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -347,8 +348,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object),
nativeKeys = Object.keys,
nativeMax = Math.max; nativeMax = Math.max;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
@@ -817,11 +817,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -866,23 +893,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1085,14 +1095,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1318,7 +1338,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1380,7 +1400,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1431,19 +1451,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1492,15 +1499,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1511,7 +1509,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1563,24 +1561,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1751,7 +1732,7 @@ function toSource(func) {
* @memberOf _ * @memberOf _
* @since 1.1.0 * @since 1.1.0
* @category Array * @category Array
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from. * @param {number} [fromIndex=0] The index to search from.
@@ -1800,7 +1781,7 @@ function findIndex(array, predicate, fromIndex) {
* @memberOf _ * @memberOf _
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to search. * @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from. * @param {number} [fromIndex=0] The index to search from.
@@ -1840,7 +1821,7 @@ var find = createFind(findIndex);
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1899,7 +1880,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1952,7 +1933,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2008,7 +1989,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2059,8 +2040,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2068,16 +2048,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2099,7 +2078,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2155,28 +2134,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2257,7 +2214,7 @@ function toFinite(value) {
* Converts `value` to an integer. * Converts `value` to an integer.
* *
* **Note:** This method is loosely based on * **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -2317,7 +2274,7 @@ function toNumber(value) {
return NAN; return NAN;
} }
if (isObject(value)) { if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value; var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other; value = isObject(other) ? (other + '') : other;
} }
if (typeof value != 'string') { if (typeof value != 'string') {
@@ -2419,7 +2376,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2444,23 +2401,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.find", "name": "lodash.find",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.find` exported as a module.", "description": "The lodash method `_.find` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.findindex v4.5.1 # lodash.findindex v4.6.0
The [lodash](https://lodash.com/) method `_.findIndex` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.findIndex` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var findIndex = require('lodash.findindex'); var findIndex = require('lodash.findindex');
``` ```
See the [documentation](https://lodash.com/docs#findIndex) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.findindex) for more details. See the [documentation](https://lodash.com/docs#findIndex) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.findindex) for more details.

View File

@@ -64,7 +64,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -166,7 +166,7 @@ function arraySome(array, predicate) {
* support for iteratee shorthands. * support for iteratee shorthands.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from. * @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left. * @param {boolean} [fromRight] Specify iterating from right to left.
@@ -278,7 +278,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -310,6 +310,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -322,14 +323,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -347,8 +348,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object),
nativeKeys = Object.keys,
nativeMax = Math.max; nativeMax = Math.max;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
@@ -817,11 +817,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -866,23 +893,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1085,14 +1095,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1298,7 +1318,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1360,7 +1380,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1411,19 +1431,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1472,15 +1479,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1491,7 +1489,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1543,24 +1541,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1731,7 +1712,7 @@ function toSource(func) {
* @memberOf _ * @memberOf _
* @since 1.1.0 * @since 1.1.0
* @category Array * @category Array
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from. * @param {number} [fromIndex=0] The index to search from.
@@ -1781,7 +1762,7 @@ function findIndex(array, predicate, fromIndex) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1840,7 +1821,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1893,7 +1874,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1949,7 +1930,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2000,8 +1981,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2009,16 +1989,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2040,7 +2019,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2096,28 +2075,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2198,7 +2155,7 @@ function toFinite(value) {
* Converts `value` to an integer. * Converts `value` to an integer.
* *
* **Note:** This method is loosely based on * **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -2258,7 +2215,7 @@ function toNumber(value) {
return NAN; return NAN;
} }
if (isObject(value)) { if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value; var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other; value = isObject(other) ? (other + '') : other;
} }
if (typeof value != 'string') { if (typeof value != 'string') {
@@ -2360,7 +2317,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2385,23 +2342,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.findindex", "name": "lodash.findindex",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.findIndex` exported as a module.", "description": "The lodash method `_.findIndex` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.findkey v4.5.1 # lodash.findkey v4.6.0
The [lodash](https://lodash.com/) method `_.findKey` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.findKey` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var findKey = require('lodash.findkey'); var findKey = require('lodash.findkey');
``` ```
See the [documentation](https://lodash.com/docs#findKey) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.findkey) for more details. See the [documentation](https://lodash.com/docs#findKey) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.findkey) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -150,7 +150,7 @@ function arraySome(array, predicate) {
* using `eachFunc`. * using `eachFunc`.
* *
* @private * @private
* @param {Array|Object} collection The collection to search. * @param {Array|Object} collection The collection to inspect.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`. * @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the found element or its key, else `undefined`. * @returns {*} Returns the found element or its key, else `undefined`.
@@ -260,7 +260,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -292,6 +292,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -304,14 +305,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -329,8 +330,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -798,11 +798,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -872,23 +899,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1091,14 +1101,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1328,7 +1348,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1390,7 +1410,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1441,19 +1461,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1502,15 +1509,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1521,7 +1519,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1573,24 +1571,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1763,7 +1744,7 @@ function toSource(func) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1822,7 +1803,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1875,7 +1856,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1931,7 +1912,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1982,8 +1963,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1991,16 +1971,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2022,7 +2001,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2078,28 +2057,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2174,7 +2131,7 @@ function toString(value) {
* @memberOf _ * @memberOf _
* @since 1.1.0 * @since 1.1.0
* @category Object * @category Object
* @param {Object} object The object to search. * @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element, * @returns {string|undefined} Returns the key of the matched element,
* else `undefined`. * else `undefined`.
@@ -2269,7 +2226,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2294,23 +2251,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.findkey", "name": "lodash.findkey",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.findKey` exported as a module.", "description": "The lodash method `_.findKey` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.findlast v4.5.1 # lodash.findlast v4.6.0
The [lodash](https://lodash.com/) method `_.findLast` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.findLast` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var findLast = require('lodash.findlast'); var findLast = require('lodash.findlast');
``` ```
See the [documentation](https://lodash.com/docs#findLast) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.findlast) for more details. See the [documentation](https://lodash.com/docs#findLast) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.findlast) for more details.

View File

@@ -64,7 +64,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -166,7 +166,7 @@ function arraySome(array, predicate) {
* support for iteratee shorthands. * support for iteratee shorthands.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from. * @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left. * @param {boolean} [fromRight] Specify iterating from right to left.
@@ -278,7 +278,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -310,6 +310,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -322,14 +323,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -347,8 +348,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object),
nativeKeys = Object.keys,
nativeMax = Math.max, nativeMax = Math.max,
nativeMin = Math.min; nativeMin = Math.min;
@@ -818,11 +818,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -867,23 +894,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1086,14 +1096,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1319,7 +1339,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1381,7 +1401,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1432,19 +1452,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1493,15 +1500,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1512,7 +1510,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1564,24 +1562,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1752,7 +1733,7 @@ function toSource(func) {
* @memberOf _ * @memberOf _
* @since 2.0.0 * @since 2.0.0
* @category Array * @category Array
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=array.length-1] The index to search from. * @param {number} [fromIndex=array.length-1] The index to search from.
@@ -1803,7 +1784,7 @@ function findLastIndex(array, predicate, fromIndex) {
* @memberOf _ * @memberOf _
* @since 2.0.0 * @since 2.0.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to search. * @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] The index to search from. * @param {number} [fromIndex=collection.length-1] The index to search from.
@@ -1827,7 +1808,7 @@ var findLast = createFind(findLastIndex);
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1886,7 +1867,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1939,7 +1920,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1995,7 +1976,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2046,8 +2027,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2055,16 +2035,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2086,7 +2065,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2142,28 +2121,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2244,7 +2201,7 @@ function toFinite(value) {
* Converts `value` to an integer. * Converts `value` to an integer.
* *
* **Note:** This method is loosely based on * **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -2304,7 +2261,7 @@ function toNumber(value) {
return NAN; return NAN;
} }
if (isObject(value)) { if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value; var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other; value = isObject(other) ? (other + '') : other;
} }
if (typeof value != 'string') { if (typeof value != 'string') {
@@ -2406,7 +2363,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2431,23 +2388,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.findlast", "name": "lodash.findlast",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.findLast` exported as a module.", "description": "The lodash method `_.findLast` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.findlastindex v4.5.1 # lodash.findlastindex v4.6.0
The [lodash](https://lodash.com/) method `_.findLastIndex` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.findLastIndex` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var findLastIndex = require('lodash.findlastindex'); var findLastIndex = require('lodash.findlastindex');
``` ```
See the [documentation](https://lodash.com/docs#findLastIndex) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.findlastindex) for more details. See the [documentation](https://lodash.com/docs#findLastIndex) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.findlastindex) for more details.

View File

@@ -64,7 +64,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -166,7 +166,7 @@ function arraySome(array, predicate) {
* support for iteratee shorthands. * support for iteratee shorthands.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from. * @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left. * @param {boolean} [fromRight] Specify iterating from right to left.
@@ -278,7 +278,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -310,6 +310,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -322,14 +323,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -347,8 +348,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object),
nativeKeys = Object.keys,
nativeMax = Math.max, nativeMax = Math.max,
nativeMin = Math.min; nativeMin = Math.min;
@@ -818,11 +818,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -867,23 +894,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1086,14 +1096,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1299,7 +1319,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1361,7 +1381,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1412,19 +1432,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1473,15 +1480,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1492,7 +1490,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1544,24 +1542,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1732,7 +1713,7 @@ function toSource(func) {
* @memberOf _ * @memberOf _
* @since 2.0.0 * @since 2.0.0
* @category Array * @category Array
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=array.length-1] The index to search from. * @param {number} [fromIndex=array.length-1] The index to search from.
@@ -1785,7 +1766,7 @@ function findLastIndex(array, predicate, fromIndex) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1844,7 +1825,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1897,7 +1878,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1953,7 +1934,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2004,8 +1985,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2013,16 +1993,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2044,7 +2023,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2100,28 +2079,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2202,7 +2159,7 @@ function toFinite(value) {
* Converts `value` to an integer. * Converts `value` to an integer.
* *
* **Note:** This method is loosely based on * **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -2262,7 +2219,7 @@ function toNumber(value) {
return NAN; return NAN;
} }
if (isObject(value)) { if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value; var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other; value = isObject(other) ? (other + '') : other;
} }
if (typeof value != 'string') { if (typeof value != 'string') {
@@ -2364,7 +2321,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2389,23 +2346,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.findlastindex", "name": "lodash.findlastindex",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.findLastIndex` exported as a module.", "description": "The lodash method `_.findLastIndex` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.findlastkey v4.5.0 # lodash.findlastkey v4.6.0
The [lodash](https://lodash.com/) method `_.findLastKey` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.findLastKey` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var findLastKey = require('lodash.findlastkey'); var findLastKey = require('lodash.findlastkey');
``` ```
See the [documentation](https://lodash.com/docs#findLastKey) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.findlastkey) for more details. See the [documentation](https://lodash.com/docs#findLastKey) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.findlastkey) for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.findlastkey", "name": "lodash.findlastkey",
"version": "4.5.0", "version": "4.6.0",
"description": "The lodash method `_.findLastKey` exported as a module.", "description": "The lodash method `_.findLastKey` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -13,11 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"dependencies": {
"lodash._basefind": "~3.0.0",
"lodash._baseforright": "~4.0.0",
"lodash._baseiteratee": "~4.7.0",
"lodash.keys": "^4.0.0"
}
} }

View File

@@ -1,4 +1,4 @@
# lodash.flattendepth v4.5.1 # lodash.flattendepth v4.6.0
The [lodash](https://lodash.com/) method `_.flattenDepth` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.flattenDepth` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var flattenDepth = require('lodash.flattendepth'); var flattenDepth = require('lodash.flattendepth');
``` ```
See the [documentation](https://lodash.com/docs#flattenDepth) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.flattendepth) for more details. See the [documentation](https://lodash.com/docs#flattenDepth) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.flattendepth) for more details.

View File

@@ -6,15 +6,16 @@
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/ */
var baseFlatten = require('lodash._baseflatten');
/** Used as references for various `Number` constants. */ /** Used as references for various `Number` constants. */
var INFINITY = 1 / 0, var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991,
MAX_INTEGER = 1.7976931348623157e+308, MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0; NAN = 0 / 0;
/** `Object#toString` result references. */ /** `Object#toString` result references. */
var funcTag = '[object Function]', var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]', genTag = '[object GeneratorFunction]',
symbolTag = '[object Symbol]'; symbolTag = '[object Symbol]';
@@ -33,9 +34,53 @@ var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */ /** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt; var freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
@@ -43,6 +88,70 @@ var objectProto = Object.prototype;
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
/** Built-in value references. */
var Symbol = root.Symbol,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
/** /**
* Recursively flatten `array` up to `depth` times. * Recursively flatten `array` up to `depth` times.
* *
@@ -72,6 +181,113 @@ function flattenDepth(array, depth) {
return baseFlatten(array, depth); return baseFlatten(array, depth);
} }
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* 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
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/** /**
* Checks if `value` is classified as a `Function` object. * Checks if `value` is classified as a `Function` object.
* *
@@ -80,8 +296,7 @@ function flattenDepth(array, depth) {
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a function, else `false`.
* else `false`.
* @example * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -98,6 +313,38 @@ function isFunction(value) {
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length,
* else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
@@ -164,8 +411,7 @@ function isObjectLike(value) {
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* else `false`.
* @example * @example
* *
* _.isSymbol(Symbol.iterator); * _.isSymbol(Symbol.iterator);
@@ -217,7 +463,7 @@ function toFinite(value) {
/** /**
* Converts `value` to an integer. * Converts `value` to an integer.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
* *
* @static * @static

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.flattendepth", "name": "lodash.flattendepth",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.flattenDepth` exported as a module.", "description": "The lodash method `_.flattenDepth` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -13,8 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"dependencies": {
"lodash._baseflatten": "~4.2.0"
}
} }

View File

@@ -1,4 +1,4 @@
# lodash.groupby v4.5.1 # lodash.groupby v4.6.0
The [lodash](https://lodash.com/) method `_.groupBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.groupBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var groupBy = require('lodash.groupby'); var groupBy = require('lodash.groupby');
``` ```
See the [documentation](https://lodash.com/docs#groupBy) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.groupby) for more details. See the [documentation](https://lodash.com/docs#groupBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.groupby) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -259,7 +259,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -291,6 +291,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -303,14 +304,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -328,8 +329,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -797,11 +797,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -899,23 +926,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1118,14 +1128,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1401,7 +1421,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1463,7 +1483,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1514,19 +1534,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1575,15 +1582,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1594,7 +1592,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1646,24 +1644,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1868,7 +1849,7 @@ var groupBy = createAggregator(function(result, value, key) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1927,7 +1908,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1980,7 +1961,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2036,7 +2017,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2087,8 +2068,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2096,16 +2076,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2127,7 +2106,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2183,28 +2162,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2335,7 +2292,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2360,23 +2317,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.groupby", "name": "lodash.groupby",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.groupBy` exported as a module.", "description": "The lodash method `_.groupBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.intersectionby v4.5.0 # lodash.intersectionby v4.6.0
The [lodash](https://lodash.com/) method `_.intersectionBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.intersectionBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var intersectionBy = require('lodash.intersectionby'); var intersectionBy = require('lodash.intersectionby');
``` ```
See the [documentation](https://lodash.com/docs#intersectionBy) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.intersectionby) for more details. See the [documentation](https://lodash.com/docs#intersectionBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.intersectionby) for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.intersectionby", "name": "lodash.intersectionby",
"version": "4.5.0", "version": "4.6.0",
"description": "The lodash method `_.intersectionBy` exported as a module.", "description": "The lodash method `_.intersectionBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -13,10 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"dependencies": {
"lodash._baseintersection": "~4.5.0",
"lodash._baseiteratee": "~4.7.0",
"lodash.rest": "^4.0.0"
}
} }

View File

@@ -1,4 +1,4 @@
# lodash.invertby v4.5.0 # lodash.invertby v4.6.0
The [lodash](https://lodash.com/) method `_.invertBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.invertBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var invertBy = require('lodash.invertby'); var invertBy = require('lodash.invertby');
``` ```
See the [documentation](https://lodash.com/docs#invertBy) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.invertby) for more details. See the [documentation](https://lodash.com/docs#invertBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.invertby) for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.invertby", "name": "lodash.invertby",
"version": "4.5.0", "version": "4.6.0",
"description": "The lodash method `_.invertBy` exported as a module.", "description": "The lodash method `_.invertBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -13,10 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"dependencies": {
"lodash._basefor": "~3.0.0",
"lodash._baseiteratee": "~4.7.0",
"lodash.keys": "^4.0.0"
}
} }

View File

@@ -1,4 +1,4 @@
# lodash.invokemap v4.5.1 # lodash.invokemap v4.6.0
The [lodash](https://lodash.com/) method `_.invokeMap` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.invokeMap` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var invokeMap = require('lodash.invokemap'); var invokeMap = require('lodash.invokemap');
``` ```
See the [documentation](https://lodash.com/docs#invokeMap) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.invokemap) for more details. See the [documentation](https://lodash.com/docs#invokeMap) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.invokemap) for more details.

View File

@@ -21,7 +21,6 @@ var INFINITY = 1 / 0,
var argsTag = '[object Arguments]', var argsTag = '[object Arguments]',
funcTag = '[object Function]', funcTag = '[object Function]',
genTag = '[object GeneratorFunction]', genTag = '[object GeneratorFunction]',
stringTag = '[object String]',
symbolTag = '[object Symbol]'; symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */ /** Used to match property names within property paths. */
@@ -32,7 +31,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -74,19 +73,6 @@ function apply(func, thisArg, args) {
return func.apply(thisArg, args); return func.apply(thisArg, args);
} }
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/** /**
* The base implementation of `_.times` without support for iteratee shorthands * The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks. * or max array length checks.
@@ -138,7 +124,7 @@ function isHostObject(value) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -153,6 +139,7 @@ function overArg(func, transform) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -165,14 +152,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -189,8 +176,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object),
nativeKeys = Object.keys,
nativeMax = Math.max; nativeMax = Math.max;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
@@ -505,11 +491,38 @@ MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas; MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet; MapCache.prototype.set = mapCacheSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -578,23 +591,6 @@ function baseGet(object, path) {
return (index && index == length) ? object : undefined; return (index && index == length) ? object : undefined;
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.invoke` without support for individual * The base implementation of `_.invoke` without support for individual
* method arguments. * method arguments.
@@ -632,14 +628,24 @@ function baseIsNative(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.rest` which doesn't validate or coerce arguments. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
@@ -784,19 +790,6 @@ function createBaseFor(fromRight) {
}; };
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -825,32 +818,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
/** /**
* Checks if `value` is a valid array-like index. * Checks if `value` is a valid array-like index.
* *
@@ -1057,7 +1024,7 @@ var invokeMap = baseRest(function(collection, path, args) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1116,7 +1083,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1169,7 +1136,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1225,7 +1192,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1276,8 +1243,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1285,16 +1251,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1316,7 +1281,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -1372,28 +1337,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -1445,7 +1388,7 @@ function toString(value) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -1470,23 +1413,7 @@ function toString(value) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
module.exports = invokeMap; module.exports = invokeMap;

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.invokemap", "name": "lodash.invokemap",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.invokeMap` exported as a module.", "description": "The lodash method `_.invokeMap` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.iteratee v4.5.0 # lodash.iteratee v4.6.0
The [lodash](https://lodash.com/) method `_.iteratee` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.iteratee` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var iteratee = require('lodash.iteratee'); var iteratee = require('lodash.iteratee');
``` ```
See the [documentation](https://lodash.com/docs#iteratee) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.iteratee) for more details. See the [documentation](https://lodash.com/docs#iteratee) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.iteratee) for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.iteratee", "name": "lodash.iteratee",
"version": "4.5.0", "version": "4.6.0",
"description": "The lodash method `_.iteratee` exported as a module.", "description": "The lodash method `_.iteratee` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -13,9 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"dependencies": {
"lodash._baseclone": "~4.5.0",
"lodash._baseiteratee": "~4.7.0"
}
} }

View File

@@ -1,4 +1,4 @@
# lodash.keyby v4.5.1 # lodash.keyby v4.6.0
The [lodash](https://lodash.com/) method `_.keyBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.keyBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var keyBy = require('lodash.keyby'); var keyBy = require('lodash.keyby');
``` ```
See the [documentation](https://lodash.com/docs#keyBy) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.keyby) for more details. See the [documentation](https://lodash.com/docs#keyBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.keyby) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -259,7 +259,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -291,6 +291,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -303,14 +304,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -328,8 +329,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -797,11 +797,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -899,23 +926,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1118,14 +1128,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1401,7 +1421,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1463,7 +1483,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1514,19 +1534,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1575,15 +1582,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1594,7 +1592,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1646,24 +1644,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1869,7 +1850,7 @@ var keyBy = createAggregator(function(result, value, key) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1928,7 +1909,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1981,7 +1962,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2037,7 +2018,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2088,8 +2069,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2097,16 +2077,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2128,7 +2107,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2184,28 +2163,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2336,7 +2293,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2361,23 +2318,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.keyby", "name": "lodash.keyby",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.keyBy` exported as a module.", "description": "The lodash method `_.keyBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.map v4.5.1 # lodash.map v4.6.0
The [lodash](https://lodash.com/) method `_.map` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.map` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var map = require('lodash.map'); var map = require('lodash.map');
``` ```
See the [documentation](https://lodash.com/docs#map) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.map) for more details. See the [documentation](https://lodash.com/docs#map) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.map) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -258,7 +258,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -290,6 +290,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -302,14 +303,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -327,8 +328,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -796,11 +796,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -880,23 +907,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1099,14 +1109,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.map` without support for iteratee shorthands. * The base implementation of `_.map` without support for iteratee shorthands.
@@ -1383,7 +1403,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1445,7 +1465,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1496,19 +1516,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1557,15 +1564,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1576,7 +1574,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1628,24 +1626,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1865,7 +1846,7 @@ function map(collection, iteratee) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1924,7 +1905,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1977,7 +1958,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2033,7 +2014,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2084,8 +2065,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2093,16 +2073,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2124,7 +2103,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2180,28 +2159,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2332,7 +2289,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2357,23 +2314,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.map", "name": "lodash.map",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.map` exported as a module.", "description": "The lodash method `_.map` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.mapkeys v4.5.1 # lodash.mapkeys v4.6.0
The [lodash](https://lodash.com/) method `_.mapKeys` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.mapKeys` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var mapKeys = require('lodash.mapkeys'); var mapKeys = require('lodash.mapkeys');
``` ```
See the [documentation](https://lodash.com/docs#mapKeys) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.mapkeys) for more details. See the [documentation](https://lodash.com/docs#mapKeys) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.mapkeys) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -238,7 +238,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -270,6 +270,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -282,14 +283,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -307,8 +308,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -776,11 +776,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -850,23 +877,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1069,14 +1079,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1306,7 +1326,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1368,7 +1388,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1419,19 +1439,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1480,15 +1487,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1499,7 +1497,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1551,24 +1549,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1741,7 +1722,7 @@ function toSource(func) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1800,7 +1781,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1853,7 +1834,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1909,7 +1890,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1960,8 +1941,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1969,16 +1949,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2000,7 +1979,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2056,28 +2035,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2208,7 +2165,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2233,23 +2190,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.mapkeys", "name": "lodash.mapkeys",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.mapKeys` exported as a module.", "description": "The lodash method `_.mapKeys` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.mapvalues v4.5.1 # lodash.mapvalues v4.6.0
The [lodash](https://lodash.com/) method `_.mapValues` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.mapValues` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var mapValues = require('lodash.mapvalues'); var mapValues = require('lodash.mapvalues');
``` ```
See the [documentation](https://lodash.com/docs#mapValues) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.mapvalues) for more details. See the [documentation](https://lodash.com/docs#mapValues) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.mapvalues) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -238,7 +238,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -270,6 +270,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -282,14 +283,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -307,8 +308,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -776,11 +776,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -850,23 +877,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1069,14 +1079,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1306,7 +1326,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1368,7 +1388,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1419,19 +1439,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1480,15 +1487,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1499,7 +1497,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1551,24 +1549,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1741,7 +1722,7 @@ function toSource(func) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1800,7 +1781,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1853,7 +1834,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1909,7 +1890,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1960,8 +1941,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1969,16 +1949,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2000,7 +1979,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2056,28 +2035,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2208,7 +2165,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2233,23 +2190,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.mapvalues", "name": "lodash.mapvalues",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.mapValues` exported as a module.", "description": "The lodash method `_.mapValues` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.matches v4.5.1 # lodash.matches v4.6.0
The [lodash](https://lodash.com/) method `_.matches` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.matches` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var matches = require('lodash.matches'); var matches = require('lodash.matches');
``` ```
See the [documentation](https://lodash.com/docs#matches) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.matches) for more details. See the [documentation](https://lodash.com/docs#matches) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.matches) for more details.

View File

@@ -52,7 +52,7 @@ var arrayBufferTag = '[object ArrayBuffer]',
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -243,19 +243,6 @@ function arraySome(array, predicate) {
return false; return false;
} }
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/** /**
* The base implementation of `_.times` without support for iteratee shorthands * The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks. * or max array length checks.
@@ -337,7 +324,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -369,6 +356,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -381,14 +369,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -403,15 +391,15 @@ var reIsNative = RegExp('^' +
var Buffer = moduleExports ? root.Buffer : undefined, var Buffer = moduleExports ? root.Buffer : undefined,
Symbol = root.Symbol, Symbol = root.Symbol,
Uint8Array = root.Uint8Array, Uint8Array = root.Uint8Array,
getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create, objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable, propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeGetSymbols = Object.getOwnPropertySymbols,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeKeys = Object.keys; nativeKeys = overArg(Object.keys, Object);
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -878,9 +866,36 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Assigns `value` to `key` of `object` if the existing value is not equivalent * Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *
* @private * @private
@@ -900,7 +915,7 @@ function assignValue(object, key, value) {
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -1041,23 +1056,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.isEqual` which supports partial comparisons * The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects. * and tracks traversed objects.
@@ -1224,14 +1222,24 @@ function baseIsTypedArray(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1540,7 +1548,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1602,7 +1610,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1664,19 +1672,6 @@ function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols); return baseGetAllKeys(object, keys, getSymbols);
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1725,15 +1720,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Creates an array of the own enumerable symbol properties of `object`. * Creates an array of the own enumerable symbol properties of `object`.
* *
@@ -1753,7 +1739,7 @@ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArra
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1858,23 +1844,6 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) {
} }
} }
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
/** /**
* Checks if `value` is a valid array-like index. * Checks if `value` is a valid array-like index.
* *
@@ -1981,7 +1950,7 @@ function toSource(func) {
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -2034,7 +2003,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -2090,7 +2059,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -2160,8 +2129,7 @@ var isBuffer = nativeIsBuffer || stubFalse;
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -2169,16 +2137,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -2200,7 +2167,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2256,28 +2223,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a typed array. * Checks if `value` is classified as a typed array.
* *
@@ -2301,7 +2246,7 @@ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedA
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2326,23 +2271,7 @@ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedA
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**
@@ -2350,8 +2279,12 @@ function keys(object) {
* object and `source`, returning `true` if the given object has equivalent * object and `source`, returning `true` if the given object has equivalent
* property values, else `false`. * property values, else `false`.
* *
* **Note:** The created function supports comparing the same values as * **Note:** The created function is equivalent to `_.isMatch` with `source`
* `_.isEqual` is equivalent to `_.isMatch` with `source` partially applied. * partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
* *
* @static * @static
* @memberOf _ * @memberOf _

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.matches", "name": "lodash.matches",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.matches` exported as a module.", "description": "The lodash method `_.matches` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.matchesproperty v4.5.0 # lodash.matchesproperty v4.6.0
The [lodash](https://lodash.com/) method `_.matchesProperty` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.matchesProperty` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var matchesProperty = require('lodash.matchesproperty'); var matchesProperty = require('lodash.matchesproperty');
``` ```
See the [documentation](https://lodash.com/docs#matchesProperty) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.matchesproperty) for more details. See the [documentation](https://lodash.com/docs#matchesProperty) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.matchesproperty) for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.matchesproperty", "name": "lodash.matchesproperty",
"version": "4.5.0", "version": "4.6.0",
"description": "The lodash method `_.matchesProperty` exported as a module.", "description": "The lodash method `_.matchesProperty` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -13,11 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
], ],
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"dependencies": {
"lodash._baseclone": "~4.5.0",
"lodash._root": "~3.0.0",
"lodash._stringtopath": "~4.8.0",
"lodash.keys": "^4.0.0"
}
} }

View File

@@ -1,4 +1,4 @@
# lodash.maxby v4.5.1 # lodash.maxby v4.6.0
The [lodash](https://lodash.com/) method `_.maxBy` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.maxBy` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var maxBy = require('lodash.maxby'); var maxBy = require('lodash.maxby');
``` ```
See the [documentation](https://lodash.com/docs#maxBy) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.maxby) for more details. See the [documentation](https://lodash.com/docs#maxBy) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.maxby) for more details.

View File

@@ -62,7 +62,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -238,7 +238,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -270,6 +270,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -282,14 +283,14 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -307,8 +308,7 @@ var Symbol = root.Symbol,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeKeys = overArg(Object.keys, Object);
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'), var DataView = getNative(root, 'DataView'),
@@ -776,11 +776,38 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -867,23 +894,6 @@ function baseGt(value, other) {
return value > other; return value > other;
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.hasIn` without support for deep paths. * The base implementation of `_.hasIn` without support for deep paths.
* *
@@ -1086,14 +1096,24 @@ function baseIteratee(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -1299,7 +1319,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details. // for more details.
return object == (other + ''); return object == (other + '');
@@ -1361,7 +1381,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var index = objLength; var index = objLength;
while (index--) { while (index--) {
var key = objProps[index]; var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) { if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false; return false;
} }
} }
@@ -1412,19 +1432,6 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
return result; return result;
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1473,15 +1480,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
* *
@@ -1492,7 +1490,7 @@ var getPrototype = overArg(nativeGetPrototype, Object);
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1544,24 +1542,7 @@ function hasPath(object, path, hasFunc) {
} }
var length = object ? object.length : 0; var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object)); (isArray(object) || isArguments(object));
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} }
/** /**
@@ -1734,7 +1715,7 @@ function toSource(func) {
* **Note:** The cache is exposed as the `cache` property on the memoized * **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache` * function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the * constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`. * method interface of `delete`, `get`, `has`, and `set`.
* *
* @static * @static
@@ -1793,7 +1774,7 @@ memoize.Cache = MapCache;
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1846,7 +1827,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1902,7 +1883,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1953,8 +1934,7 @@ function isArrayLikeObject(value) {
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1962,16 +1942,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1993,7 +1972,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2049,28 +2028,6 @@ function isObjectLike(value) {
return !!value && typeof value == 'object'; return !!value && typeof value == 'object';
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a `Symbol` primitive or object. * Checks if `value` is classified as a `Symbol` primitive or object.
* *
@@ -2201,7 +2158,7 @@ function hasIn(object, path) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2226,23 +2183,7 @@ function hasIn(object, path) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.maxby", "name": "lodash.maxby",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.maxBy` exported as a module.", "description": "The lodash method `_.maxBy` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.merge v4.5.1 # lodash.merge v4.6.0
The [lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var merge = require('lodash.merge'); var merge = require('lodash.merge');
``` ```
See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.merge) for more details. See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.merge) for more details.

View File

@@ -48,7 +48,7 @@ var arrayBufferTag = '[object ArrayBuffer]',
/** /**
* Used to match `RegExp` * Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
@@ -237,19 +237,6 @@ function arrayReduce(array, iteratee, accumulator, initAccum) {
return accumulator; return accumulator;
} }
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/** /**
* The base implementation of `_.times` without support for iteratee shorthands * The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks. * or max array length checks.
@@ -313,23 +300,6 @@ function isHostObject(value) {
return result; return result;
} }
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/** /**
* Converts `map` to its key-value pairs. * Converts `map` to its key-value pairs.
* *
@@ -348,7 +318,7 @@ function mapToArray(map) {
} }
/** /**
* Creates a function that invokes `func` with its first argument transformed. * Creates a unary function that invokes `func` with its argument transformed.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
@@ -380,6 +350,7 @@ function setToArray(set) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype, var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype; objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */ /** Used to detect overreaching core-js shims. */
@@ -392,7 +363,7 @@ var maskSrcKey = (function() {
}()); }());
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
@@ -402,7 +373,7 @@ var objectCtorString = funcToString.call(Object);
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -415,19 +386,17 @@ var reIsNative = RegExp('^' +
/** Built-in value references. */ /** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined, var Buffer = moduleExports ? root.Buffer : undefined,
Reflect = root.Reflect,
Symbol = root.Symbol, Symbol = root.Symbol,
Uint8Array = root.Uint8Array, Uint8Array = root.Uint8Array,
enumerate = Reflect ? Reflect.enumerate : undefined, getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create, objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable, propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf, var nativeGetSymbols = Object.getOwnPropertySymbols,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeKeys = Object.keys, nativeKeys = overArg(Object.keys, Object),
nativeMax = Math.max; nativeMax = Math.max;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
@@ -845,6 +814,33 @@ Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas; Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet; Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/** /**
* This function is like `assignValue` except that it doesn't assign * This function is like `assignValue` except that it doesn't assign
* `undefined` values. * `undefined` values.
@@ -863,7 +859,7 @@ function assignMergeValue(object, key, value) {
/** /**
* Assigns `value` to `key` of `object` if the existing value is not equivalent * Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *
* @private * @private
@@ -883,7 +879,7 @@ function assignValue(object, key, value) {
* Gets the index at which the `key` is found in `array` of key-value pairs. * Gets the index at which the `key` is found in `array` of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to inspect.
* @param {*} key The key to search for. * @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`. * @returns {number} Returns the index of the matched value, else `-1`.
*/ */
@@ -1024,23 +1020,6 @@ function baseGetTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/** /**
* The base implementation of `_.isNative` without bad shim checks. * The base implementation of `_.isNative` without bad shim checks.
* *
@@ -1070,40 +1049,47 @@ function baseIsTypedArray(value) {
} }
/** /**
* The base implementation of `_.keys` which doesn't skip the constructor * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
var baseKeys = overArg(nativeKeys, Object); function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/** /**
* The base implementation of `_.keysIn` which doesn't skip the constructor * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
* property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
function baseKeysIn(object) { function baseKeysIn(object) {
object = object == null ? object : Object(object); if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
var result = [];
for (var key in object) { for (var key in object) {
result.push(key); if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
} }
return result; return result;
} }
// Fallback for IE < 9 with es6-shim.
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
baseKeysIn = function(object) {
return iteratorToArray(enumerate(object));
};
}
/** /**
* The base implementation of `_.merge` without support for multiple sources. * The base implementation of `_.merge` without support for multiple sources.
* *
@@ -1120,7 +1106,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
return; return;
} }
if (!(isArray(source) || isTypedArray(source))) { if (!(isArray(source) || isTypedArray(source))) {
var props = keysIn(source); var props = baseKeysIn(source);
} }
arrayEach(props || source, function(srcValue, key) { arrayEach(props || source, function(srcValue, key) {
if (props) { if (props) {
@@ -1453,19 +1439,6 @@ function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols); return baseGetAllKeys(object, keys, getSymbols);
} }
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Gets the data for `map`. * Gets the data for `map`.
* *
@@ -1494,15 +1467,6 @@ function getNative(object, key) {
return baseIsNative(value) ? value : undefined; return baseIsNative(value) ? value : undefined;
} }
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/** /**
* Creates an array of the own enumerable symbol properties of `object`. * Creates an array of the own enumerable symbol properties of `object`.
* *
@@ -1522,7 +1486,7 @@ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArra
var getTag = baseGetTag; var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11, // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge, and promises in Node.js. // for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) || (Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) || (Promise && getTag(Promise.resolve()) != promiseTag) ||
@@ -1627,23 +1591,6 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) {
} }
} }
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
/** /**
* Checks if `value` is a valid array-like index. * Checks if `value` is a valid array-like index.
* *
@@ -1722,6 +1669,25 @@ function isPrototype(value) {
return value === proto; return value === proto;
} }
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/** /**
* Converts `func` to its source code. * Converts `func` to its source code.
* *
@@ -1743,7 +1709,7 @@ function toSource(func) {
/** /**
* Performs a * Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
@@ -1796,7 +1762,7 @@ function eq(value, other) {
* // => false * // => false
*/ */
function isArguments(value) { function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} }
@@ -1852,7 +1818,7 @@ var isArray = Array.isArray;
* // => false * // => false
*/ */
function isArrayLike(value) { function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value); return value != null && isLength(value.length) && !isFunction(value);
} }
/** /**
@@ -1922,8 +1888,7 @@ var isBuffer = nativeIsBuffer || stubFalse;
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors, // in Safari 8-9 which returns 'object' for typed array and other constructors.
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -1931,16 +1896,15 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on * **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1962,7 +1926,7 @@ function isLength(value) {
/** /**
* Checks if `value` is the * Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
@@ -2027,8 +1991,7 @@ function isObjectLike(value) {
* @since 0.8.0 * @since 0.8.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* else `false`.
* @example * @example
* *
* function Foo() { * function Foo() {
@@ -2061,28 +2024,6 @@ function isPlainObject(value) {
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
} }
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/** /**
* Checks if `value` is classified as a typed array. * Checks if `value` is classified as a typed array.
* *
@@ -2134,7 +2075,7 @@ function toPlainObject(value) {
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the * **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details. * for more details.
* *
* @static * @static
@@ -2159,23 +2100,7 @@ function toPlainObject(value) {
* // => ['0', '1'] * // => ['0', '1']
*/ */
function keys(object) { function keys(object) {
var isProto = isPrototype(object); return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
} }
/** /**
@@ -2202,23 +2127,7 @@ function keys(object) {
* // => ['a', 'b', 'c'] (iteration order is not guaranteed) * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/ */
function keysIn(object) { function keysIn(object) {
var index = -1, return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
isProto = isPrototype(object),
props = baseKeysIn(object),
propsLength = props.length,
indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
while (++index < propsLength) {
var key = props[index];
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.merge", "name": "lodash.merge",
"version": "4.5.1", "version": "4.6.0",
"description": "The lodash method `_.merge` exported as a module.", "description": "The lodash method `_.merge` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",

View File

@@ -1,4 +1,4 @@
# lodash.mergewith v4.5.1 # lodash.mergewith v4.6.0
The [lodash](https://lodash.com/) method `_.mergeWith` exported as a [Node.js](https://nodejs.org/) module. The [lodash](https://lodash.com/) method `_.mergeWith` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var mergeWith = require('lodash.mergewith'); var mergeWith = require('lodash.mergewith');
``` ```
See the [documentation](https://lodash.com/docs#mergeWith) or [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash.mergewith) for more details. See the [documentation](https://lodash.com/docs#mergeWith) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.mergewith) for more details.

Some files were not shown because too many files have changed in this diff Show More