lodash._baseiteratee
Advanced tools
Comparing version 4.5.2 to 4.6.0
372
index.js
/** | ||
* lodash 4.5.2 (Custom Build) <https://lodash.com/> | ||
* lodash 4.6.0 (Custom Build) <https://lodash.com/> | ||
* 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> | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
var stringToPath = require('lodash._stringtopath'); | ||
@@ -21,4 +22,3 @@ /** Used as the size to enable large array optimizations. */ | ||
/** Used as references for various `Number` constants. */ | ||
var INFINITY = 1 / 0, | ||
MAX_SAFE_INTEGER = 9007199254740991; | ||
var MAX_SAFE_INTEGER = 9007199254740991; | ||
@@ -36,2 +36,3 @@ /** `Object#toString` result references. */ | ||
objectTag = '[object Object]', | ||
promiseTag = '[object Promise]', | ||
regexpTag = '[object RegExp]', | ||
@@ -44,2 +45,3 @@ setTag = '[object Set]', | ||
var arrayBufferTag = '[object ArrayBuffer]', | ||
dataViewTag = '[object DataView]', | ||
float32Tag = '[object Float32Array]', | ||
@@ -57,4 +59,3 @@ float64Tag = '[object Float64Array]', | ||
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, | ||
reIsPlainProp = /^\w*$/, | ||
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; | ||
reIsPlainProp = /^\w*$/; | ||
@@ -64,6 +65,3 @@ /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ | ||
/** Used to match backslashes in property paths. */ | ||
var reEscapeChar = /\\(\\)?/g; | ||
/** Used to detect host constructors (Safari > 5). */ | ||
/** Used to detect host constructors (Safari). */ | ||
var reIsHostCtor = /^\[object .+?Constructor\]$/; | ||
@@ -83,7 +81,8 @@ | ||
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = | ||
typedArrayTags[dateTag] = typedArrayTags[errorTag] = | ||
typedArrayTags[funcTag] = typedArrayTags[mapTag] = | ||
typedArrayTags[numberTag] = typedArrayTags[objectTag] = | ||
typedArrayTags[regexpTag] = typedArrayTags[setTag] = | ||
typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; | ||
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = | ||
typedArrayTags[errorTag] = typedArrayTags[funcTag] = | ||
typedArrayTags[mapTag] = typedArrayTags[numberTag] = | ||
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = | ||
typedArrayTags[setTag] = typedArrayTags[stringTag] = | ||
typedArrayTags[weakMapTag] = false; | ||
@@ -155,3 +154,4 @@ /** Used to determine if values are of the language type `Object`. */ | ||
* @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`. | ||
*/ | ||
@@ -307,3 +307,2 @@ function arraySome(array, predicate) { | ||
Uint8Array = root.Uint8Array, | ||
getPrototypeOf = Object.getPrototypeOf, | ||
propertyIsEnumerable = objectProto.propertyIsEnumerable, | ||
@@ -313,6 +312,9 @@ splice = arrayProto.splice; | ||
/* 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. */ | ||
var Map = getNative(root, 'Map'), | ||
var DataView = getNative(root, 'DataView'), | ||
Map = getNative(root, 'Map'), | ||
Promise = getNative(root, 'Promise'), | ||
Set = getNative(root, 'Set'), | ||
@@ -323,3 +325,5 @@ WeakMap = getNative(root, 'WeakMap'), | ||
/** 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) : '', | ||
@@ -330,4 +334,3 @@ weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; | ||
var symbolProto = Symbol ? Symbol.prototype : undefined, | ||
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, | ||
symbolToString = symbolProto ? symbolProto.toString : undefined; | ||
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; | ||
@@ -395,2 +398,5 @@ /** | ||
// Avoid inheriting from `Object.prototype` when possible. | ||
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; | ||
/** | ||
@@ -488,3 +494,3 @@ * Creates a map cache object to store key-value pairs. | ||
* @param {*} value The value to set. | ||
* @returns {Object} Returns the map cache object. | ||
* @returns {Object} Returns the map cache instance. | ||
*/ | ||
@@ -503,2 +509,9 @@ function mapSet(key, value) { | ||
// Add methods to `MapCache`. | ||
MapCache.prototype.clear = mapClear; | ||
MapCache.prototype['delete'] = mapDelete; | ||
MapCache.prototype.get = mapGet; | ||
MapCache.prototype.has = mapHas; | ||
MapCache.prototype.set = mapSet; | ||
/** | ||
@@ -589,3 +602,3 @@ * Creates a stack cache object to store key-value pairs. | ||
* @param {*} value The value to set. | ||
* @returns {Object} Returns the stack cache object. | ||
* @returns {Object} Returns the stack cache instance. | ||
*/ | ||
@@ -611,2 +624,9 @@ function stackSet(key, value) { | ||
// Add methods to `Stack`. | ||
Stack.prototype.clear = stackClear; | ||
Stack.prototype['delete'] = stackDelete; | ||
Stack.prototype.get = stackGet; | ||
Stack.prototype.has = stackHas; | ||
Stack.prototype.set = stackSet; | ||
/** | ||
@@ -616,3 +636,3 @@ * Removes `key` and its value from the associative array. | ||
* @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. | ||
@@ -661,4 +681,3 @@ * @returns {boolean} Returns `true` if the entry was removed, else `false`. | ||
/** | ||
* Gets the index at which the first occurrence of `key` is found in `array` | ||
* of key-value pairs. | ||
* Gets the index at which the `key` is found in `array` of key-value pairs. | ||
* | ||
@@ -717,3 +736,3 @@ * @private | ||
function baseGet(object, path) { | ||
path = isKey(path, object) ? [path + ''] : baseCastPath(path); | ||
path = isKey(path, object) ? [path] : baseCastPath(path); | ||
@@ -742,3 +761,3 @@ var index = 0, | ||
return hasOwnProperty.call(object, key) || | ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null); | ||
(typeof object == 'object' && key in object && getPrototype(object) === null); | ||
} | ||
@@ -793,3 +812,4 @@ | ||
* @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. | ||
@@ -827,4 +847,7 @@ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | ||
if (objIsWrapped || othIsWrapped) { | ||
var objUnwrapped = objIsWrapped ? object.value() : object, | ||
othUnwrapped = othIsWrapped ? other.value() : other; | ||
stack || (stack = new Stack); | ||
return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); | ||
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); | ||
} | ||
@@ -878,5 +901,6 @@ } | ||
} else { | ||
var stack = new Stack, | ||
result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; | ||
var stack = new Stack; | ||
if (customizer) { | ||
var result = customizer(objValue, srcValue, key, object, source, stack); | ||
} | ||
if (!(result === undefined | ||
@@ -901,4 +925,5 @@ ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) | ||
function baseIteratee(value) { | ||
var type = typeof value; | ||
if (type == 'function') { | ||
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. | ||
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. | ||
if (typeof value == 'function') { | ||
return value; | ||
@@ -909,3 +934,3 @@ } | ||
} | ||
if (type == 'object') { | ||
if (typeof value == 'object') { | ||
return isArray(value) | ||
@@ -1000,32 +1025,2 @@ ? baseMatchesProperty(value[0], value[1]) | ||
/** | ||
* 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 | ||
@@ -1039,3 +1034,4 @@ * partial deep 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. | ||
@@ -1082,3 +1078,4 @@ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. | ||
if (!arraySome(other, function(othValue) { | ||
return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); | ||
return arrValue === othValue || | ||
equalFunc(arrValue, othValue, customizer, bitmask, stack); | ||
})) { | ||
@@ -1088,3 +1085,6 @@ result = false; | ||
} | ||
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { | ||
} else if (!( | ||
arrValue === othValue || | ||
equalFunc(arrValue, othValue, customizer, bitmask, stack) | ||
)) { | ||
result = false; | ||
@@ -1111,3 +1111,4 @@ break; | ||
* @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. | ||
@@ -1118,2 +1119,10 @@ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | ||
switch (tag) { | ||
case dataViewTag: | ||
if ((object.byteLength != other.byteLength) || | ||
(object.byteOffset != other.byteOffset)) { | ||
return false; | ||
} | ||
object = object.buffer; | ||
other = other.buffer; | ||
case arrayBufferTag: | ||
@@ -1128,4 +1137,5 @@ if ((object.byteLength != other.byteLength) || | ||
case dateTag: | ||
// Coerce dates and booleans to numbers, dates to milliseconds and booleans | ||
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal. | ||
// Coerce dates and booleans to numbers, dates to milliseconds and | ||
// booleans to `1` or `0` treating invalid dates coerced to `NaN` as | ||
// not equal. | ||
return +object == +other; | ||
@@ -1142,4 +1152,4 @@ | ||
case stringTag: | ||
// Coerce regexes to strings and treat strings primitives and string | ||
// objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. | ||
// Coerce regexes to strings and treat strings, primitives and objects, | ||
// as equal. See https://es5.github.io/#x15.10.6.4 for more details. | ||
return object == (other + ''); | ||
@@ -1162,4 +1172,7 @@ | ||
} | ||
bitmask |= UNORDERED_COMPARE_FLAG; | ||
stack.set(object, other); | ||
// Recursively compare objects (susceptible to call stack limits). | ||
return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other)); | ||
return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); | ||
@@ -1183,3 +1196,4 @@ case symbolTag: | ||
* @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. | ||
@@ -1253,4 +1267,5 @@ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | ||
* | ||
* **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. | ||
* **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. | ||
* | ||
@@ -1294,2 +1309,13 @@ * @private | ||
/** | ||
* 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`. | ||
@@ -1305,4 +1331,7 @@ * | ||
// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. | ||
if ((Map && getTag(new Map) != mapTag) || | ||
// Fallback for data views, maps, sets, and weak maps in IE 11, | ||
// 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) || | ||
@@ -1317,3 +1346,5 @@ (WeakMap && getTag(new WeakMap) != weakMapTag)) { | ||
switch (ctorString) { | ||
case dataViewCtorString: return dataViewTag; | ||
case mapCtorString: return mapTag; | ||
case promiseCtorString: return promiseTag; | ||
case setCtorString: return setTag; | ||
@@ -1343,6 +1374,12 @@ case weakMapCtorString: return weakMapTag; | ||
path = baseCastPath(path); | ||
object = parent(object, path); | ||
if (object != null) { | ||
path = last(path); | ||
result = hasFunc(object, path); | ||
var index = -1, | ||
length = path.length; | ||
while (object != null && ++index < length) { | ||
var key = path[index]; | ||
if (!(result = hasFunc(object, key))) { | ||
break; | ||
} | ||
object = object[key]; | ||
} | ||
@@ -1383,7 +1420,8 @@ } | ||
function isKey(value, object) { | ||
if (typeof value == 'number') { | ||
var type = typeof value; | ||
if (type == 'number' || type == 'symbol') { | ||
return true; | ||
} | ||
return !isArray(value) && | ||
(reIsPlainProp.test(value) || !reIsDeepProp.test(value) || | ||
(isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || | ||
(object != null && value in Object(object))); | ||
@@ -1432,48 +1470,4 @@ } | ||
/** | ||
* Gets the parent value at `path` of `object`. | ||
* | ||
* @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) | ||
* Performs a | ||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) | ||
* comparison between two values to determine if they are equivalent. | ||
@@ -1483,2 +1477,3 @@ * | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -1517,5 +1512,7 @@ * @param {*} value The value to compare. | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -1540,6 +1537,8 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @type {Function} | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -1568,2 +1567,3 @@ * | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -1596,5 +1596,7 @@ * @param {*} value The value to check. | ||
* @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`. | ||
* @returns {boolean} Returns `true` if `value` is an array-like object, | ||
* else `false`. | ||
* @example | ||
@@ -1623,5 +1625,7 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -1646,9 +1650,12 @@ * | ||
* | ||
* **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 | ||
* @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`. | ||
* @returns {boolean} Returns `true` if `value` is a valid length, | ||
* else `false`. | ||
* @example | ||
@@ -1679,2 +1686,3 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
@@ -1708,2 +1716,3 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -1735,5 +1744,7 @@ * @param {*} value The value to check. | ||
* @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`. | ||
* @returns {boolean} Returns `true` if `value` is a native function, | ||
* else `false`. | ||
* @example | ||
@@ -1762,6 +1773,8 @@ * | ||
* @static | ||
* @since 0.1.0 | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -1785,5 +1798,7 @@ * | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -1807,5 +1822,7 @@ * | ||
* @memberOf _ | ||
* @since 3.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -1825,37 +1842,2 @@ * | ||
/** | ||
* 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 | ||
@@ -1866,6 +1848,7 @@ * `undefined` the `defaultValue` is used in its place. | ||
* @memberOf _ | ||
* @since 3.7.0 | ||
* @category Object | ||
* @param {Object} object The object to query. | ||
* @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. | ||
@@ -1895,2 +1878,3 @@ * @example | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Object | ||
@@ -1928,2 +1912,3 @@ * @param {Object} object The object to query. | ||
* @static | ||
* @since 0.1.0 | ||
* @memberOf _ | ||
@@ -1969,7 +1954,9 @@ * @category Object | ||
/** | ||
* Creates an array of own enumerable key-value pairs for `object` which | ||
* can be consumed by `_.fromPairs`. | ||
* Creates an array of own enumerable string keyed-value pairs for `object` | ||
* which can be consumed by `_.fromPairs`. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @alias entries | ||
* @category Object | ||
@@ -1998,2 +1985,3 @@ * @param {Object} object The object to query. | ||
* @static | ||
* @since 0.1.0 | ||
* @memberOf _ | ||
@@ -2019,2 +2007,3 @@ * @category Util | ||
* @memberOf _ | ||
* @since 2.4.0 | ||
* @category Util | ||
@@ -2040,19 +2029,2 @@ * @param {Array|string} path The path of the property to get. | ||
// 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; |
{ | ||
"name": "lodash._baseiteratee", | ||
"version": "4.5.2", | ||
"version": "4.6.0", | ||
"description": "The internal lodash function `baseIteratee` exported as a module.", | ||
@@ -15,3 +15,6 @@ "homepage": "https://lodash.com/", | ||
"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" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash._baseiteratee v4.5.2 | ||
# lodash._baseiteratee v4.6.0 | ||
@@ -18,2 +18,2 @@ The internal [lodash](https://lodash.com/) function `baseIteratee` exported as a [Node.js](https://nodejs.org/) module. | ||
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. |
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
56733
1
2
1813
1
+ Addedlodash._stringtopath@~4.7.0
+ Addedlodash._stringtopath@4.7.1(transitive)