Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash-es

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash-es - npm Package Compare versions

Comparing version 4.17.4 to 4.17.5

_safeGet.js

20

_baseClone.js

@@ -18,3 +18,5 @@ import Stack from './_Stack.js';

import isBuffer from './isBuffer.js';
import isMap from './isMap.js';
import isObject from './isObject.js';
import isSet from './isSet.js';
import keys from './keys.js';

@@ -127,3 +129,3 @@

}
result = initCloneByTag(value, tag, baseClone, isDeep);
result = initCloneByTag(value, tag, isDeep);
}

@@ -139,2 +141,18 @@ }

if (isSet(value)) {
value.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
return result;
}
if (isMap(value)) {
value.forEach(function(subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
var keysFunc = isFull

@@ -141,0 +159,0 @@ ? (isFlat ? getAllKeysIn : getAllKeys)

3

_baseMerge.js

@@ -7,2 +7,3 @@ import Stack from './_Stack.js';

import keysIn from './keysIn.js';
import safeGet from './_safeGet.js';

@@ -31,3 +32,3 @@ /**

var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack)
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined;

@@ -34,0 +35,0 @@

@@ -14,2 +14,3 @@ import assignMergeValue from './_assignMergeValue.js';

import isTypedArray from './isTypedArray.js';
import safeGet from './_safeGet.js';
import toPlainObject from './toPlainObject.js';

@@ -33,4 +34,4 @@

function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
var objValue = safeGet(object, key),
srcValue = safeGet(source, key),
stacked = stack.get(srcValue);

@@ -37,0 +38,0 @@

@@ -16,3 +16,3 @@ /** Used for built-in method references. */

var length = array.length,
result = array.constructor(length);
result = new array.constructor(length);

@@ -19,0 +19,0 @@ // Add properties assigned by `RegExp#exec`.

import cloneArrayBuffer from './_cloneArrayBuffer.js';
import cloneDataView from './_cloneDataView.js';
import cloneMap from './_cloneMap.js';
import cloneRegExp from './_cloneRegExp.js';
import cloneSet from './_cloneSet.js';
import cloneSymbol from './_cloneSymbol.js';

@@ -35,3 +33,3 @@ import cloneTypedArray from './_cloneTypedArray.js';

* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
*

@@ -41,7 +39,6 @@ * @private

* @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, cloneFunc, isDeep) {
function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor;

@@ -65,3 +62,3 @@ switch (tag) {

case mapTag:
return cloneMap(object, isDeep, cloneFunc);
return new Ctor;

@@ -76,3 +73,3 @@ case numberTag:

case setTag:
return cloneSet(object, isDeep, cloneFunc);
return new Ctor;

@@ -79,0 +76,0 @@ case symbolTag:

@@ -16,8 +16,11 @@ /** Used as references for various `Number` constants. */

function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
(type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}
export default isIndex;
import memoizeCapped from './_memoizeCapped.js';
/** Used to match property names within property paths. */
var reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;

@@ -19,7 +18,7 @@ /** Used to match backslashes in property paths. */

var result = [];
if (reLeadingDot.test(string)) {
if (string.charCodeAt(0) === 46 /* . */) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
});

@@ -26,0 +25,0 @@ return result;

@@ -41,4 +41,4 @@ /** Used to compose unicode character classes. */

rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
rsSeq = rsOptVar + reOptMod + rsOptJoin,

@@ -45,0 +45,0 @@ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;

@@ -111,5 +111,7 @@ import isObject from './isObject.js';

timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}

@@ -116,0 +118,0 @@

@@ -1,6 +0,12 @@

import apply from './_apply.js';
import assignInWith from './assignInWith.js';
import baseRest from './_baseRest.js';
import customDefaultsAssignIn from './_customDefaultsAssignIn.js';
import eq from './eq.js';
import isIterateeCall from './_isIterateeCall.js';
import keysIn from './keysIn.js';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**

@@ -27,7 +33,33 @@ * Assigns own and inherited enumerable string keyed properties of source

*/
var defaults = baseRest(function(args) {
args.push(undefined, customDefaultsAssignIn);
return apply(assignInWith, undefined, args);
var defaults = baseRest(function(object, sources) {
object = Object(object);
var index = -1;
var length = sources.length;
var guard = length > 2 ? sources[2] : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
length = 1;
}
while (++index < length) {
var source = sources[index];
var props = keysIn(source);
var propsIndex = -1;
var propsLength = props.length;
while (++propsIndex < propsLength) {
var key = props[propsIndex];
var value = object[key];
if (value === undefined ||
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
object[key] = source[key];
}
}
}
return object;
});
export default defaults;

@@ -5,3 +5,13 @@ import constant from './constant.js';

/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Creates an object composed of the inverted keys and values of `object`.

@@ -25,2 +35,7 @@ * If `object` contains duplicate values, subsequent values overwrite

var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key;

@@ -27,0 +42,0 @@ }, constant(identity));

@@ -11,2 +11,9 @@ import baseIteratee from './_baseIteratee.js';

/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* This method is like `_.invert` except that the inverted object is generated

@@ -38,2 +45,7 @@ * from the results of running each element of `object` thru `iteratee`. The

var invertBy = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
if (hasOwnProperty.call(result, value)) {

@@ -40,0 +52,0 @@ result[value].push(key);

@@ -48,3 +48,3 @@ /**

/** Used as the semantic version number. */
var VERSION = '4.17.4';
var VERSION = '4.17.5';

@@ -51,0 +51,0 @@ /** Used to compose bitmasks for function metadata. */

{
"name": "lodash-es",
"version": "4.17.4",
"version": "4.17.5",
"description": "Lodash exported as ES modules.",

@@ -13,2 +13,3 @@ "keywords": "es6, modules, stdlib, util",

"module": "lodash.js",
"sideEffects": false,
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",

@@ -20,3 +21,3 @@ "contributors": [

],
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
"scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" }
}

@@ -1,2 +0,2 @@

# lodash-es v4.17.4
# lodash-es v4.17.5

@@ -10,2 +10,2 @@ The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.

See the [package source](https://github.com/lodash/lodash/tree/4.17.4-es) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.17.5-es) for more details.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc