lodash._baseset
Advanced tools
Comparing version 4.2.1 to 4.3.0
62
index.js
/** | ||
* lodash 4.2.1 (Custom Build) <https://lodash.com/> | ||
* lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -12,3 +12,4 @@ * Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
/** Used as references for various `Number` constants. */ | ||
var MAX_SAFE_INTEGER = 9007199254740991; | ||
var INFINITY = 1 / 0, | ||
MAX_SAFE_INTEGER = 9007199254740991; | ||
@@ -25,16 +26,2 @@ /** `Object#toString` result references. */ | ||
/** | ||
* Checks if `value` is a valid array-like index. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. | ||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`. | ||
*/ | ||
function isIndex(value, length) { | ||
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; | ||
length = length == null ? MAX_SAFE_INTEGER : length; | ||
return value > -1 && value % 1 == 0 && value < length; | ||
} | ||
/** Used for built-in method references. */ | ||
@@ -90,3 +77,3 @@ var objectProto = Object.prototype; | ||
while (nested != null && ++index < length) { | ||
var key = path[index]; | ||
var key = toKey(path[index]); | ||
if (isObject(nested)) { | ||
@@ -122,2 +109,17 @@ var newValue = value; | ||
/** | ||
* Checks if `value` is a valid array-like index. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. | ||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`. | ||
*/ | ||
function isIndex(value, length) { | ||
length = length == null ? MAX_SAFE_INTEGER : length; | ||
return !!length && | ||
(typeof value == 'number' || reIsUint.test(value)) && | ||
(value > -1 && value % 1 == 0 && value < length); | ||
} | ||
/** | ||
* Checks if `value` is a property name and not a property path. | ||
@@ -131,12 +133,30 @@ * | ||
function isKey(value, object) { | ||
if (isArray(value)) { | ||
return false; | ||
} | ||
var type = typeof value; | ||
if (type == 'number' || type == 'symbol') { | ||
if (type == 'number' || type == 'symbol' || type == 'boolean' || | ||
value == null || isSymbol(value)) { | ||
return true; | ||
} | ||
return !isArray(value) && | ||
(isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || | ||
(object != null && value in Object(object))); | ||
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || | ||
(object != null && value in Object(object)); | ||
} | ||
/** | ||
* Converts `value` to a string key if it's not a string or symbol. | ||
* | ||
* @private | ||
* @param {*} value The value to inspect. | ||
* @returns {string|symbol} Returns the key. | ||
*/ | ||
function toKey(value) { | ||
if (typeof value == 'string' || isSymbol(value)) { | ||
return value; | ||
} | ||
var result = (value + ''); | ||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; | ||
} | ||
/** | ||
* Performs a | ||
@@ -143,0 +163,0 @@ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) |
{ | ||
"name": "lodash._baseset", | ||
"version": "4.2.1", | ||
"version": "4.3.0", | ||
"description": "The internal lodash function `baseSet` exported as a module.", | ||
@@ -17,4 +17,4 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._stringtopath": "~4.7.0" | ||
"lodash._stringtopath": "~4.8.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash._baseset v4.2.1 | ||
# lodash._baseset v4.3.0 | ||
@@ -18,2 +18,2 @@ The internal [lodash](https://lodash.com/) function `baseSet` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash._baseset) for more details. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash._baseset) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10932
279
+ Addedlodash._basetostring@4.12.0(transitive)
+ Addedlodash._stringtopath@4.8.0(transitive)
- Removedlodash._stringtopath@4.7.1(transitive)
Updatedlodash._stringtopath@~4.8.0