Bump to v4.11.1.

This commit is contained in:
John-David Dalton
2016-04-13 21:02:00 -07:00
parent 63d9a3fc42
commit 29c408ee8a
5 changed files with 31 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
# lodash-amd v4.11.0
# lodash-amd v4.11.1
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
@@ -27,4 +27,4 @@ require({
});
```
See the [package source](https://github.com/lodash/lodash/tree/4.11.0-amd) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.11.1-amd) for more details.

View File

@@ -63,12 +63,13 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
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') {
@@ -77,7 +78,8 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
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;
}
@@ -105,7 +107,7 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke);
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
@@ -116,7 +118,7 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
// 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() {
@@ -165,10 +167,12 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
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);

26
main.js
View File

@@ -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 exports="amd" -d -o ./main.js`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
@@ -13,7 +13,7 @@
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.11.0';
var VERSION = '4.11.1';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
@@ -9373,12 +9373,13 @@
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') {
@@ -9387,7 +9388,8 @@
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;
}
@@ -9415,7 +9417,7 @@
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke);
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
@@ -9426,7 +9428,7 @@
// 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() {
@@ -9475,10 +9477,12 @@
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);
@@ -14699,7 +14703,7 @@
object = this;
methodNames = baseFunctions(source, keys(source));
}
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) {

View File

@@ -40,7 +40,7 @@ define(['./_arrayEach', './_arrayPush', './_baseFunctions', './_copyArray', './i
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) {

View File

@@ -1,6 +1,6 @@
{
"name": "lodash-amd",
"version": "4.11.0",
"version": "4.11.1",
"description": "Lodash exported as AMD modules.",
"homepage": "https://lodash.com/custom-builds",
"license": "MIT",