mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
692aabae13 |
@@ -1,4 +1,4 @@
|
||||
# lodash-es v4.11.0
|
||||
# lodash-es v4.11.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.11.0-es) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.11.1-es) for more details.
|
||||
|
||||
20
debounce.js
20
debounce.js
@@ -62,12 +62,13 @@ var nativeMax = Math.max,
|
||||
function debounce(func, wait, options) {
|
||||
var lastArgs,
|
||||
lastThis,
|
||||
maxWait,
|
||||
result,
|
||||
timerId,
|
||||
lastCallTime = 0,
|
||||
lastInvokeTime = 0,
|
||||
leading = false,
|
||||
maxWait = false,
|
||||
maxing = false,
|
||||
trailing = true;
|
||||
|
||||
if (typeof func != 'function') {
|
||||
@@ -76,7 +77,8 @@ function debounce(func, wait, options) {
|
||||
wait = toNumber(wait) || 0;
|
||||
if (isObject(options)) {
|
||||
leading = !!options.leading;
|
||||
maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait);
|
||||
maxing = 'maxWait' in options;
|
||||
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
||||
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
||||
}
|
||||
|
||||
@@ -104,7 +106,7 @@ function debounce(func, wait, options) {
|
||||
timeSinceLastInvoke = time - lastInvokeTime,
|
||||
result = wait - timeSinceLastCall;
|
||||
|
||||
return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke);
|
||||
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
||||
}
|
||||
|
||||
function shouldInvoke(time) {
|
||||
@@ -115,7 +117,7 @@ function debounce(func, wait, options) {
|
||||
// trailing edge, the system time has gone backwards and we're treating
|
||||
// it as the trailing edge, or we've hit the `maxWait` limit.
|
||||
return (!lastCallTime || (timeSinceLastCall >= wait) ||
|
||||
(timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait));
|
||||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
||||
}
|
||||
|
||||
function timerExpired() {
|
||||
@@ -164,10 +166,12 @@ function debounce(func, wait, options) {
|
||||
if (timerId === undefined) {
|
||||
return leadingEdge(lastCallTime);
|
||||
}
|
||||
// Handle invocations in a tight loop.
|
||||
clearTimeout(timerId);
|
||||
timerId = setTimeout(timerExpired, wait);
|
||||
return invokeFunc(lastCallTime);
|
||||
if (maxing) {
|
||||
// Handle invocations in a tight loop.
|
||||
clearTimeout(timerId);
|
||||
timerId = setTimeout(timerExpired, wait);
|
||||
return invokeFunc(lastCallTime);
|
||||
}
|
||||
}
|
||||
if (timerId === undefined) {
|
||||
timerId = setTimeout(timerExpired, wait);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.11.0 (Custom Build) <https://lodash.com/>
|
||||
* lodash 4.11.1 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modularize exports="es" -o ./`
|
||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
@@ -44,7 +44,7 @@ import toInteger from './toInteger';
|
||||
import lodash from './wrapperLodash';
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.11.0';
|
||||
var VERSION = '4.11.1';
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_KEY_FLAG = 2;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.11.0 (Custom Build) <https://lodash.com/>
|
||||
* lodash 4.11.1 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modularize exports="es" -o ./`
|
||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
|
||||
2
mixin.js
2
mixin.js
@@ -46,7 +46,7 @@ function mixin(object, source, options) {
|
||||
var props = keys(source),
|
||||
methodNames = baseFunctions(source, props);
|
||||
|
||||
var chain = (isObject(options) && 'chain' in options) ? options.chain : true,
|
||||
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
|
||||
isFunc = isFunction(object);
|
||||
|
||||
arrayEach(methodNames, function(methodName) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash-es",
|
||||
"version": "4.11.0",
|
||||
"version": "4.11.1",
|
||||
"description": "Lodash exported as ES modules.",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
"license": "MIT",
|
||||
|
||||
Reference in New Issue
Block a user