mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Bump to v4.14.1.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# lodash-es v4.14.0
|
||||
# lodash-es v4.14.1
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
|
||||
|
||||
@@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
||||
$ lodash modularize exports=es -o ./
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.14.0-es) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.14.1-es) for more details.
|
||||
|
||||
@@ -133,9 +133,6 @@ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
||||
// Recursively populate clone (susceptible to call stack limits).
|
||||
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
||||
});
|
||||
if (!isFull) {
|
||||
stack['delete'](value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import baseRange from './_baseRange.js';
|
||||
import isIterateeCall from './_isIterateeCall.js';
|
||||
import toNumber from './toNumber.js';
|
||||
import toFinite from './toFinite.js';
|
||||
|
||||
/**
|
||||
* Creates a `_.range` or `_.rangeRight` function.
|
||||
@@ -15,15 +15,14 @@ function createRange(fromRight) {
|
||||
end = step = undefined;
|
||||
}
|
||||
// Ensure the sign of `-0` is preserved.
|
||||
start = toNumber(start);
|
||||
start = start === start ? start : 0;
|
||||
start = toFinite(start);
|
||||
if (end === undefined) {
|
||||
end = start;
|
||||
start = 0;
|
||||
} else {
|
||||
end = toNumber(end) || 0;
|
||||
end = toFinite(end);
|
||||
}
|
||||
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
|
||||
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
|
||||
return baseRange(start, end, step, fromRight);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
|
||||
}
|
||||
}
|
||||
stack['delete'](array);
|
||||
stack['delete'](other);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
|
||||
}
|
||||
}
|
||||
stack['delete'](object);
|
||||
stack['delete'](other);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import arrayPush from './_arrayPush.js';
|
||||
import getPrototype from './_getPrototype.js';
|
||||
import getSymbols from './_getSymbols.js';
|
||||
import stubArray from './stubArray.js';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
@@ -13,7 +14,7 @@ var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of symbols.
|
||||
*/
|
||||
var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) {
|
||||
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
||||
var result = [];
|
||||
while (object) {
|
||||
arrayPush(result, getSymbols(object));
|
||||
|
||||
@@ -14,7 +14,7 @@ var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
||||
*/
|
||||
function isFlattenable(value) {
|
||||
return isArray(value) || isArguments(value) ||
|
||||
!!(spreadableSymbol && value && value[spreadableSymbol])
|
||||
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
||||
}
|
||||
|
||||
export default isFlattenable;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import freeGlobal from './_freeGlobal.js';
|
||||
|
||||
/** Detect free variable `exports`. */
|
||||
var freeExports = freeGlobal && typeof exports == 'object' && exports;
|
||||
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
||||
|
||||
/** Detect free variable `module`. */
|
||||
var freeModule = freeExports && typeof module == 'object' && module;
|
||||
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
||||
|
||||
/** Detect the popular CommonJS extension `module.exports`. */
|
||||
var moduleExports = freeModule && freeModule.exports === freeExports;
|
||||
|
||||
@@ -2,7 +2,8 @@ import memoize from './memoize.js';
|
||||
import toString from './toString.js';
|
||||
|
||||
/** Used to match property names within property paths. */
|
||||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;
|
||||
var reLeadingDot = /^\./,
|
||||
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
||||
|
||||
/** Used to match backslashes in property paths. */
|
||||
var reEscapeChar = /\\(\\)?/g;
|
||||
@@ -15,8 +16,13 @@ var reEscapeChar = /\\(\\)?/g;
|
||||
* @returns {Array} Returns the property path array.
|
||||
*/
|
||||
var stringToPath = memoize(function(string) {
|
||||
string = toString(string);
|
||||
|
||||
var result = [];
|
||||
toString(string).replace(rePropName, function(match, number, quote, string) {
|
||||
if (reLeadingDot.test(string)) {
|
||||
result.push('');
|
||||
}
|
||||
string.replace(rePropName, function(match, number, quote, string) {
|
||||
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
|
||||
});
|
||||
return result;
|
||||
|
||||
@@ -6,6 +6,9 @@ import baseConforms from './_baseConforms.js';
|
||||
* the corresponding property values of a given object, returning `true` if
|
||||
* all predicates return truthy, else `false`.
|
||||
*
|
||||
* **Note:** The created function is equivalent to `_.conformsTo` with
|
||||
* `source` partially applied.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
|
||||
@@ -2,9 +2,11 @@ import baseConformsTo from './_baseConformsTo.js';
|
||||
import keys from './keys.js';
|
||||
|
||||
/**
|
||||
* Checks if `object` conforms to `source` by invoking the predicate properties
|
||||
* of `source` with the corresponding property values of `object`. This method
|
||||
* is equivalent to a `_.conforms` function when `source` is partially applied.
|
||||
* Checks if `object` conforms to `source` by invoking the predicate
|
||||
* properties of `source` with the corresponding property values of `object`.
|
||||
*
|
||||
* **Note:** This method is equivalent to `_.conforms` when `source` is
|
||||
* partially applied.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
18
debounce.js
18
debounce.js
@@ -14,14 +14,18 @@ var nativeMax = Math.max,
|
||||
* milliseconds have elapsed since the last time the debounced function was
|
||||
* invoked. The debounced function comes with a `cancel` method to cancel
|
||||
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
||||
* Provide an options object to indicate whether `func` should be invoked on
|
||||
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
||||
* with the last arguments provided to the debounced function. Subsequent calls
|
||||
* to the debounced function return the result of the last `func` invocation.
|
||||
* Provide `options` to indicate whether `func` should be invoked on the
|
||||
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
||||
* with the last arguments provided to the debounced function. Subsequent
|
||||
* calls to the debounced function return the result of the last `func`
|
||||
* invocation.
|
||||
*
|
||||
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
|
||||
* on the trailing edge of the timeout only if the debounced function is
|
||||
* invoked more than once during the `wait` timeout.
|
||||
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
||||
* invoked on the trailing edge of the timeout only if the debounced function
|
||||
* is invoked more than once during the `wait` timeout.
|
||||
*
|
||||
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
||||
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
||||
*
|
||||
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
||||
* for details over the differences between `_.debounce` and `_.throttle`.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import baseInRange from './_baseInRange.js';
|
||||
import toFinite from './toFinite.js';
|
||||
import toNumber from './toNumber.js';
|
||||
|
||||
/**
|
||||
@@ -40,12 +41,12 @@ import toNumber from './toNumber.js';
|
||||
* // => true
|
||||
*/
|
||||
function inRange(number, start, end) {
|
||||
start = toNumber(start) || 0;
|
||||
start = toFinite(start);
|
||||
if (end === undefined) {
|
||||
end = start;
|
||||
start = 0;
|
||||
} else {
|
||||
end = toNumber(end) || 0;
|
||||
end = toFinite(end);
|
||||
}
|
||||
number = toNumber(number);
|
||||
return baseInRange(number, start, end);
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import freeGlobal from './_freeGlobal.js';
|
||||
import root from './_root.js';
|
||||
import stubFalse from './stubFalse.js';
|
||||
|
||||
/** Detect free variable `exports`. */
|
||||
var freeExports = freeGlobal && typeof exports == 'object' && exports;
|
||||
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
||||
|
||||
/** Detect free variable `module`. */
|
||||
var freeModule = freeExports && typeof module == 'object' && module;
|
||||
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
||||
|
||||
/** Detect the popular CommonJS extension `module.exports`. */
|
||||
var moduleExports = freeModule && freeModule.exports === freeExports;
|
||||
|
||||
@@ -3,10 +3,10 @@ import getMatchData from './_getMatchData.js';
|
||||
|
||||
/**
|
||||
* Performs a partial deep comparison between `object` and `source` to
|
||||
* determine if `object` contains equivalent property values. This method is
|
||||
* equivalent to a `_.matches` function when `source` is partially applied.
|
||||
* determine if `object` contains equivalent property values.
|
||||
*
|
||||
* **Note:** This method supports comparing the same values as `_.isEqual`.
|
||||
* **Note:** This method supports comparing the same values as `_.isEqual`
|
||||
* and is equivalent to `_.matches` when `source` is partially applied.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -45,7 +45,7 @@ import toInteger from './toInteger.js';
|
||||
import lodash from './wrapperLodash.js';
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.14.0';
|
||||
var VERSION = '4.14.1';
|
||||
|
||||
/** Used to compose bitmasks for function metadata. */
|
||||
var BIND_KEY_FLAG = 2;
|
||||
|
||||
@@ -4,10 +4,10 @@ import baseMatches from './_baseMatches.js';
|
||||
/**
|
||||
* Creates a function that performs a partial deep comparison between a given
|
||||
* object and `source`, returning `true` if the given object has equivalent
|
||||
* property values, else `false`. The created function is equivalent to
|
||||
* `_.isMatch` with a `source` partially applied.
|
||||
* property values, else `false`.
|
||||
*
|
||||
* **Note:** This method supports comparing the same values as `_.isEqual`.
|
||||
* **Note:** The created function supports comparing the same values as
|
||||
* `_.isEqual` is equivalent to `_.isMatch` with `source` partially applied.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash-es",
|
||||
"version": "4.14.0",
|
||||
"version": "4.14.1",
|
||||
"description": "Lodash exported as ES modules.",
|
||||
"keywords": "es6, modules, stdlib, util",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import baseRandom from './_baseRandom.js';
|
||||
import isIterateeCall from './_isIterateeCall.js';
|
||||
import toNumber from './toNumber.js';
|
||||
import toFinite from './toFinite.js';
|
||||
|
||||
/** Built-in method references without a dependency on `root`. */
|
||||
var freeParseFloat = parseFloat;
|
||||
@@ -59,12 +59,12 @@ function random(lower, upper, floating) {
|
||||
upper = 1;
|
||||
}
|
||||
else {
|
||||
lower = toNumber(lower) || 0;
|
||||
lower = toFinite(lower);
|
||||
if (upper === undefined) {
|
||||
upper = lower;
|
||||
lower = 0;
|
||||
} else {
|
||||
upper = toNumber(upper) || 0;
|
||||
upper = toFinite(upper);
|
||||
}
|
||||
}
|
||||
if (lower > upper) {
|
||||
|
||||
@@ -8,8 +8,8 @@ var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
* Creates a throttled function that only invokes `func` at most once per
|
||||
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
||||
* method to cancel delayed `func` invocations and a `flush` method to
|
||||
* immediately invoke them. Provide an options object to indicate whether
|
||||
* `func` should be invoked on the leading and/or trailing edge of the `wait`
|
||||
* immediately invoke them. Provide `options` to indicate whether `func`
|
||||
* should be invoked on the leading and/or trailing edge of the `wait`
|
||||
* timeout. The `func` is invoked with the last arguments provided to the
|
||||
* throttled function. Subsequent calls to the throttled function return the
|
||||
* result of the last `func` invocation.
|
||||
@@ -18,6 +18,9 @@ var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
* invoked on the trailing edge of the timeout only if the throttled function
|
||||
* is invoked more than once during the `wait` timeout.
|
||||
*
|
||||
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
||||
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
||||
*
|
||||
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
||||
* for details over the differences between `_.throttle` and `_.debounce`.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user