Compare commits

..

1 Commits

Author SHA1 Message Date
John-David Dalton
29c408ee8a Bump to v4.11.1. 2016-04-13 21:02:00 -07:00
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. 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) { function debounce(func, wait, options) {
var lastArgs, var lastArgs,
lastThis, lastThis,
maxWait,
result, result,
timerId, timerId,
lastCallTime = 0, lastCallTime = 0,
lastInvokeTime = 0, lastInvokeTime = 0,
leading = false, leading = false,
maxWait = false, maxing = false,
trailing = true; trailing = true;
if (typeof func != 'function') { if (typeof func != 'function') {
@@ -77,7 +78,8 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
wait = toNumber(wait) || 0; wait = toNumber(wait) || 0;
if (isObject(options)) { if (isObject(options)) {
leading = !!options.leading; 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; trailing = 'trailing' in options ? !!options.trailing : trailing;
} }
@@ -105,7 +107,7 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
timeSinceLastInvoke = time - lastInvokeTime, timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall; result = wait - timeSinceLastCall;
return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke); return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
} }
function shouldInvoke(time) { 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 // trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit. // it as the trailing edge, or we've hit the `maxWait` limit.
return (!lastCallTime || (timeSinceLastCall >= wait) || return (!lastCallTime || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait)); (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
} }
function timerExpired() { function timerExpired() {
@@ -165,10 +167,12 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
if (timerId === undefined) { if (timerId === undefined) {
return leadingEdge(lastCallTime); return leadingEdge(lastCallTime);
} }
// Handle invocations in a tight loop. if (maxing) {
clearTimeout(timerId); // Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait); clearTimeout(timerId);
return invokeFunc(lastCallTime); timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
} }
if (timerId === undefined) { if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait); timerId = setTimeout(timerExpired, wait);

26
main.js
View File

@@ -1,6 +1,6 @@
/** /**
* @license * @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` * Build: `lodash exports="amd" -d -o ./main.js`
* Copyright jQuery Foundation and other contributors <https://jquery.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license> * Released under MIT license <https://lodash.com/license>
@@ -13,7 +13,7 @@
var undefined; var undefined;
/** Used as the semantic version number. */ /** 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. */ /** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200; var LARGE_ARRAY_SIZE = 200;
@@ -9373,12 +9373,13 @@
function debounce(func, wait, options) { function debounce(func, wait, options) {
var lastArgs, var lastArgs,
lastThis, lastThis,
maxWait,
result, result,
timerId, timerId,
lastCallTime = 0, lastCallTime = 0,
lastInvokeTime = 0, lastInvokeTime = 0,
leading = false, leading = false,
maxWait = false, maxing = false,
trailing = true; trailing = true;
if (typeof func != 'function') { if (typeof func != 'function') {
@@ -9387,7 +9388,8 @@
wait = toNumber(wait) || 0; wait = toNumber(wait) || 0;
if (isObject(options)) { if (isObject(options)) {
leading = !!options.leading; 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; trailing = 'trailing' in options ? !!options.trailing : trailing;
} }
@@ -9415,7 +9417,7 @@
timeSinceLastInvoke = time - lastInvokeTime, timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall; result = wait - timeSinceLastCall;
return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke); return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
} }
function shouldInvoke(time) { function shouldInvoke(time) {
@@ -9426,7 +9428,7 @@
// trailing edge, the system time has gone backwards and we're treating // trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit. // it as the trailing edge, or we've hit the `maxWait` limit.
return (!lastCallTime || (timeSinceLastCall >= wait) || return (!lastCallTime || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait)); (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
} }
function timerExpired() { function timerExpired() {
@@ -9475,10 +9477,12 @@
if (timerId === undefined) { if (timerId === undefined) {
return leadingEdge(lastCallTime); return leadingEdge(lastCallTime);
} }
// Handle invocations in a tight loop. if (maxing) {
clearTimeout(timerId); // Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait); clearTimeout(timerId);
return invokeFunc(lastCallTime); timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
} }
if (timerId === undefined) { if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait); timerId = setTimeout(timerExpired, wait);
@@ -14699,7 +14703,7 @@
object = this; object = this;
methodNames = baseFunctions(source, keys(source)); 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); isFunc = isFunction(object);
arrayEach(methodNames, function(methodName) { arrayEach(methodNames, function(methodName) {

View File

@@ -40,7 +40,7 @@ define(['./_arrayEach', './_arrayPush', './_baseFunctions', './_copyArray', './i
var props = keys(source), var props = keys(source),
methodNames = baseFunctions(source, props); 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); isFunc = isFunction(object);
arrayEach(methodNames, function(methodName) { arrayEach(methodNames, function(methodName) {

View File

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