Updating lodash

parent a1cd0cc5
...@@ -23947,7 +23947,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -23947,7 +23947,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
var undefined; var undefined;
/** Used as the semantic version number. */ /** Used as the semantic version number. */
var VERSION = '4.17.4'; var VERSION = '4.17.10';
/** 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;
...@@ -24078,7 +24078,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -24078,7 +24078,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
/** 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*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** /**
...@@ -24178,8 +24177,8 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -24178,8 +24177,8 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
reOptMod = rsModifier + '?', reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?', rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\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)', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
...@@ -24372,6 +24371,14 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -24372,6 +24371,14 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
/** Used to access faster Node.js helpers. */ /** Used to access faster Node.js helpers. */
var nodeUtil = (function() { var nodeUtil = (function() {
try { try {
// Use `util.types` for Node.js 10+.
var types = freeModule && freeModule.require && freeModule.require('util').types;
if (types) {
return types;
}
// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess && freeProcess.binding && freeProcess.binding('util'); return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {} } catch (e) {}
}()); }());
...@@ -24386,34 +24393,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -24386,34 +24393,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
// Don't return `map.set` because it's not chainable in IE 11.
map.set(pair[0], pair[1]);
return map;
}
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
// Don't return `set.add` because it's not chainable in IE 11.
set.add(value);
return set;
}
/** /**
* A faster alternative to `Function#apply`, this function invokes `func` * A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`. * with the `this` binding of `thisArg` and the arguments of `args`.
...@@ -25180,6 +25159,20 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -25180,6 +25159,20 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
return result; return result;
} }
/**
* Gets the value at `key`, unless `key` is "__proto__".
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function safeGet(object, key) {
return key == '__proto__'
? undefined
: object[key];
}
/** /**
* Converts `set` to an array of its values. * Converts `set` to an array of its values.
* *
...@@ -26612,7 +26605,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -26612,7 +26605,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
return object ? value : {}; return object ? value : {};
} }
result = initCloneByTag(value, tag, baseClone, isDeep); result = initCloneByTag(value, tag, isDeep);
} }
} }
// Check for circular references and return its corresponding clone. // Check for circular references and return its corresponding clone.
...@@ -26623,6 +26616,22 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -26623,6 +26616,22 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
} }
stack.set(value, result); stack.set(value, result);
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 var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys) ? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys); : (isFlat ? keysIn : keys);
...@@ -27550,7 +27559,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -27550,7 +27559,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
} }
else { else {
var newValue = customizer var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack) ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
...@@ -27577,8 +27586,8 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -27577,8 +27586,8 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
* counterparts. * counterparts.
*/ */
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key], var objValue = safeGet(object, key),
srcValue = source[key], srcValue = safeGet(source, key),
stacked = stack.get(srcValue); stacked = stack.get(srcValue);
if (stacked) { if (stacked) {
...@@ -28486,20 +28495,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -28486,20 +28495,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
} }
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
/** /**
* Creates a clone of `regexp`. * Creates a clone of `regexp`.
* *
...@@ -28513,20 +28508,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -28513,20 +28508,6 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
return result; return result;
} }
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
/** /**
* Creates a clone of the `symbol` object. * Creates a clone of the `symbol` object.
* *
...@@ -30121,7 +30102,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -30121,7 +30102,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
*/ */
function initCloneArray(array) { function initCloneArray(array) {
var length = array.length, var length = array.length,
result = array.constructor(length); result = new array.constructor(length);
// Add properties assigned by `RegExp#exec`. // Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
...@@ -30148,16 +30129,15 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -30148,16 +30129,15 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
* Initializes an object clone based on its `toStringTag`. * Initializes an object clone based on its `toStringTag`.
* *
* **Note:** This function only supports cloning values with tags of * **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`.
* *
* @private * @private
* @param {Object} object The object to clone. * @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone. * @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. * @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone. * @returns {Object} Returns the initialized clone.
*/ */
function initCloneByTag(object, tag, cloneFunc, isDeep) { function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor; var Ctor = object.constructor;
switch (tag) { switch (tag) {
case arrayBufferTag: case arrayBufferTag:
...@@ -30176,7 +30156,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -30176,7 +30156,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
return cloneTypedArray(object, isDeep); return cloneTypedArray(object, isDeep);
case mapTag: case mapTag:
return cloneMap(object, isDeep, cloneFunc); return new Ctor;
case numberTag: case numberTag:
case stringTag: case stringTag:
...@@ -30186,7 +30166,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -30186,7 +30166,7 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
return cloneRegExp(object); return cloneRegExp(object);
case setTag: case setTag:
return cloneSet(object, isDeep, cloneFunc); return new Ctor;
case symbolTag: case symbolTag:
return cloneSymbol(object); return cloneSymbol(object);
...@@ -30233,10 +30213,13 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -30233,10 +30213,13 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/ */
function isIndex(value, length) { function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length; length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && return !!length &&
(typeof value == 'number' || reIsUint.test(value)) && (type == 'number' ||
(value > -1 && value % 1 == 0 && value < length); (type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
} }
/** /**
...@@ -30686,11 +30669,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -30686,11 +30669,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
*/ */
var stringToPath = memoizeCapped(function(string) { var stringToPath = memoizeCapped(function(string) {
var result = []; var result = [];
if (reLeadingDot.test(string)) { if (string.charCodeAt(0) === 46 /* . */) {
result.push(''); result.push('');
} }
string.replace(rePropName, function(match, number, quote, string) { string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
}); });
return result; return result;
}); });
...@@ -34298,9 +34281,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -34298,9 +34281,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
function remainingWait(time) { function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime, var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime, timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall; timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
} }
function shouldInvoke(time) { function shouldInvoke(time) {
...@@ -36732,9 +36717,35 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -36732,9 +36717,35 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 } * // => { 'a': 1, 'b': 2 }
*/ */
var defaults = baseRest(function(args) { var defaults = baseRest(function(object, sources) {
args.push(undefined, customDefaultsAssignIn); object = Object(object);
return apply(assignInWith, undefined, args);
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;
}); });
/** /**
...@@ -37131,6 +37142,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -37131,6 +37142,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
* // => { '1': 'c', '2': 'b' } * // => { '1': 'c', '2': 'b' }
*/ */
var invert = createInverter(function(result, value, key) { var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key; result[value] = key;
}, constant(identity)); }, constant(identity));
...@@ -37161,6 +37177,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d ...@@ -37161,6 +37177,11 @@ exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.d
* // => { 'group1': ['a', 'c'], 'group2': ['b'] } * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/ */
var invertBy = createInverter(function(result, value, key) { var invertBy = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
if (hasOwnProperty.call(result, value)) { if (hasOwnProperty.call(result, value)) {
result[value].push(key); result[value].push(key);
} else { } else {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment