mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
48
react-app/node_modules/lodash/function/after.js
generated
vendored
Normal file
48
react-app/node_modules/lodash/function/after.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeIsFinite = global.isFinite;
|
||||
|
||||
/**
|
||||
* The opposite of `_.before`; this method creates a function that invokes
|
||||
* `func` once it's called `n` or more times.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {number} n The number of calls before `func` is invoked.
|
||||
* @param {Function} func The function to restrict.
|
||||
* @returns {Function} Returns the new restricted function.
|
||||
* @example
|
||||
*
|
||||
* var saves = ['profile', 'settings'];
|
||||
*
|
||||
* var done = _.after(saves.length, function() {
|
||||
* console.log('done saving!');
|
||||
* });
|
||||
*
|
||||
* _.forEach(saves, function(type) {
|
||||
* asyncSave({ 'type': type, 'complete': done });
|
||||
* });
|
||||
* // => logs 'done saving!' after the two async saves have completed
|
||||
*/
|
||||
function after(n, func) {
|
||||
if (typeof func != 'function') {
|
||||
if (typeof n == 'function') {
|
||||
var temp = n;
|
||||
n = func;
|
||||
func = temp;
|
||||
} else {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
}
|
||||
n = nativeIsFinite(n = +n) ? n : 0;
|
||||
return function() {
|
||||
if (--n < 1) {
|
||||
return func.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = after;
|
34
react-app/node_modules/lodash/function/ary.js
generated
vendored
Normal file
34
react-app/node_modules/lodash/function/ary.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
var createWrapper = require('../internal/createWrapper'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var ARY_FLAG = 128;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates a function that accepts up to `n` arguments ignoring any
|
||||
* additional arguments.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} [n=func.length] The arity cap.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
|
||||
* // => [6, 8, 10]
|
||||
*/
|
||||
function ary(func, n, guard) {
|
||||
if (guard && isIterateeCall(func, n, guard)) {
|
||||
n = undefined;
|
||||
}
|
||||
n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
|
||||
return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
|
||||
}
|
||||
|
||||
module.exports = ary;
|
1
react-app/node_modules/lodash/function/backflow.js
generated
vendored
Normal file
1
react-app/node_modules/lodash/function/backflow.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./flowRight');
|
42
react-app/node_modules/lodash/function/before.js
generated
vendored
Normal file
42
react-app/node_modules/lodash/function/before.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func`, with the `this` binding and arguments
|
||||
* of the created function, while it's called less than `n` times. Subsequent
|
||||
* calls to the created function return the result of the last `func` invocation.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {number} n The number of calls at which `func` is no longer invoked.
|
||||
* @param {Function} func The function to restrict.
|
||||
* @returns {Function} Returns the new restricted function.
|
||||
* @example
|
||||
*
|
||||
* jQuery('#add').on('click', _.before(5, addContactToList));
|
||||
* // => allows adding up to 4 contacts to the list
|
||||
*/
|
||||
function before(n, func) {
|
||||
var result;
|
||||
if (typeof func != 'function') {
|
||||
if (typeof n == 'function') {
|
||||
var temp = n;
|
||||
n = func;
|
||||
func = temp;
|
||||
} else {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
}
|
||||
return function() {
|
||||
if (--n > 0) {
|
||||
result = func.apply(this, arguments);
|
||||
}
|
||||
if (n <= 1) {
|
||||
func = undefined;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = before;
|
56
react-app/node_modules/lodash/function/bind.js
generated
vendored
Normal file
56
react-app/node_modules/lodash/function/bind.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
var createWrapper = require('../internal/createWrapper'),
|
||||
replaceHolders = require('../internal/replaceHolders'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
PARTIAL_FLAG = 32;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
||||
* and prepends any additional `_.bind` arguments to those provided to the
|
||||
* bound function.
|
||||
*
|
||||
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
||||
* may be used as a placeholder for partially applied arguments.
|
||||
*
|
||||
* **Note:** Unlike native `Function#bind` this method does not set the "length"
|
||||
* property of bound functions.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to bind.
|
||||
* @param {*} thisArg The `this` binding of `func`.
|
||||
* @param {...*} [partials] The arguments to be partially applied.
|
||||
* @returns {Function} Returns the new bound function.
|
||||
* @example
|
||||
*
|
||||
* var greet = function(greeting, punctuation) {
|
||||
* return greeting + ' ' + this.user + punctuation;
|
||||
* };
|
||||
*
|
||||
* var object = { 'user': 'fred' };
|
||||
*
|
||||
* var bound = _.bind(greet, object, 'hi');
|
||||
* bound('!');
|
||||
* // => 'hi fred!'
|
||||
*
|
||||
* // using placeholders
|
||||
* var bound = _.bind(greet, object, _, '!');
|
||||
* bound('hi');
|
||||
* // => 'hi fred!'
|
||||
*/
|
||||
var bind = restParam(function(func, thisArg, partials) {
|
||||
var bitmask = BIND_FLAG;
|
||||
if (partials.length) {
|
||||
var holders = replaceHolders(partials, bind.placeholder);
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(func, bitmask, thisArg, partials, holders);
|
||||
});
|
||||
|
||||
// Assign default placeholders.
|
||||
bind.placeholder = {};
|
||||
|
||||
module.exports = bind;
|
50
react-app/node_modules/lodash/function/bindAll.js
generated
vendored
Normal file
50
react-app/node_modules/lodash/function/bindAll.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
var baseFlatten = require('../internal/baseFlatten'),
|
||||
createWrapper = require('../internal/createWrapper'),
|
||||
functions = require('../object/functions'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Binds methods of an object to the object itself, overwriting the existing
|
||||
* method. Method names may be specified as individual arguments or as arrays
|
||||
* of method names. If no method names are provided all enumerable function
|
||||
* properties, own and inherited, of `object` are bound.
|
||||
*
|
||||
* **Note:** This method does not set the "length" property of bound functions.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Object} object The object to bind and assign the bound methods to.
|
||||
* @param {...(string|string[])} [methodNames] The object method names to bind,
|
||||
* specified as individual method names or arrays of method names.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() {
|
||||
* console.log('clicked ' + this.label);
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view);
|
||||
* jQuery('#docs').on('click', view.onClick);
|
||||
* // => logs 'clicked docs' when the element is clicked
|
||||
*/
|
||||
var bindAll = restParam(function(object, methodNames) {
|
||||
methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
|
||||
|
||||
var index = -1,
|
||||
length = methodNames.length;
|
||||
|
||||
while (++index < length) {
|
||||
var key = methodNames[index];
|
||||
object[key] = createWrapper(object[key], BIND_FLAG, object);
|
||||
}
|
||||
return object;
|
||||
});
|
||||
|
||||
module.exports = bindAll;
|
66
react-app/node_modules/lodash/function/bindKey.js
generated
vendored
Normal file
66
react-app/node_modules/lodash/function/bindKey.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
var createWrapper = require('../internal/createWrapper'),
|
||||
replaceHolders = require('../internal/replaceHolders'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
BIND_KEY_FLAG = 2,
|
||||
PARTIAL_FLAG = 32;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes the method at `object[key]` and prepends
|
||||
* any additional `_.bindKey` arguments to those provided to the bound function.
|
||||
*
|
||||
* This method differs from `_.bind` by allowing bound functions to reference
|
||||
* methods that may be redefined or don't yet exist.
|
||||
* See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
|
||||
* for more details.
|
||||
*
|
||||
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
|
||||
* builds, may be used as a placeholder for partially applied arguments.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Object} object The object the method belongs to.
|
||||
* @param {string} key The key of the method.
|
||||
* @param {...*} [partials] The arguments to be partially applied.
|
||||
* @returns {Function} Returns the new bound function.
|
||||
* @example
|
||||
*
|
||||
* var object = {
|
||||
* 'user': 'fred',
|
||||
* 'greet': function(greeting, punctuation) {
|
||||
* return greeting + ' ' + this.user + punctuation;
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* var bound = _.bindKey(object, 'greet', 'hi');
|
||||
* bound('!');
|
||||
* // => 'hi fred!'
|
||||
*
|
||||
* object.greet = function(greeting, punctuation) {
|
||||
* return greeting + 'ya ' + this.user + punctuation;
|
||||
* };
|
||||
*
|
||||
* bound('!');
|
||||
* // => 'hiya fred!'
|
||||
*
|
||||
* // using placeholders
|
||||
* var bound = _.bindKey(object, 'greet', _, '!');
|
||||
* bound('hi');
|
||||
* // => 'hiya fred!'
|
||||
*/
|
||||
var bindKey = restParam(function(object, key, partials) {
|
||||
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
|
||||
if (partials.length) {
|
||||
var holders = replaceHolders(partials, bindKey.placeholder);
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(key, bitmask, object, partials, holders);
|
||||
});
|
||||
|
||||
// Assign default placeholders.
|
||||
bindKey.placeholder = {};
|
||||
|
||||
module.exports = bindKey;
|
1
react-app/node_modules/lodash/function/compose.js
generated
vendored
Normal file
1
react-app/node_modules/lodash/function/compose.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./flowRight');
|
51
react-app/node_modules/lodash/function/curry.js
generated
vendored
Normal file
51
react-app/node_modules/lodash/function/curry.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
var createCurry = require('../internal/createCurry');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var CURRY_FLAG = 8;
|
||||
|
||||
/**
|
||||
* Creates a function that accepts one or more arguments of `func` that when
|
||||
* called either invokes `func` returning its result, if all `func` arguments
|
||||
* have been provided, or returns a function that accepts one or more of the
|
||||
* remaining `func` arguments, and so on. The arity of `func` may be specified
|
||||
* if `func.length` is not sufficient.
|
||||
*
|
||||
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
|
||||
* may be used as a placeholder for provided arguments.
|
||||
*
|
||||
* **Note:** This method does not set the "length" property of curried functions.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to curry.
|
||||
* @param {number} [arity=func.length] The arity of `func`.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Function} Returns the new curried function.
|
||||
* @example
|
||||
*
|
||||
* var abc = function(a, b, c) {
|
||||
* return [a, b, c];
|
||||
* };
|
||||
*
|
||||
* var curried = _.curry(abc);
|
||||
*
|
||||
* curried(1)(2)(3);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* curried(1, 2)(3);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* curried(1, 2, 3);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* // using placeholders
|
||||
* curried(1)(_, 3)(2);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
var curry = createCurry(CURRY_FLAG);
|
||||
|
||||
// Assign default placeholders.
|
||||
curry.placeholder = {};
|
||||
|
||||
module.exports = curry;
|
48
react-app/node_modules/lodash/function/curryRight.js
generated
vendored
Normal file
48
react-app/node_modules/lodash/function/curryRight.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
var createCurry = require('../internal/createCurry');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var CURRY_RIGHT_FLAG = 16;
|
||||
|
||||
/**
|
||||
* This method is like `_.curry` except that arguments are applied to `func`
|
||||
* in the manner of `_.partialRight` instead of `_.partial`.
|
||||
*
|
||||
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
|
||||
* builds, may be used as a placeholder for provided arguments.
|
||||
*
|
||||
* **Note:** This method does not set the "length" property of curried functions.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to curry.
|
||||
* @param {number} [arity=func.length] The arity of `func`.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Function} Returns the new curried function.
|
||||
* @example
|
||||
*
|
||||
* var abc = function(a, b, c) {
|
||||
* return [a, b, c];
|
||||
* };
|
||||
*
|
||||
* var curried = _.curryRight(abc);
|
||||
*
|
||||
* curried(3)(2)(1);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* curried(2, 3)(1);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* curried(1, 2, 3);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* // using placeholders
|
||||
* curried(3)(1, _)(2);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
var curryRight = createCurry(CURRY_RIGHT_FLAG);
|
||||
|
||||
// Assign default placeholders.
|
||||
curryRight.placeholder = {};
|
||||
|
||||
module.exports = curryRight;
|
181
react-app/node_modules/lodash/function/debounce.js
generated
vendored
Normal file
181
react-app/node_modules/lodash/function/debounce.js
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
var isObject = require('../lang/isObject'),
|
||||
now = require('../date/now');
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates a debounced function that delays invoking `func` until after `wait`
|
||||
* milliseconds have elapsed since the last time the debounced function was
|
||||
* invoked. The debounced function comes with a `cancel` method to cancel
|
||||
* delayed invocations. Provide an options object to indicate that `func`
|
||||
* should be invoked on the leading and/or trailing edge of the `wait` timeout.
|
||||
* 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 the debounced function is
|
||||
* invoked more than once during the `wait` timeout.
|
||||
*
|
||||
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
|
||||
* for details over the differences between `_.debounce` and `_.throttle`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to debounce.
|
||||
* @param {number} [wait=0] The number of milliseconds to delay.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.leading=false] Specify invoking on the leading
|
||||
* edge of the timeout.
|
||||
* @param {number} [options.maxWait] The maximum time `func` is allowed to be
|
||||
* delayed before it's invoked.
|
||||
* @param {boolean} [options.trailing=true] Specify invoking on the trailing
|
||||
* edge of the timeout.
|
||||
* @returns {Function} Returns the new debounced function.
|
||||
* @example
|
||||
*
|
||||
* // avoid costly calculations while the window size is in flux
|
||||
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
||||
*
|
||||
* // invoke `sendMail` when the click event is fired, debouncing subsequent calls
|
||||
* jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
|
||||
* 'leading': true,
|
||||
* 'trailing': false
|
||||
* }));
|
||||
*
|
||||
* // ensure `batchLog` is invoked once after 1 second of debounced calls
|
||||
* var source = new EventSource('/stream');
|
||||
* jQuery(source).on('message', _.debounce(batchLog, 250, {
|
||||
* 'maxWait': 1000
|
||||
* }));
|
||||
*
|
||||
* // cancel a debounced call
|
||||
* var todoChanges = _.debounce(batchLog, 1000);
|
||||
* Object.observe(models.todo, todoChanges);
|
||||
*
|
||||
* Object.observe(models, function(changes) {
|
||||
* if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
|
||||
* todoChanges.cancel();
|
||||
* }
|
||||
* }, ['delete']);
|
||||
*
|
||||
* // ...at some point `models.todo` is changed
|
||||
* models.todo.completed = true;
|
||||
*
|
||||
* // ...before 1 second has passed `models.todo` is deleted
|
||||
* // which cancels the debounced `todoChanges` call
|
||||
* delete models.todo;
|
||||
*/
|
||||
function debounce(func, wait, options) {
|
||||
var args,
|
||||
maxTimeoutId,
|
||||
result,
|
||||
stamp,
|
||||
thisArg,
|
||||
timeoutId,
|
||||
trailingCall,
|
||||
lastCalled = 0,
|
||||
maxWait = false,
|
||||
trailing = true;
|
||||
|
||||
if (typeof func != 'function') {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
wait = wait < 0 ? 0 : (+wait || 0);
|
||||
if (options === true) {
|
||||
var leading = true;
|
||||
trailing = false;
|
||||
} else if (isObject(options)) {
|
||||
leading = !!options.leading;
|
||||
maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
|
||||
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
if (maxTimeoutId) {
|
||||
clearTimeout(maxTimeoutId);
|
||||
}
|
||||
lastCalled = 0;
|
||||
maxTimeoutId = timeoutId = trailingCall = undefined;
|
||||
}
|
||||
|
||||
function complete(isCalled, id) {
|
||||
if (id) {
|
||||
clearTimeout(id);
|
||||
}
|
||||
maxTimeoutId = timeoutId = trailingCall = undefined;
|
||||
if (isCalled) {
|
||||
lastCalled = now();
|
||||
result = func.apply(thisArg, args);
|
||||
if (!timeoutId && !maxTimeoutId) {
|
||||
args = thisArg = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function delayed() {
|
||||
var remaining = wait - (now() - stamp);
|
||||
if (remaining <= 0 || remaining > wait) {
|
||||
complete(trailingCall, maxTimeoutId);
|
||||
} else {
|
||||
timeoutId = setTimeout(delayed, remaining);
|
||||
}
|
||||
}
|
||||
|
||||
function maxDelayed() {
|
||||
complete(trailing, timeoutId);
|
||||
}
|
||||
|
||||
function debounced() {
|
||||
args = arguments;
|
||||
stamp = now();
|
||||
thisArg = this;
|
||||
trailingCall = trailing && (timeoutId || !leading);
|
||||
|
||||
if (maxWait === false) {
|
||||
var leadingCall = leading && !timeoutId;
|
||||
} else {
|
||||
if (!maxTimeoutId && !leading) {
|
||||
lastCalled = stamp;
|
||||
}
|
||||
var remaining = maxWait - (stamp - lastCalled),
|
||||
isCalled = remaining <= 0 || remaining > maxWait;
|
||||
|
||||
if (isCalled) {
|
||||
if (maxTimeoutId) {
|
||||
maxTimeoutId = clearTimeout(maxTimeoutId);
|
||||
}
|
||||
lastCalled = stamp;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
else if (!maxTimeoutId) {
|
||||
maxTimeoutId = setTimeout(maxDelayed, remaining);
|
||||
}
|
||||
}
|
||||
if (isCalled && timeoutId) {
|
||||
timeoutId = clearTimeout(timeoutId);
|
||||
}
|
||||
else if (!timeoutId && wait !== maxWait) {
|
||||
timeoutId = setTimeout(delayed, wait);
|
||||
}
|
||||
if (leadingCall) {
|
||||
isCalled = true;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
if (isCalled && !timeoutId && !maxTimeoutId) {
|
||||
args = thisArg = undefined;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
debounced.cancel = cancel;
|
||||
return debounced;
|
||||
}
|
||||
|
||||
module.exports = debounce;
|
25
react-app/node_modules/lodash/function/defer.js
generated
vendored
Normal file
25
react-app/node_modules/lodash/function/defer.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
var baseDelay = require('../internal/baseDelay'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/**
|
||||
* Defers invoking the `func` until the current call stack has cleared. Any
|
||||
* additional arguments are provided to `func` when it's invoked.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to defer.
|
||||
* @param {...*} [args] The arguments to invoke the function with.
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.defer(function(text) {
|
||||
* console.log(text);
|
||||
* }, 'deferred');
|
||||
* // logs 'deferred' after one or more milliseconds
|
||||
*/
|
||||
var defer = restParam(function(func, args) {
|
||||
return baseDelay(func, 1, args);
|
||||
});
|
||||
|
||||
module.exports = defer;
|
26
react-app/node_modules/lodash/function/delay.js
generated
vendored
Normal file
26
react-app/node_modules/lodash/function/delay.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
var baseDelay = require('../internal/baseDelay'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/**
|
||||
* Invokes `func` after `wait` milliseconds. Any additional arguments are
|
||||
* provided to `func` when it's invoked.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to delay.
|
||||
* @param {number} wait The number of milliseconds to delay invocation.
|
||||
* @param {...*} [args] The arguments to invoke the function with.
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.delay(function(text) {
|
||||
* console.log(text);
|
||||
* }, 1000, 'later');
|
||||
* // => logs 'later' after one second
|
||||
*/
|
||||
var delay = restParam(function(func, wait, args) {
|
||||
return baseDelay(func, wait, args);
|
||||
});
|
||||
|
||||
module.exports = delay;
|
25
react-app/node_modules/lodash/function/flow.js
generated
vendored
Normal file
25
react-app/node_modules/lodash/function/flow.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
var createFlow = require('../internal/createFlow');
|
||||
|
||||
/**
|
||||
* Creates a function that returns the result of invoking the provided
|
||||
* functions with the `this` binding of the created function, where each
|
||||
* successive invocation is supplied the return value of the previous.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {...Function} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flow(_.add, square);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flow = createFlow();
|
||||
|
||||
module.exports = flow;
|
25
react-app/node_modules/lodash/function/flowRight.js
generated
vendored
Normal file
25
react-app/node_modules/lodash/function/flowRight.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
var createFlow = require('../internal/createFlow');
|
||||
|
||||
/**
|
||||
* This method is like `_.flow` except that it creates a function that
|
||||
* invokes the provided functions from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias backflow, compose
|
||||
* @category Function
|
||||
* @param {...Function} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flowRight(square, _.add);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flowRight = createFlow(true);
|
||||
|
||||
module.exports = flowRight;
|
80
react-app/node_modules/lodash/function/memoize.js
generated
vendored
Normal file
80
react-app/node_modules/lodash/function/memoize.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
var MapCache = require('../internal/MapCache');
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/**
|
||||
* Creates a function that memoizes the result of `func`. If `resolver` is
|
||||
* provided it determines the cache key for storing the result based on the
|
||||
* arguments provided to the memoized function. By default, the first argument
|
||||
* provided to the memoized function is coerced to a string and used as the
|
||||
* cache key. The `func` is invoked with the `this` binding of the memoized
|
||||
* function.
|
||||
*
|
||||
* **Note:** The cache is exposed as the `cache` property on the memoized
|
||||
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
||||
* constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
|
||||
* method interface of `get`, `has`, and `set`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to have its output memoized.
|
||||
* @param {Function} [resolver] The function to resolve the cache key.
|
||||
* @returns {Function} Returns the new memoizing function.
|
||||
* @example
|
||||
*
|
||||
* var upperCase = _.memoize(function(string) {
|
||||
* return string.toUpperCase();
|
||||
* });
|
||||
*
|
||||
* upperCase('fred');
|
||||
* // => 'FRED'
|
||||
*
|
||||
* // modifying the result cache
|
||||
* upperCase.cache.set('fred', 'BARNEY');
|
||||
* upperCase('fred');
|
||||
* // => 'BARNEY'
|
||||
*
|
||||
* // replacing `_.memoize.Cache`
|
||||
* var object = { 'user': 'fred' };
|
||||
* var other = { 'user': 'barney' };
|
||||
* var identity = _.memoize(_.identity);
|
||||
*
|
||||
* identity(object);
|
||||
* // => { 'user': 'fred' }
|
||||
* identity(other);
|
||||
* // => { 'user': 'fred' }
|
||||
*
|
||||
* _.memoize.Cache = WeakMap;
|
||||
* var identity = _.memoize(_.identity);
|
||||
*
|
||||
* identity(object);
|
||||
* // => { 'user': 'fred' }
|
||||
* identity(other);
|
||||
* // => { 'user': 'barney' }
|
||||
*/
|
||||
function memoize(func, resolver) {
|
||||
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
var memoized = function() {
|
||||
var args = arguments,
|
||||
key = resolver ? resolver.apply(this, args) : args[0],
|
||||
cache = memoized.cache;
|
||||
|
||||
if (cache.has(key)) {
|
||||
return cache.get(key);
|
||||
}
|
||||
var result = func.apply(this, args);
|
||||
memoized.cache = cache.set(key, result);
|
||||
return result;
|
||||
};
|
||||
memoized.cache = new memoize.Cache;
|
||||
return memoized;
|
||||
}
|
||||
|
||||
// Assign cache to `_.memoize`.
|
||||
memoize.Cache = MapCache;
|
||||
|
||||
module.exports = memoize;
|
58
react-app/node_modules/lodash/function/modArgs.js
generated
vendored
Normal file
58
react-app/node_modules/lodash/function/modArgs.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
var arrayEvery = require('../internal/arrayEvery'),
|
||||
baseFlatten = require('../internal/baseFlatten'),
|
||||
baseIsFunction = require('../internal/baseIsFunction'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* Creates a function that runs each argument through a corresponding
|
||||
* transform function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {...(Function|Function[])} [transforms] The functions to transform
|
||||
* arguments, specified as individual functions or arrays of functions.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function doubled(n) {
|
||||
* return n * 2;
|
||||
* }
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var modded = _.modArgs(function(x, y) {
|
||||
* return [x, y];
|
||||
* }, square, doubled);
|
||||
*
|
||||
* modded(1, 2);
|
||||
* // => [1, 4]
|
||||
*
|
||||
* modded(5, 10);
|
||||
* // => [25, 20]
|
||||
*/
|
||||
var modArgs = restParam(function(func, transforms) {
|
||||
transforms = baseFlatten(transforms);
|
||||
if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
var length = transforms.length;
|
||||
return restParam(function(args) {
|
||||
var index = nativeMin(args.length, length);
|
||||
while (index--) {
|
||||
args[index] = transforms[index](args[index]);
|
||||
}
|
||||
return func.apply(this, args);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = modArgs;
|
32
react-app/node_modules/lodash/function/negate.js
generated
vendored
Normal file
32
react-app/node_modules/lodash/function/negate.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/**
|
||||
* Creates a function that negates the result of the predicate `func`. The
|
||||
* `func` predicate is invoked with the `this` binding and arguments of the
|
||||
* created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} predicate The predicate to negate.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function isEven(n) {
|
||||
* return n % 2 == 0;
|
||||
* }
|
||||
*
|
||||
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
|
||||
* // => [1, 3, 5]
|
||||
*/
|
||||
function negate(predicate) {
|
||||
if (typeof predicate != 'function') {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
return function() {
|
||||
return !predicate.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = negate;
|
24
react-app/node_modules/lodash/function/once.js
generated
vendored
Normal file
24
react-app/node_modules/lodash/function/once.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
var before = require('./before');
|
||||
|
||||
/**
|
||||
* Creates a function that is restricted to invoking `func` once. Repeat calls
|
||||
* to the function return the value of the first call. The `func` is invoked
|
||||
* with the `this` binding and arguments of the created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to restrict.
|
||||
* @returns {Function} Returns the new restricted function.
|
||||
* @example
|
||||
*
|
||||
* var initialize = _.once(createApplication);
|
||||
* initialize();
|
||||
* initialize();
|
||||
* // `initialize` invokes `createApplication` once
|
||||
*/
|
||||
function once(func) {
|
||||
return before(2, func);
|
||||
}
|
||||
|
||||
module.exports = once;
|
43
react-app/node_modules/lodash/function/partial.js
generated
vendored
Normal file
43
react-app/node_modules/lodash/function/partial.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
var createPartial = require('../internal/createPartial');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var PARTIAL_FLAG = 32;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with `partial` arguments prepended
|
||||
* to those provided to the new function. This method is like `_.bind` except
|
||||
* it does **not** alter the `this` binding.
|
||||
*
|
||||
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
|
||||
* builds, may be used as a placeholder for partially applied arguments.
|
||||
*
|
||||
* **Note:** This method does not set the "length" property of partially
|
||||
* applied functions.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to partially apply arguments to.
|
||||
* @param {...*} [partials] The arguments to be partially applied.
|
||||
* @returns {Function} Returns the new partially applied function.
|
||||
* @example
|
||||
*
|
||||
* var greet = function(greeting, name) {
|
||||
* return greeting + ' ' + name;
|
||||
* };
|
||||
*
|
||||
* var sayHelloTo = _.partial(greet, 'hello');
|
||||
* sayHelloTo('fred');
|
||||
* // => 'hello fred'
|
||||
*
|
||||
* // using placeholders
|
||||
* var greetFred = _.partial(greet, _, 'fred');
|
||||
* greetFred('hi');
|
||||
* // => 'hi fred'
|
||||
*/
|
||||
var partial = createPartial(PARTIAL_FLAG);
|
||||
|
||||
// Assign default placeholders.
|
||||
partial.placeholder = {};
|
||||
|
||||
module.exports = partial;
|
42
react-app/node_modules/lodash/function/partialRight.js
generated
vendored
Normal file
42
react-app/node_modules/lodash/function/partialRight.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
var createPartial = require('../internal/createPartial');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var PARTIAL_RIGHT_FLAG = 64;
|
||||
|
||||
/**
|
||||
* This method is like `_.partial` except that partially applied arguments
|
||||
* are appended to those provided to the new function.
|
||||
*
|
||||
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
|
||||
* builds, may be used as a placeholder for partially applied arguments.
|
||||
*
|
||||
* **Note:** This method does not set the "length" property of partially
|
||||
* applied functions.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to partially apply arguments to.
|
||||
* @param {...*} [partials] The arguments to be partially applied.
|
||||
* @returns {Function} Returns the new partially applied function.
|
||||
* @example
|
||||
*
|
||||
* var greet = function(greeting, name) {
|
||||
* return greeting + ' ' + name;
|
||||
* };
|
||||
*
|
||||
* var greetFred = _.partialRight(greet, 'fred');
|
||||
* greetFred('hi');
|
||||
* // => 'hi fred'
|
||||
*
|
||||
* // using placeholders
|
||||
* var sayHelloTo = _.partialRight(greet, 'hello', _);
|
||||
* sayHelloTo('fred');
|
||||
* // => 'hello fred'
|
||||
*/
|
||||
var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
|
||||
|
||||
// Assign default placeholders.
|
||||
partialRight.placeholder = {};
|
||||
|
||||
module.exports = partialRight;
|
40
react-app/node_modules/lodash/function/rearg.js
generated
vendored
Normal file
40
react-app/node_modules/lodash/function/rearg.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
var baseFlatten = require('../internal/baseFlatten'),
|
||||
createWrapper = require('../internal/createWrapper'),
|
||||
restParam = require('./restParam');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var REARG_FLAG = 256;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with arguments arranged according
|
||||
* to the specified indexes where the argument value at the first index is
|
||||
* provided as the first argument, the argument value at the second index is
|
||||
* provided as the second argument, and so on.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to rearrange arguments for.
|
||||
* @param {...(number|number[])} indexes The arranged argument indexes,
|
||||
* specified as individual indexes or arrays of indexes.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var rearged = _.rearg(function(a, b, c) {
|
||||
* return [a, b, c];
|
||||
* }, 2, 0, 1);
|
||||
*
|
||||
* rearged('b', 'c', 'a')
|
||||
* // => ['a', 'b', 'c']
|
||||
*
|
||||
* var map = _.rearg(_.map, [1, 0]);
|
||||
* map(function(n) {
|
||||
* return n * 3;
|
||||
* }, [1, 2, 3]);
|
||||
* // => [3, 6, 9]
|
||||
*/
|
||||
var rearg = restParam(function(func, indexes) {
|
||||
return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
|
||||
});
|
||||
|
||||
module.exports = rearg;
|
58
react-app/node_modules/lodash/function/restParam.js
generated
vendored
Normal file
58
react-app/node_modules/lodash/function/restParam.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with the `this` binding of the
|
||||
* created function and arguments from `start` and beyond provided as an array.
|
||||
*
|
||||
* **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to apply a rest parameter to.
|
||||
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var say = _.restParam(function(what, names) {
|
||||
* return what + ' ' + _.initial(names).join(', ') +
|
||||
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
|
||||
* });
|
||||
*
|
||||
* say('hello', 'fred', 'barney', 'pebbles');
|
||||
* // => 'hello fred, barney, & pebbles'
|
||||
*/
|
||||
function restParam(func, start) {
|
||||
if (typeof func != 'function') {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
|
||||
return function() {
|
||||
var args = arguments,
|
||||
index = -1,
|
||||
length = nativeMax(args.length - start, 0),
|
||||
rest = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
rest[index] = args[start + index];
|
||||
}
|
||||
switch (start) {
|
||||
case 0: return func.call(this, rest);
|
||||
case 1: return func.call(this, args[0], rest);
|
||||
case 2: return func.call(this, args[0], args[1], rest);
|
||||
}
|
||||
var otherArgs = Array(start + 1);
|
||||
index = -1;
|
||||
while (++index < start) {
|
||||
otherArgs[index] = args[index];
|
||||
}
|
||||
otherArgs[start] = rest;
|
||||
return func.apply(this, otherArgs);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = restParam;
|
44
react-app/node_modules/lodash/function/spread.js
generated
vendored
Normal file
44
react-app/node_modules/lodash/function/spread.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with the `this` binding of the created
|
||||
* function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
|
||||
*
|
||||
* **Note:** This method is based on the [spread operator](https://developer.mozilla.org/Web/JavaScript/Reference/Operators/Spread_operator).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to spread arguments over.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var say = _.spread(function(who, what) {
|
||||
* return who + ' says ' + what;
|
||||
* });
|
||||
*
|
||||
* say(['fred', 'hello']);
|
||||
* // => 'fred says hello'
|
||||
*
|
||||
* // with a Promise
|
||||
* var numbers = Promise.all([
|
||||
* Promise.resolve(40),
|
||||
* Promise.resolve(36)
|
||||
* ]);
|
||||
*
|
||||
* numbers.then(_.spread(function(x, y) {
|
||||
* return x + y;
|
||||
* }));
|
||||
* // => a Promise of 76
|
||||
*/
|
||||
function spread(func) {
|
||||
if (typeof func != 'function') {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
return function(array) {
|
||||
return func.apply(this, array);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = spread;
|
62
react-app/node_modules/lodash/function/throttle.js
generated
vendored
Normal file
62
react-app/node_modules/lodash/function/throttle.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
var debounce = require('./debounce'),
|
||||
isObject = require('../lang/isObject');
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
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 invocations. Provide an options object to indicate
|
||||
* that `func` should be invoked on the leading and/or trailing edge of the
|
||||
* `wait` timeout. Subsequent calls to the throttled function return the
|
||||
* result of the last `func` call.
|
||||
*
|
||||
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
|
||||
* on the trailing edge of the timeout only if the the throttled function is
|
||||
* invoked more than once during the `wait` timeout.
|
||||
*
|
||||
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
|
||||
* for details over the differences between `_.throttle` and `_.debounce`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to throttle.
|
||||
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.leading=true] Specify invoking on the leading
|
||||
* edge of the timeout.
|
||||
* @param {boolean} [options.trailing=true] Specify invoking on the trailing
|
||||
* edge of the timeout.
|
||||
* @returns {Function} Returns the new throttled function.
|
||||
* @example
|
||||
*
|
||||
* // avoid excessively updating the position while scrolling
|
||||
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
||||
*
|
||||
* // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
|
||||
* jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
|
||||
* 'trailing': false
|
||||
* }));
|
||||
*
|
||||
* // cancel a trailing throttled call
|
||||
* jQuery(window).on('popstate', throttled.cancel);
|
||||
*/
|
||||
function throttle(func, wait, options) {
|
||||
var leading = true,
|
||||
trailing = true;
|
||||
|
||||
if (typeof func != 'function') {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
if (options === false) {
|
||||
leading = false;
|
||||
} else if (isObject(options)) {
|
||||
leading = 'leading' in options ? !!options.leading : leading;
|
||||
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
||||
}
|
||||
return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });
|
||||
}
|
||||
|
||||
module.exports = throttle;
|
33
react-app/node_modules/lodash/function/wrap.js
generated
vendored
Normal file
33
react-app/node_modules/lodash/function/wrap.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var createWrapper = require('../internal/createWrapper'),
|
||||
identity = require('../utility/identity');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var PARTIAL_FLAG = 32;
|
||||
|
||||
/**
|
||||
* Creates a function that provides `value` to the wrapper function as its
|
||||
* first argument. Any additional arguments provided to the function are
|
||||
* appended to those provided to the wrapper function. The wrapper is invoked
|
||||
* with the `this` binding of the created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {*} value The value to wrap.
|
||||
* @param {Function} wrapper The wrapper function.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var p = _.wrap(_.escape, function(func, text) {
|
||||
* return '<p>' + func(text) + '</p>';
|
||||
* });
|
||||
*
|
||||
* p('fred, barney, & pebbles');
|
||||
* // => '<p>fred, barney, & pebbles</p>'
|
||||
*/
|
||||
function wrap(value, wrapper) {
|
||||
wrapper = wrapper == null ? identity : wrapper;
|
||||
return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
|
||||
}
|
||||
|
||||
module.exports = wrap;
|
Reference in New Issue
Block a user