lodash.debounce
Advanced tools
Comparing version 4.0.6 to 4.0.7
33
index.js
/** | ||
* lodash 4.0.6 (Custom Build) <https://lodash.com/> | ||
* lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -57,3 +57,2 @@ * Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* @since 2.4.0 | ||
* @type {Function} | ||
* @category Date | ||
@@ -66,5 +65,7 @@ * @returns {number} Returns the timestamp. | ||
* }, _.now()); | ||
* // => Logs the number of milliseconds it took for the deferred function to be invoked. | ||
* // => Logs the number of milliseconds it took for the deferred invocation. | ||
*/ | ||
var now = Date.now; | ||
function now() { | ||
return Date.now(); | ||
} | ||
@@ -127,3 +128,3 @@ /** | ||
timerId, | ||
lastCallTime = 0, | ||
lastCallTime, | ||
lastInvokeTime = 0, | ||
@@ -179,3 +180,3 @@ leading = false, | ||
// it as the trailing edge, or we've hit the `maxWait` limit. | ||
return (!lastCallTime || (timeSinceLastCall >= wait) || | ||
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || | ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); | ||
@@ -194,3 +195,2 @@ } | ||
function trailingEdge(time) { | ||
clearTimeout(timerId); | ||
timerId = undefined; | ||
@@ -211,4 +211,4 @@ | ||
} | ||
lastCallTime = lastInvokeTime = 0; | ||
lastArgs = lastThis = timerId = undefined; | ||
lastInvokeTime = 0; | ||
lastArgs = lastCallTime = lastThis = timerId = undefined; | ||
} | ||
@@ -234,3 +234,2 @@ | ||
// Handle invocations in a tight loop. | ||
clearTimeout(timerId); | ||
timerId = setTimeout(timerExpired, wait); | ||
@@ -258,4 +257,3 @@ return invokeFunc(lastCallTime); | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @returns {boolean} Returns `true` if `value` is a function, else `false`. | ||
* @example | ||
@@ -343,4 +341,3 @@ * | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`. | ||
* @example | ||
@@ -370,4 +367,4 @@ * | ||
* | ||
* _.toNumber(3); | ||
* // => 3 | ||
* _.toNumber(3.2); | ||
* // => 3.2 | ||
* | ||
@@ -380,4 +377,4 @@ * _.toNumber(Number.MIN_VALUE); | ||
* | ||
* _.toNumber('3'); | ||
* // => 3 | ||
* _.toNumber('3.2'); | ||
* // => 3.2 | ||
*/ | ||
@@ -384,0 +381,0 @@ function toNumber(value) { |
{ | ||
"name": "lodash.debounce", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"description": "The lodash method `_.debounce` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.debounce v4.0.6 | ||
# lodash.debounce v4.0.7 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.debounce` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.6-npm-packages/lodash.debounce) for more details. | ||
See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.7-npm-packages/lodash.debounce) for more details. |
14190
356