lodash._baseset
Advanced tools
Comparing version 4.1.3 to 4.2.0
107
index.js
/** | ||
* lodash 4.1.3 (Custom Build) <https://lodash.com/> | ||
* lodash 4.2.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 toString = require('lodash.tostring'); | ||
var stringToPath = require('lodash._stringtopath'); | ||
@@ -14,10 +14,9 @@ /** Used as references for various `Number` constants. */ | ||
/** `Object#toString` result references. */ | ||
var symbolTag = '[object Symbol]'; | ||
/** Used to match property names within property paths. */ | ||
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, | ||
reIsPlainProp = /^\w*$/, | ||
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; | ||
reIsPlainProp = /^\w*$/; | ||
/** Used to match backslashes in property paths. */ | ||
var reEscapeChar = /\\(\\)?/g; | ||
/** Used to detect unsigned integer values. */ | ||
@@ -47,2 +46,8 @@ var reIsUint = /^(?:0|[1-9]\d*)$/; | ||
/** | ||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** | ||
* Assigns `value` to `key` of `object` if the existing value is not equivalent | ||
@@ -87,3 +92,3 @@ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) | ||
function baseSet(object, path, value, customizer) { | ||
path = isKey(path, object) ? [path + ''] : baseCastPath(path); | ||
path = isKey(path, object) ? [path] : baseCastPath(path); | ||
@@ -124,7 +129,8 @@ var index = -1, | ||
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))); | ||
@@ -134,18 +140,4 @@ } | ||
/** | ||
* 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; | ||
} | ||
/** | ||
* 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. | ||
@@ -155,2 +147,3 @@ * | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -189,6 +182,8 @@ * @param {*} value The value to compare. | ||
* @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 | ||
@@ -216,2 +211,3 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
@@ -239,2 +235,53 @@ * @param {*} value The value to check. | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is classified as a `Symbol` primitive or object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
* | ||
* _.isSymbol(Symbol.iterator); | ||
* // => true | ||
* | ||
* _.isSymbol('abc'); | ||
* // => false | ||
*/ | ||
function isSymbol(value) { | ||
return typeof value == 'symbol' || | ||
(isObjectLike(value) && objectToString.call(value) == symbolTag); | ||
} | ||
module.exports = baseSet; |
{ | ||
"name": "lodash._baseset", | ||
"version": "4.1.3", | ||
"version": "4.2.0", | ||
"description": "The internal lodash function `baseSet` exported as a module.", | ||
@@ -11,3 +11,3 @@ "homepage": "https://lodash.com/", | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -18,4 +18,4 @@ ], | ||
"dependencies": { | ||
"lodash.tostring": "^4.0.0" | ||
"lodash._stringtopath": "~4.7.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash._baseset v4.1.3 | ||
# lodash._baseset v4.2.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.1.3-npm-packages/lodash._baseset) for more details. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash._baseset) for more details. |
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
10417
258
1
+ Addedlodash._stringtopath@~4.7.0
+ Addedlodash._stringtopath@4.7.1(transitive)
- Removedlodash.tostring@^4.0.0
- Removedlodash.tostring@4.1.4(transitive)