From 38c57a662cc5ff191e966bad52430b1747143e47 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Aug 2014 21:34:59 -0700 Subject: [PATCH] Rebuild dist. --- dist/lodash.compat.js | 709 ++++++++++++++++++---------------- dist/lodash.compat.min.js | 140 +++---- dist/lodash.js | 650 ++++++++++++++++--------------- dist/lodash.min.js | 128 +++--- dist/lodash.underscore.js | 383 +++++++++--------- dist/lodash.underscore.min.js | 54 +-- 6 files changed, 1053 insertions(+), 1011 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 73d98faad..1b52aa206 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -216,7 +216,7 @@ * **Note:** Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't require escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. - * See [Mathias' article](http://mathiasbynens.be/notes/ambiguous-ampersands) + * See [Mathias Bynens's article](http://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * Backticks are escaped because in Internet Explorer < 9, they can break out @@ -493,7 +493,7 @@ * given string. * * @private - * @param {Function} callback The function called to combine each word. + * @param {Function} callback The function invoked to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { @@ -545,6 +545,26 @@ return '\\' + stringEscapes[chr]; } + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + var isHostObject = (function() { + try { + ({ 'toString': 0 } + ''); + } catch(e) { + return function() { return false; }; + } + return function(value) { + // IE < 9 presents many host objects as `Object` objects that can coerce to + // strings despite having improperly defined `toString` methods + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + }; + }()); + /** * Used by `_.trimmedLeftIndex` and `_.trimmedRightIndex` to determine if a * character code is whitespace. @@ -774,25 +794,25 @@ * * The chainable wrapper functions are: * `after`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `callback`, - * `chain`, `chunk`, `compact`, `compose`, `concat`, `constant`, `countBy`, - * `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, - * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, - * `flattenDeep`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, - * `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, `matches`, `memoize`, - * `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, `pairs`, `partial`, - * `partialRight`, `partition`, `pick`, `pluck`, `property`, `pull`, `pullAt`, - * `push`, `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, - * `sort`, `sortBy`, `splice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, - * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, - * `unzip`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, - * and `zipObject` + * `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `drop`, + * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, `flattenDeep`, + * `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, + * `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, + * `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, + * `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, + * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `pluck`, `property`, + * `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, `rest`, `reverse`, + * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `times`, `toArray`, + * `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, + * `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` * * The non-chainable wrapper functions are: * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `contains`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, - * `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, + * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, + * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, + * `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, * `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, `isFunction`, * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, @@ -921,6 +941,14 @@ */ support.funcNames = typeof Function.name == 'string'; + /** + * Detect if the `[[Class]]` of DOM nodes is resolvable (all but IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.nodeClass = toString.call(document) != objectClass; + /** * Detect if string indexes are non-enumerable * (IE < 9, RingoJS, Rhino, Narwhal). @@ -990,26 +1018,6 @@ support.dom = false; } - /** - * Detect if the host objects are detectable (IE < 9). - * - * @memberOf _.support - * @type boolean - */ - try { - support.hostObject = !({ 'toString': 0 } + ''); - } catch(e) { - support.hostObject = false; - } - - /** - * Detect if the `[[Class]]` of DOM nodes is resolvable (all but IE < 9). - * - * @memberOf _.support - * @type boolean - */ - support.nodeClass = !(toString.call(document) == objectClass && support.hostObject); - /** * Detect if `arguments` object indexes are non-enumerable. * @@ -1098,7 +1106,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { @@ -1119,7 +1127,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { @@ -1139,7 +1147,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns `true` if all elements passed the predicate check, * else `false` */ @@ -1161,7 +1169,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { @@ -1181,7 +1189,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { @@ -1205,7 +1213,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray=false] Specify using the first element of * `array` as the initial value. @@ -1230,7 +1238,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray=false] Specify using the last element of * `array` as the initial value. @@ -1254,7 +1262,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passed the predicate check, * else `false`. */ @@ -1560,7 +1568,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ function baseEach(collection, iteratee) { @@ -1585,7 +1593,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ function baseEachRight(collection, iteratee) { @@ -1608,7 +1616,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns `true` if all elements passed the predicate check, * else `false` */ @@ -1628,7 +1636,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { @@ -1649,7 +1657,7 @@ * * @private * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @param {boolean} [retKey=false] Specify returning the key of the found * element instead of the element itself. @@ -1709,13 +1717,13 @@ /** * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` executing `iteratee` for + * over `object` properties returned by `keysFunc` invoking `iteratee` for * each property. Iterator functions may exit iteration early by explicitly * returning `false`. * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ @@ -1739,7 +1747,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ @@ -1762,7 +1770,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForIn(object, iteratee) { @@ -1775,7 +1783,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { @@ -1788,7 +1796,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { @@ -1846,7 +1854,7 @@ othType = typeof other; // exit early for unlike primitive values - if (value === value && (value == null || other == null || + if (!(valType == 'number' && othType == 'number') && (value == null || other == null || (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object'))) { return false; } @@ -1861,13 +1869,13 @@ if (othIsArg) { othClass = objectClass; } - if (valClass != othClass) { - return false; - } - var isArr = arrayLikeClasses[valClass], - isErr = valClass == errorClass; + var valIsArr = arrayLikeClasses[valClass], + valIsErr = valClass == errorClass, + valIsObj = valClass == objectClass && !isHostObject(value), + othIsObj = othClass == objectClass && !isHostObject(other); - if (isArr) { + var isSameClass = valClass == othClass; + if (isSameClass && valIsArr) { var valLength = value.length, othLength = other.length; @@ -1875,82 +1883,88 @@ return false; } } - else if (isErr || (valClass == objectClass && (support.nodeClass || !(isHostObject(value) || isHostObject(other))))) { + else { // unwrap any `lodash` wrapped values - var valWrapped = hasOwnProperty.call(value, '__wrapped__'), - othWrapped = hasOwnProperty.call(other, '__wrapped__'); + var valWrapped = valIsObj && hasOwnProperty.call(value, '__wrapped__'), + othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (valWrapped || othWrapped) { return baseIsEqual(valWrapped ? value.__wrapped__ : value, othWrapped ? other.__wrapped__ : other, customizer, isWhere, stackA, stackB); } - if (!support.argsClass) { - valIsArg = isArguments(value); - othIsArg = isArguments(other); + if (!isSameClass) { + return false; } - // in older versions of Opera, `arguments` objects have `Array` constructors - var valCtor = valIsArg ? Object : value.constructor, - othCtor = othIsArg ? Object : other.constructor; - - if (isErr) { - // error objects of different types are not equal - if (valCtor.prototype.name != othCtor.prototype.name) { - return false; + if (valIsErr || valIsObj) { + if (!support.argsClass) { + valIsArg = isArguments(value); + othIsArg = isArguments(other); } - } else { - var valHasCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), - othHasCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); + // in older versions of Opera, `arguments` objects have `Array` constructors + var valCtor = valIsArg ? Object : value.constructor, + othCtor = othIsArg ? Object : other.constructor; - if (valHasCtor != othHasCtor) { - return false; - } - if (!valHasCtor) { - // non `Object` object instances with different constructors are not equal - if (valCtor != othCtor && - !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && - ('constructor' in value && 'constructor' in other) - ) { + if (valIsErr) { + // error objects of different types are not equal + if (valCtor.prototype.name != othCtor.prototype.name) { return false; } } - } - var valProps = isErr ? ['message', 'name'] : keys(value), - othProps = isErr ? valProps : keys(other); + else { + var valHasCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), + othHasCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); - if (valIsArg) { - valProps.push('length'); + if (valHasCtor != othHasCtor) { + return false; + } + if (!valHasCtor) { + // non `Object` object instances with different constructors are not equal + if (valCtor != othCtor && + !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && + ('constructor' in value && 'constructor' in other) + ) { + return false; + } + } + } + var valProps = valIsErr ? ['message', 'name'] : keys(value), + othProps = valIsErr ? valProps : keys(other); + + if (valIsArg) { + valProps.push('length'); + } + if (othIsArg) { + othProps.push('length'); + } + valLength = valProps.length; + othLength = othProps.length; + if (valLength != othLength && !isWhere) { + return false; + } } - if (othIsArg) { - othProps.push('length'); - } - valLength = valProps.length; - othLength = othProps.length; - if (valLength != othLength && !isWhere) { + else { + switch (valClass) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal + return +value == +other; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return (value != +value) + ? other != +other + // but treat `-0` vs. `+0` as not equal + : (value == 0 ? ((1 / value) == (1 / other)) : value == +other); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) and + // treat strings primitives and string objects as equal + return value == String(other); + } return false; } } - else { - switch (valClass) { - case boolClass: - case dateClass: - // coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal - return +value == +other; - - case numberClass: - // treat `NaN` vs. `NaN` as equal - return (value != +value) - ? other != +other - // but treat `-0` vs. `+0` as not equal - : (value == 0 ? ((1 / value) == (1 / other)) : value == +other); - - case regexpClass: - case stringClass: - // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) and - // treat strings primitives and string objects as equal - return value == String(other); - } - return false; - } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) @@ -1969,7 +1983,7 @@ // recursively compare objects and arrays (susceptible to call stack limits) result = true; - if (isArr) { + if (valIsArr) { // deep compare the contents, ignoring non-numeric properties while (result && ++index < valLength) { var valValue = value[index]; @@ -1993,7 +2007,7 @@ else { while (result && ++index < valLength) { var key = valProps[index]; - result = isErr || hasOwnProperty.call(other, key); + result = valIsErr || hasOwnProperty.call(other, key); if (result) { valValue = value[key]; @@ -2044,7 +2058,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { @@ -2188,7 +2202,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initFromCollection Specify using the first or last element * of `collection` as the initial value. @@ -2232,7 +2246,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passed the predicate check, * else `false`. */ @@ -2253,7 +2267,7 @@ * @private * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {boolean} [retHighest=false] Specify returning the highest, instead * of the lowest, index at which a value should be inserted into `array`. * @returns {number} Returns the index at which `value` should be inserted @@ -2291,7 +2305,7 @@ * * @private * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function called per iteration. + * @param {Function} [iteratee] The function invoked per iteration. * @returns {Array} Returns the new duplicate-value-free array. */ function baseUniq(array, iteratee) { @@ -2799,7 +2813,7 @@ * Gets the appropriate "callback" function. If the `_.callback` method is * customized this function returns the custom method, otherwise it returns * the `baseCallback` function. If arguments are provided the chosen function - * is executed with the arguments and its result is returned. + * is invoked with them and its result is returned. * * @private * @returns {Function} Returns the chosen function or its result. @@ -2831,7 +2845,7 @@ * Gets the appropriate "indexOf" function. If the `_.indexOf` method is * customized this function returns the custom method, otherwise it returns * the `baseIndexOf` function. If arguments are provided the chosen function - * is executed with the arguments and its result is returned. + * is invoked with them and its result is returned. * * @private * @returns {Function|number} Returns the chosen function or its result. @@ -2878,7 +2892,7 @@ */ function initObjectClone(object, isDeep) { var className = toString.call(object); - if (!cloneableClasses[className] || (!support.nodeClass && isHostObject(object))) { + if (!cloneableClasses[className] || isHostObject(object)) { return object; } var Ctor = object.constructor, @@ -2936,19 +2950,6 @@ arrayLikeClasses[toString.call(value)]) || false; } - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - var isHostObject = support.hostObject ? constant(false) : function(value) { - // IE < 9 presents many host objects as `Object` objects that can coerce to - // strings despite having improperly defined `toString` methods - return typeof value.toString != 'function' && typeof (value + '') == 'string'; - }; - /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * @@ -2990,7 +2991,7 @@ * * @private * @param {Object} object The source object. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Object} Returns the new object. */ function pickByCallback(object, predicate) { @@ -3031,7 +3032,7 @@ /** * Sets metadata for `func`. * - * **Note**: If this function becomes hot, i.e. is called a lot in a short + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses. * @@ -3050,7 +3051,7 @@ lastCalled = stamp; if (remaining > 0) { - if (++count > HOT_COUNT) { + if (++count >= HOT_COUNT) { return key; } } else { @@ -3073,12 +3074,12 @@ var Ctor, result; - // avoid non `Object` objects, `arguments` objects, and DOM elements - if (!(value && toString.call(value) == objectClass) || + // exit early for non `Object` objects + if (!(value && typeof value == 'object' && + toString.call(value) == objectClass && !isHostObject(value)) || (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, isFunction(Ctor) && !(Ctor instanceof Ctor))) || - (!support.argsClass && isArguments(value)) || - (!support.nodeClass && isHostObject(value))) { + (!support.argsClass && isArguments(value))) { return false; } // IE < 9 iterates inherited properties before own properties. If the first @@ -3137,7 +3138,7 @@ * * @private * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function called per iteration. + * @param {Function} [iteratee] The function invoked per iteration. * @returns {Array} Returns the new duplicate-value-free array. */ function sortedUniq(array, iteratee) { @@ -3369,7 +3370,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -3418,7 +3419,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -3465,7 +3466,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3519,7 +3520,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3818,11 +3819,11 @@ * Removes all provided values from `array` using `SameValueZero` for equality * comparisons. * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * `SameValueZero` is like strict equality, e.g. `===`, except that `NaN` matches - * `NaN`. See the [ES6 spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. + * **Notes:** + * - Unlike `_.without`, this method mutates `array`. + * - `SameValueZero` is like strict equality, e.g. `===`, except that `NaN` matches `NaN`. + * See the [ES6 spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * for more details. * * @static * @memberOf _ @@ -3901,7 +3902,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3993,7 +3994,7 @@ /** * Uses a binary search to determine the lowest index at which a value should * be inserted into a given sorted array in order to maintain the sort order - * of the array. If an iteratee function is provided it is executed for `value` + * of the array. If an iteratee function is provided it is invoked for `value` * and each element of `array` to compute their sort ranking. The iteratee * function is bound to `thisArg` and invoked with one argument; (value). * @@ -4009,7 +4010,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4050,7 +4051,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4145,7 +4146,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -4194,7 +4195,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -4252,7 +4253,7 @@ * Creates a duplicate-value-free version of an array using `SameValueZero` * for equality comparisons. Providing `true` for `isSorted` performs a faster * search algorithm for sorted arrays. If an iteratee function is provided it - * is executed for each value in the array to generate the criterion by which + * is invoked for each value in the array to generate the criterion by which * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, array). * @@ -4273,7 +4274,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {boolean} [isSorted=false] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4684,7 +4685,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4721,7 +4722,7 @@ * @alias all * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4770,7 +4771,7 @@ * @alias select * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4817,7 +4818,7 @@ * @alias detect * @category Collection * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4860,7 +4861,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4904,8 +4905,8 @@ } /** - * Iterates over elements of `collection` executing `iteratee` for each - * element. The `iteratee` is bound to `thisArg` and invoked with three arguments; + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The `iteratee` is bound to `thisArg` and invoked with three arguments; * (value, index|key, collection). Iterator functions may exit iteration early * by explicitly returning `false`. * @@ -4918,7 +4919,7 @@ * @alias each * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array|Object|string} Returns `collection`. * @example @@ -4944,7 +4945,7 @@ * @alias eachRight * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array|Object|string} Returns `collection`. * @example @@ -4976,7 +4977,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5019,7 +5020,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5046,9 +5047,9 @@ /** * Invokes the method named by `methodName` on each element in the collection, - * returning an array of the results of each invoked method. Additional arguments - * is provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in the collection. + * returning an array of the results of each invoked method. Any additional + * arguments are provided to each invoked method. If `methodName` is a function + * it is invoked for, and `this` bound to, each element in the collection. * * @static * @memberOf _ @@ -5087,7 +5088,7 @@ * @alias collect * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5119,7 +5120,7 @@ /** * Retrieves the maximum value of `collection`. If the collection is empty * or falsey `-Infinity` is returned. If an iteratee function is provided it - * is executed for each value in the collection to generate the criterion by + * is invoked for each value in the collection to generate the criterion by * which the value is ranked. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, collection). * @@ -5134,7 +5135,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5202,7 +5203,7 @@ /** * Retrieves the minimum value of `collection`. If the collection is empty * or falsey `Infinity` is returned. If an iteratee function is provided it - * is executed for each value in the collection to generate the criterion by + * is invoked for each value in the collection to generate the criterion by * which the value is ranked. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, collection). * @@ -5217,7 +5218,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5299,7 +5300,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5356,7 +5357,7 @@ /** * Reduces a collection to a value which is the accumulated result of running * each element in the collection through `iteratee`, where each successive - * execution consumes the return value of the previous execution. If `accumulator` + * invocation is supplied the return value of the previous. If `accumulator` * is not provided the first element of the collection is used as the initial * value. The `iteratee` is bound to `thisArg`and invoked with four arguments; * (accumulator, value, index|key, collection). @@ -5366,7 +5367,7 @@ * @alias foldl, inject * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -5395,7 +5396,7 @@ * @alias foldr * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -5425,7 +5426,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5563,7 +5564,7 @@ * @alias any * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5617,7 +5618,7 @@ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. * @param {Array|Function|Object|string} [iteratee=identity] The function - * called per iteration. If property name(s) or an object is provided it + * invoked per iteration. If property name(s) or an object is provided it * is used to create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array} Returns the new sorted array. @@ -5735,13 +5736,13 @@ /*--------------------------------------------------------------------------*/ /** - * The opposite of `_.before`; this method creates a function that executes + * The opposite of `_.before`; this method creates a function that invokes * `func` only after it is called `n` times. * * @static * @memberOf _ * @category Function - * @param {number} n The number of calls before `func` is executed. + * @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 @@ -5770,13 +5771,13 @@ } /** - * Creates a function that executes `func`, with the `this` binding and + * Creates a function that invokes `func`, with the `this` binding and * arguments of the created function, until it is called `n` times. * * @static * @memberOf _ * @category Function - * @param {number} n The number of times `func` may be executed. + * @param {number} n The number of times `func` may be called. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example @@ -5915,62 +5916,8 @@ } /** - * Creates a function that is the composition of the provided functions, - * where each function consumes the return value of the function that follows. - * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. - * Each function is executed with the `this` binding of the composed function. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to compose. - * @returns {Function} Returns the new composed function. - * @example - * - * var realNameMap = { - * 'pebbles': 'penelope' - * }; - * - * var format = function(name) { - * name = realNameMap[name.toLowerCase()] || name; - * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); - * }; - * - * var greet = function(formatted) { - * return 'Hiya ' + formatted + '!'; - * }; - * - * var welcome = _.compose(greet, format); - * welcome('pebbles'); - * // => 'Hiya Penelope!' - */ - function compose() { - var funcs = arguments, - length = funcs.length, - index = length - 1; - - if (!length) { - return function() {}; - } - while (length--) { - if (!isFunction(funcs[length])) { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - length = index; - var result = funcs[length].apply(this, arguments); - - while (length--) { - result = funcs[length].call(this, result); - } - return result; - }; - } - - /** - * Creates a function which accepts one or more arguments of `func` that when - * invoked either executes `func` returning its result, if all `func` arguments + * 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` can be specified * if `func.length` is not sufficient. @@ -6038,14 +5985,14 @@ } /** - * Creates a function that delays the execution of `func` until after `wait` + * Creates a function that delays the invocation of `func` until after `wait` * milliseconds have elapsed since the last time it was invoked. The created - * function comes with a `cancel` method to cancel delayed calls. Provide an + * function comes with a `cancel` method to cancel delayed invokes. 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` call. + * debounced function return the result of the last `func` invocation. * - * **Note:** If `leading` and `trailing` options are `true`, `func` is called on + * **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. * @@ -6058,11 +6005,11 @@ * @param {Function} func The function to debounce. * @param {number} wait The number of milliseconds to delay. * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify execution on the leading + * @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 is called. - * @param {boolean} [options.trailing=true] Specify execution on the trailing + * delayed before it is invoked. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing * edge of the timeout. * @returns {Function} Returns the new debounced function. * @example @@ -6070,13 +6017,13 @@ * // avoid costly calculations while the window size is in flux * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * - * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * // 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 executed once after 1 second of debounced calls + * // 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 @@ -6214,8 +6161,8 @@ } /** - * Defers executing the `func` function until the current call stack has - * cleared. Additional arguments are provided to `func` when it is invoked. + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it is invoked. * * @static * @memberOf _ @@ -6237,14 +6184,14 @@ } /** - * Executes the `func` function after `wait` milliseconds. Additional arguments - * are provided to `func` when it is invoked. + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it is invoked. * * @static * @memberOf _ * @category Function * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay execution. + * @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 @@ -6260,12 +6207,102 @@ return setTimeout(function() { func.apply(undefined, args); }, wait); } + /** + * Creates a function that invokes 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 add(x, y) { + * return x + y; + * } + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow(add, square); + * addSquare(1, 2); + * // => 9 + */ + function flow() { + var funcs = arguments, + length = funcs.length; + + if (!length) { + return function() {}; + } + if (!arrayEvery(funcs, isFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var index = 0, + result = funcs[index].apply(this, arguments); + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + } + + /** + * 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 add(x, y) { + * return x + y; + * } + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight(square, add); + * addSquare(1, 2); + * // => 9 + */ + function flowRight() { + var funcs = arguments, + fromIndex = funcs.length - 1; + + if (fromIndex < 0) { + return function() {}; + } + if (!arrayEvery(funcs, isFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var index = fromIndex, + result = funcs[index].apply(this, arguments); + + while (index--) { + result = funcs[index].call(this, result); + } + return result; + }; + } + /** * 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 used as the cache key. The `func` is - * executed with the `this` binding of the memoized function. The result cache + * invoked with the `this` binding of the memoized function. The result cache * is exposed as the `cache` property on the memoized function. * * @static @@ -6308,14 +6345,14 @@ return hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = func.apply(this, arguments)); - } + }; memoized.cache = {}; return memoized; } /** * Creates a function that negates the result of the predicate `func`. The - * `func` function is executed with the `this` binding and arguments of the + * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static @@ -6342,8 +6379,8 @@ } /** - * Creates a function that is restricted to execute `func` once. Repeat calls - * to the function return the value of the first call. The `func` is executed + * 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 of the created function. * * @static @@ -6357,17 +6394,17 @@ * var initialize = _.once(createApplication); * initialize(); * initialize(); - * // `initialize` executes `createApplication` once + * // `initialize` invokes `createApplication` once */ var once = partial(before, 2); /** - * Creates a function that invokes `func` with any additional `partial` arguments - * prepended to those provided to the new function. This method is similar to - * `_.bind` except it does **not** alter the `this` binding. + * Creates a function that invokes `func` with `partial` arguments prepended + * to those provided to the new function. This method is similar to `_.bind` + * except it does **not** alter the `this` binding. * - * **Note:** This method does not set the `length` property of partially applied - * functions. + * **Note:** This method does not set the `length` property of partially + * applied functions. * * @static * @memberOf _ @@ -6428,15 +6465,15 @@ } /** - * Creates a function that only calls the `func` function at most once per - * every `wait` milliseconds. The created function comes with a `cancel` method - * to cancel delayed calls. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. + * Creates a function that only invokes `func` at most once per every `wait` + * milliseconds. The created function comes with a `cancel` method to cancel + * delayed invokes. 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 called on - * the trailing edge of the timeout only if the the throttled function is + * **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) @@ -6446,11 +6483,11 @@ * @memberOf _ * @category Function * @param {Function} func The function to throttle. - * @param {number} wait The number of milliseconds to throttle executions to. + * @param {number} wait The number of milliseconds to throttle invocations to. * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify execution on the leading + * @param {boolean} [options.leading=true] Specify invoking on the leading * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify execution on the trailing + * @param {boolean} [options.trailing=true] Specify invoking on the trailing * edge of the timeout. * @returns {Function} Returns the new throttled function. * @example @@ -6458,7 +6495,7 @@ * // avoid excessively updating the position while scrolling * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * - * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }) * jQuery('.interactive').on('click', throttled); * @@ -6486,9 +6523,9 @@ /** * Creates a function that provides `value` to the wrapper function as its - * first argument. Additional arguments provided to the function are appended - * to those provided to the wrapper function. The wrapper is executed with - * the `this` binding of the created function. + * 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 _ @@ -6514,7 +6551,7 @@ /** * Assigns own enumerable properties of source object(s) to the destination * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is executed to produce the assigned values. + * If `customizer` is provided it is invoked to produce the assigned values. * The `customizer` is bound to `thisArg` and invoked with five arguments; * (objectValue, sourceValue, key, object, source). * @@ -6544,7 +6581,7 @@ /** * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, * otherwise they are assigned by reference. If `customizer` is provided it is - * executed to produce the cloned values. If `customizer` returns `undefined` + * invoked to produce the cloned values. If `customizer` returns `undefined` * cloning is handled by the method instead. The `customizer` is bound to * `thisArg` and invoked with two argument; (value, index|key). * @@ -6606,7 +6643,7 @@ } /** - * Creates a deep clone of `value`. If `customizer` is provided it is executed + * Creates a deep clone of `value`. If `customizer` is provided it is invoked * to produce the cloned values. If `customizer` returns `undefined` cloning * is handled by the method instead. The `customizer` is bound to `thisArg` * and invoked with two argument; (value, index|key). @@ -6731,7 +6768,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -6777,7 +6814,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -6809,7 +6846,7 @@ } /** - * Iterates over own and inherited enumerable properties of an object executing + * Iterates over own and inherited enumerable properties of an object invoking * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, key, object). Iterator functions may exit * iteration early by explicitly returning `false`. @@ -6818,7 +6855,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6850,7 +6887,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6873,7 +6910,7 @@ } /** - * Iterates over own enumerable properties of an object executing `iteratee` + * Iterates over own enumerable properties of an object invoking `iteratee` * for each property. The `iteratee` is bound to `thisArg` and invoked with * three arguments; (value, key, object). Iterator functions may exit iteration * early by explicitly returning `false`. @@ -6882,7 +6919,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6907,7 +6944,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6935,7 +6972,7 @@ * @example * * _.functions(_); - * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + * // => ['all', 'any', 'bind', ...] */ function functions(object) { return baseFunctions(object, keysIn(object)); @@ -7026,7 +7063,8 @@ * // => false */ function isArguments(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && toString.call(value) == argsClass) || false; } // fallback for environments without a `[[Class]]` for `arguments` objects @@ -7170,7 +7208,7 @@ /** * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is executed to compare values. + * equivalent. If `customizer` is provided it is invoked to compare values. * If `customizer` returns `undefined` comparisons are handled by the method * instead. The `customizer` is bound to `thisArg` and invoked with three * arguments; (value, other, key). @@ -7370,12 +7408,8 @@ if (isFunction(value)) { return reNative.test(fnToString.call(value)); } - if (value && typeof value == 'object') { - return !('constructor' in value) && isHostObject(value) - ? reNative.test(value) - : reHostCtor.test(toString.call(value)); - } - return false; + return (value && typeof value == 'object' && + (isHostObject(value) ? reNative : reHostCtor).test(value)) || false; } /** @@ -7655,7 +7689,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -7688,8 +7722,8 @@ * Recursively merges own enumerable properties of the source object(s), that * don't resolve to `undefined` into the destination object. Subsequent sources * overwrite property assignments of previous sources. If `customizer` is - * provided it is executed to produce the merged values of the destination - * and source properties. If `customizer` returns `undefined` merging is handled + * provided it is invoked to produce the merged values of the destination and + * source properties. If `customizer` returns `undefined` merging is handled * by the method instead. The `customizer` is bound to `thisArg` and invoked * with five arguments; (objectValue, sourceValue, key, object, source). * @@ -7740,7 +7774,7 @@ /** * Creates a shallow clone of `object` excluding the specified properties. * Property names may be specified as individual arguments or as arrays of - * property names. If a predicate is provided it is executed for each property + * property names. If a predicate is provided it is invoked for each property * of `object` omitting the properties the predicate returns truthy for. The * predicate is bound to `thisArg` and invoked with three arguments; * (value, key, object). @@ -7749,7 +7783,7 @@ * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function called per + * @param {Function|...(string|string[])} [predicate] The function invoked per * iteration or property names to omit, specified as individual property * names or arrays of property names. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -7809,7 +7843,7 @@ /** * Creates a shallow clone of `object` composed of the specified properties. * Property names may be specified as individual arguments or as arrays of - * property names. If a predicate is provided it is executed for each property + * property names. If a predicate is provided it is invoked for each property * of `object` picking the properties the predicate returns truthy for. The * predicate is bound to `thisArg` and invoked with three arguments; * (value, key, object). @@ -7818,7 +7852,7 @@ * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function called per + * @param {Function|...(string|string[])} [predicate] The function invoked per * iteration or property names to pick, specified as individual property * names or arrays of property names. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -7846,7 +7880,7 @@ /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own - * enumerable properties through `iteratee`, with each execution potentially + * enumerable properties through `iteratee`, with each invocation potentially * mutating the `accumulator` object. The `iteratee` is bound to `thisArg` * and invoked with four arguments; (accumulator, value, key, object). Iterator * functions may exit iteration early by explicitly returning `false`. @@ -7855,7 +7889,7 @@ * @memberOf _ * @category Object * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -8028,7 +8062,7 @@ } /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to + * Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to * their corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional characters @@ -8657,7 +8691,7 @@ /** * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, and `'` in `string` to their + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their * corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional HTML @@ -8683,7 +8717,7 @@ /*--------------------------------------------------------------------------*/ /** - * Attempts to execute `func`, returning either the result or the caught + * Attempts to invoke `func`, returning either the result or the caught * error object. * * @static @@ -8986,7 +9020,7 @@ * @example * * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be called + * // => logs the number of milliseconds it took for the deferred function to be invoked */ var now = nativeNow || function() { return new Date().getTime(); @@ -9225,15 +9259,15 @@ } /** - * Executes the iteratee function `n` times, returning an array of the results - * of each execution. The `iteratee` is bound to `thisArg` and invoked with + * Invokes the iteratee function `n` times, returning an array of the results + * of each invocation. The `iteratee` is bound to `thisArg` and invoked with * one argument; (index). * * @static * @memberOf _ * @category Utility - * @param {number} n The number of times to execute `iteratee`. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array} Returns the array of results. * @example @@ -9242,10 +9276,10 @@ * // => [3, 6, 4] * * _.times(3, function(n) { mage.castSpell(n); }); - * // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively + * // => invokes `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively * * _.times(3, function(n) { this.cast(n); }, mage); - * // => also calls `mage.castSpell(n)` three times + * // => also invokes `mage.castSpell(n)` three times */ function times(n, iteratee, thisArg) { n = nativeIsFinite(n = +n) && n > -1 ? n : 0; @@ -9305,7 +9339,6 @@ lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; - lodash.compose = compose; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; @@ -9323,6 +9356,8 @@ lodash.filter = filter; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; + lodash.flow = flow; + lodash.flowRight = flowRight; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; @@ -9385,7 +9420,9 @@ lodash.zipObject = zipObject; // add aliases + lodash.backflow = flowRight; lodash.collect = map; + lodash.compose = flowRight; lodash.each = forEach; lodash.eachRight = forEachRight; lodash.extend = assign; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 1f6ea7fcd..bf061c411 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,73 +4,73 @@ * Build: `lodash -o ./dist/lodash.compat.js` */ ;(function(){function n(n,t){for(var r=-1,e=t.length,u=Array(e);++rt||typeof n=="undefined")return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) -}function v(n){for(var t=-1,r=n.length;++ti(t,f)&&l.push(f);return l}function Zt(n,t){var r=n?n.length:0;if(typeof r!="number"||-1>=r||r>U)return nr(n,t); -for(var e=-1,u=Pr(n);++e=r||r>U)return tr(n,t);for(var e=Pr(n);r--&&false!==t(e[r],r,e););return n}function Vt(n,t){var r=true;return Zt(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Yt(n,t){var r=[];return Zt(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function Jt(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function Xt(n,t,r,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++e>>1,f=r(n[a]),l=e?f<=t:fo(c,p)&&((t||f)&&c.push(p),l.push(s))}return l}function gr(n,t){for(var r=-1,e=t(n),u=e.length,o=Me(u);++rt)return r;var e=typeof arguments[2];if("number"!=e&&"string"!=e||!arguments[3]||arguments[3][arguments[2]]!==arguments[1]||(t=2),3=t||t>U)return Se(n);if(n=$r(n),Nu.unindexedChars&&Ie(n))for(var r=-1;++re?Iu(u+e,0):e||0;else if(e)return e=Zr(n,t),u&&n[e]===t?e:-1; -return r(n,t,e)}function zr(n){return qr(n,1)}function qr(n,t,r){var u=-1,o=n?n.length:0;if(t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),r=typeof r=="undefined"||r>o?o:+r||0,0>r&&(r+=o),r&&r==o&&!t)return e(n);for(o=t>r?0:r-t,r=Me(o);++ur?Iu(e+r,0):r||0:0,typeof n=="string"||!Vu(n)&&Ie(n)?ru&&(u=a);else t=i&&a?o:Er(t,r,3),Zt(n,function(n,r,o){r=t(n,r,o),(r>e||-1/0===r&&r===u)&&(e=r,u=n)});return u}function oe(n,t){return ee(n,De(t))}function ie(n,t,r,e){return(Vu(n)?Ft:lr)(n,Er(t,e,4),r,3>arguments.length,Zt)}function ae(n,t,r,e){return(Vu(n)?Ut:lr)(n,Er(t,e,4),r,3>arguments.length,Kt) -}function fe(n){n=Pr(n);for(var t=-1,r=n.length,e=Me(r);++targuments.length)return Or(n,w,null,t);var r=qr(arguments,2),e=Lr(r,se.placeholder);return ar(n,w|E,r,e,t)}function pe(n,t){var r=w|j;if(2=r||r>t?(a&&su(a),r=p,a=s=p=_,r&&(h=to(),f=n.apply(c,i),s||a||(i=c=null))):s=du(e,r)}function u(){s&&su(s),a=s=p=_,(v||g!==t)&&(h=to(),f=n.apply(c,i),s||a||(i=c=null))}function o(){if(i=arguments,l=to(),c=this,p=v&&(s||!y),false===g)var r=y&&!s;else{a||y||(h=l);var o=g-(l-h),d=0>=o||o>g; -d?(a&&(a=su(a)),h=l,f=n.apply(c,i)):a||(a=du(u,o))}return d&&s?s=su(s):s||t===g||(s=du(e,t)),r&&(d=true,f=n.apply(c,i)),!d||s||a||(i=c=null),f}var i,a,f,l,c,s,p,h=0,g=false,v=true;if(!je(n))throw new Ge(R);if(t=0>t?0:t,true===r)var y=true,v=false;else Ae(r)&&(y=r.leading,g="maxWait"in r&&Iu(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&su(s),a&&su(a),a=s=p=_},o}function ye(n){var t=qr(arguments,1),r=Lr(t,ye.placeholder);return ar(n,E,t,r)}function de(n){var t=qr(arguments,1),r=Lr(t,de.placeholder); -return ar(n,I,t,r)}function me(n){return rr(n,Ce(n))}function _e(n){return n&&typeof n=="object"&&typeof n.length=="number"&&iu.call(n)==ot||false}function be(n){return n&&typeof n=="object"&&1===n.nodeType&&(Nu.nodeClass?-1t||null==n||!Ou(t))return r;n=Xe(n);do t%2&&(r+=n),t=pu(t/2),n+=n; -while(t);return r}function Fe(n,t){return(n=null==n?"":Xe(n))?null==t?n.slice(v(n),y(n)+1):(t=Xe(t),n.slice(i(n,t),a(n,t)+1)):n}function Ue(n){try{return n()}catch(t){return we(t)?t:qe(t)}}function Te(n,t){return Bt(n,t)}function Le(n){return function(){return n}}function We(n){return n}function Ne(n){var t=Xu(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Fr(u))return function(n){return null!=n&&u===n[e]&&uu.call(n,e)}}for(var o=r,i=Me(r),a=Me(r);o--;){var u=n[t[o]],f=Fr(u);i[o]=f,a[o]=f?u:Dt(u)}return function(n){if(o=r,null==n)return!o; -for(;o--;)if(i[o]?a[o]!==n[t[o]]:!uu.call(n,t[o]))return false;for(o=r;o--;)if(i[o]?!uu.call(n,t[o]):!er(a[o],n[t[o]],null,true))return false;return true}}function Pe(n,t,r){var e=true,u=Ae(t),o=null==r,i=o&&u&&Xu(t),a=i&&rr(t,i);(i&&i.length&&!a.length||o&&!u)&&(o&&(r=t),a=false,t=n,n=this),a||(a=rr(t,Xu(t))),false===r?e=false:Ae(r)&&"chain"in r&&(e=r.chain),r=-1,u=je(n);for(o=a.length;++rC)return r -}else n=0;return cr(r,e)}}(),Du=mr(function(n,t,r){uu.call(n,r)?++n[r]:n[r]=1}),Mu=mr(function(n,t,r){uu.call(n,r)?n[r].push(t):n[r]=[t]}),zu=mr(function(n,t,r){n[r]=t}),qu=mr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Zu=ye(ce,2),Ku=_r($t);Nu.argsClass||(_e=function(n){var t=n&&typeof n=="object"?n.length:_;return typeof t=="number"&&-1--n?t.apply(this,arguments):void 0}},g.assign=Ku,g.at=function(t){var r=t?t.length:0;return typeof r=="number"&&-1t?0:t)},g.dropRight=function(n,t,r){var e=n?n.length:0; -return t=e-((null==t||r?1:t)||0),qr(n,0,0>t?0:t)},g.dropRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Er(t,r,3);e--&&t(n[e],e,n););return qr(n,0,e+1)},g.dropWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Er(t,r,3);++e(p?u(p,f):i(s,f))){for(t=e;--t;){var h=o[t];if(0>(h?u(h,f):i(n[t],f)))continue n}p&&p.push(f),s.push(f)}return s},g.invert=function(n,t){for(var r=-1,e=Xu(n),u=e.length,o={};++rt?0:t)},g.takeRight=function(n,t,r){var e=n?n.length:0; -return t=e-((null==t||r?1:t)||0),qr(n,0>t?0:t)},g.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Er(t,r,3);e--&&t(n[e],e,n););return qr(n,e+1)},g.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Er(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},g.escape=function(n){return n=null==n?"":Xe(n),D.lastIndex=0,D.test(n)?n.replace(D,p):n -},g.escapeRegExp=ke,g.every=Hr,g.find=ne,g.findIndex=Br,g.findKey=function(n,t,r){return t=Er(t,r,3),Jt(n,t,nr,true)},g.findLast=function(n,t,r){return t=Er(t,r,3),Jt(n,t,Kt)},g.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Er(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},g.findLastKey=function(n,t,r){return t=Er(t,r,3),Jt(n,t,tr,true)},g.findWhere=function(n,t){return ne(n,Ne(t))},g.first=Dr,g.has=function(n,t){return n?uu.call(n,t):false},g.identity=We,g.indexOf=Mr,g.isArguments=_e,g.isArray=Vu,g.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&iu.call(n)==at||false -},g.isDate=function(n){return n&&typeof n=="object"&&iu.call(n)==ft||false},g.isElement=be,g.isEmpty=function(n){if(null==n)return true;var t=n.length;return typeof t=="number"&&-1r?Iu(u+r,0):Cu(r||0,u-1))+1;else if(r)return u=Kr(n,t)-1,e&&n[u]===t?u:-1;for(r=t===t;u--;)if(e=n[u],r?e===t:e!==e)return u;return-1},g.max=ue,g.min=function(n,t,r){var e=1/0,u=e,i=typeof t;"number"!=i&&"string"!=i||!r||r[t]!==n||(t=null);var i=null==t,a=!(i&&Vu(n))&&Ie(n);if(i&&!a)for(r=-1,n=Pr(n),i=n.length;++rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},g.template=function(n,t,r){var e=g.templateSettings;t=Ku({},r||t,e,Pt),n=Xe(null==n?"":n),r=Ku({},t.imports,e.imports,Pt); -var u,o,i=Xu(r),a=Se(r),f=0;r=t.interpolate||G;var l="__p+='";if(r=Je((t.escape||G).source+"|"+r.source+"|"+(r===q?Z:G).source+"|"+(t.evaluate||G).source+"|$","g"),n.replace(r,function(t,r,e,i,a,c){return e||(e=i),l+=n.slice(f,c).replace(nt,h),r&&(u=true,l+="'+__e("+r+")+'"),a&&(o=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(N,""):l).replace(P,"$1").replace($,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Ue(function(){return Ze(i,"return "+l).apply(_,a) -}),t.source=l,we(t))throw t;return t},g.trim=Fe,g.trimLeft=function(n,t){return(n=null==n?"":Xe(n))?null==t?n.slice(v(n)):(t=Xe(t),n.slice(i(n,t))):n},g.trimRight=function(n,t){return(n=null==n?"":Xe(n))?null==t?n.slice(0,y(n)+1):(t=Xe(t),n.slice(0,a(n,t)+1)):n},g.trunc=function(n,t){var r=30,e="...";if(Ae(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Xe(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Xe(n),r>=n.length)return n;var o=r-e.length;if(1>o)return e; -if(r=n.slice(0,o),null==u)return r+e;if(Ee(u)){if(n.slice(o).search(u)){var i,a,f=n.slice(0,o);for(u.global||(u=Je(u.source,(K.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(f);)a=i.index;r=r.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1t?0:+t||0,n.length),n)},nr(g,function(n,t){var r="sample"!=t;g.prototype[t]||(g.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new X(o,u):o})}),g.VERSION=b,g.prototype.chain=function(){return this.__chain__=true,this},g.prototype.toJSON=Xr,g.prototype.toString=function(){return Xe(this.__wrapped__) -},g.prototype.value=Xr,g.prototype.valueOf=Xr,tt(["join","pop","shift"],function(n){var t=He[n];g.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new X(r,n):r}}),tt(["push","reverse","sort","unshift"],function(n){var t=He[n];g.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tt(["concat","splice"],function(n){var t=He[n];g.prototype[n]=function(){return new X(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Nu.spliceObjects||tt(["pop","shift","splice"],function(n){var t=He[n],r="splice"==n; -g.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new X(u,n):u}}),g}var _,b="3.0.0-pre",w=1,j=2,A=4,x=8,O=16,E=32,I=64,C=150,S=16,k="__lodash_"+b.replace(/[-.]/g,"_")+"__",R="Expected a function",F=Math.pow(2,32)-1,U=Math.pow(2,53)-1,T="__lodash_placeholder__",L=0,W=/^[A-Z]+$/,N=/\b__p\+='';/g,P=/\b(__p\+=)''\+/g,$=/(__e\(.*?\)|\b__t\))\+'';/g,B=/&(?:amp|lt|gt|quot|#39|#96);/g,D=/[&<>"'`]/g,M=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,K=/\w*$/,V=/^\s*function[ \n\r\t]+\w/,Y=/^0[xX]/,J=/^\[object .+?Constructor\]$/,X=/[\xC0-\xFF]/g,G=/($^)/,H=/[.*+?^${}()|[\]\/\\]/g,Q=/\bthis\b/,nt=/['\n\r\u2028\u2029\\]/g,tt=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,rt=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",et="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),ut="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ot="[object Arguments]",it="[object Array]",at="[object Boolean]",ft="[object Date]",lt="[object Error]",ct="[object Function]",st="[object Number]",pt="[object Object]",ht="[object RegExp]",gt="[object String]",vt="[object ArrayBuffer]",yt="[object Float32Array]",dt="[object Float64Array]",mt="[object Int8Array]",_t="[object Int16Array]",bt="[object Int32Array]",wt="[object Uint8Array]",jt="[object Uint8ClampedArray]",At="[object Uint16Array]",xt="[object Uint32Array]",Ot={}; -Ot[ot]=Ot[it]=Ot[yt]=Ot[dt]=Ot[mt]=Ot[_t]=Ot[bt]=Ot[wt]=Ot[jt]=Ot[At]=Ot[xt]=true,Ot[vt]=Ot[at]=Ot[ft]=Ot[lt]=Ot[ct]=Ot["[object Map]"]=Ot[st]=Ot[pt]=Ot[ht]=Ot["[object Set]"]=Ot[gt]=Ot["[object WeakMap]"]=false;var Et={};Et[ot]=Et[it]=Et[vt]=Et[at]=Et[ft]=Et[yt]=Et[dt]=Et[mt]=Et[_t]=Et[bt]=Et[st]=Et[pt]=Et[ht]=Et[gt]=Et[wt]=Et[jt]=Et[At]=Et[xt]=true,Et[lt]=Et[ct]=Et["[object Map]"]=Et["[object Set]"]=Et["[object WeakMap]"]=false;var It={leading:false,maxWait:0,trailing:false},Ct={configurable:false,enumerable:false,value:null,writable:false},St={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},kt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Rt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"AE","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\xd7":" ","\xf7":" "},Ft={"function":true,object:true},Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tt=Ft[typeof window]&&window||this,Lt=Ft[typeof exports]&&exports&&!exports.nodeType&&exports,Ft=Ft[typeof module]&&module&&!module.nodeType&&module,Wt=Lt&&Ft&&typeof global=="object"&&global; -!Wt||Wt.global!==Wt&&Wt.window!==Wt&&Wt.self!==Wt||(Tt=Wt);var Wt=Ft&&Ft.exports===Lt&&Lt,Nt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Tt._=Nt, define(function(){return Nt})):Lt&&Ft?Wt?(Ft.exports=Nt)._=Nt:Lt._=Nt:Tt._=Nt}).call(this); \ No newline at end of file +}function a(n,t){for(var r=n.length;r--&&-1=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) +}function v(n){for(var t=-1,r=n.length;++ti(t,f)&&l.push(f);return l}function Kt(n,t){var r=n?n.length:0;if(typeof r!="number"||-1>=r||r>U)return tr(n,t); +for(var e=-1,u=$r(n);++e=r||r>U)return rr(n,t);for(var e=$r(n);r--&&false!==t(e[r],r,e););return n}function Yt(n,t){var r=true;return Kt(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Jt(n,t){var r=[];return Kt(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function Xt(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function Gt(n,t,r,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++ec))return false}else{var g=p&&ou.call(n,"__wrapped__"),h=h&&ou.call(t,"__wrapped__"); +if(g||h)return ur(g?n.__wrapped__:n,h?t.__wrapped__:t,r,e,u,o);if(!s)return false;if(!a&&!p){switch(l){case at:case ft:return+n==+t;case st:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case ht:case gt:return n==Ge(t)}return false}if(Pu.argsClass||(c=we(n),i=we(t)),g=c?Je:n.constructor,l=i?Je:t.constructor,a){if(g.prototype.name!=l.prototype.name)return false}else if(p=!c&&ou.call(n,"constructor"),h=!i&&ou.call(t,"constructor"),p!=h||!(p||g==l||xe(g)&&g instanceof g&&xe(l)&&l instanceof l)&&"constructor"in n&&"constructor"in t)return false; +if(g=a?["message","name"]:Xu(n),l=a?g:Xu(t),c&&g.push("length"),i&&l.push("length"),c=g.length,p=l.length,c!=p&&!e)return false}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;if(u.push(n),o.push(t),i=true,f)for(;i&&++l>>1,f=r(n[a]),l=e?f<=t:fo(c,p)&&((t||f)&&c.push(p),l.push(s))}return l}function vr(n,t){for(var r=-1,e=t(n),u=e.length,o=ze(u);++rt)return r;var e=typeof arguments[2];if("number"!=e&&"string"!=e||!arguments[3]||arguments[3][arguments[2]]!==arguments[1]||(t=2),3=t||t>U)return Re(n);if(n=Br(n),Pu.unindexedChars&&Ce(n))for(var r=-1;++re?Su(u+e,0):e||0;else if(e)return e=Kr(n,t),u&&n[e]===t?e:-1; +return r(n,t,e)}function qr(n){return Zr(n,1)}function Zr(n,t,r){var u=-1,o=n?n.length:0;if(t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),r=typeof r=="undefined"||r>o?o:+r||0,0>r&&(r+=o),r&&r==o&&!t)return e(n);for(o=t>r?0:r-t,r=ze(o);++ur?Su(e+r,0):r||0:0,typeof n=="string"||!Vu(n)&&Ce(n)?ru&&(u=a);else t=i&&a?o:Ir(t,r,3),Kt(n,function(n,r,o){r=t(n,r,o),(r>e||-1/0===r&&r===u)&&(e=r,u=n)});return u}function ie(n,t){return ue(n,Me(t))}function ae(n,t,r,e){return(Vu(n)?Ft:cr)(n,Ir(t,e,4),r,3>arguments.length,Kt)}function fe(n,t,r,e){return(Vu(n)?Ut:cr)(n,Ir(t,e,4),r,3>arguments.length,Vt) +}function le(n){n=$r(n);for(var t=-1,r=n.length,e=ze(r);++targuments.length)return Er(n,w,null,t);var r=Zr(arguments,2),e=Wr(r,pe.placeholder);return fr(n,w|E,r,e,t)}function he(n,t){var r=w|j;if(2=r||r>t?(a&&pu(a),r=p,a=s=p=_,r&&(h=to(),f=n.apply(c,i),s||a||(i=c=null))):s=du(e,r)}function u(){s&&pu(s),a=s=p=_,(v||g!==t)&&(h=to(),f=n.apply(c,i),s||a||(i=c=null))}function o(){if(i=arguments,l=to(),c=this,p=v&&(s||!y),false===g)var r=y&&!s;else{a||y||(h=l);var o=g-(l-h),m=0>=o||o>g; +m?(a&&(a=pu(a)),h=l,f=n.apply(c,i)):a||(a=du(u,o))}return m&&s?s=pu(s):s||t===g||(s=du(e,t)),r&&(m=true,f=n.apply(c,i)),!m||s||a||(i=c=null),f}var i,a,f,l,c,s,p,h=0,g=false,v=true;if(!xe(n))throw new He(R);if(t=0>t?0:t,true===r)var y=true,v=false;else Oe(r)&&(y=r.leading,g="maxWait"in r&&Su(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&pu(s),a&&pu(a),a=s=p=_},o}function me(){var n=arguments,t=n.length-1;if(0>t)return function(){};if(!Ct(n,xe))throw new He(R);return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e); +return e}}function de(n){var t=Zr(arguments,1),r=Wr(t,de.placeholder);return fr(n,E,t,r)}function _e(n){var t=Zr(arguments,1),r=Wr(t,_e.placeholder);return fr(n,I,t,r)}function be(n){return er(n,ke(n))}function we(n){var t=n&&typeof n=="object"?n.length:_;return typeof t=="number"&&-1t||null==n||!Eu(t))return r;n=Ge(n);do t%2&&(r+=n),t=hu(t/2),n+=n; +while(t);return r}function Te(n,t){return(n=null==n?"":Ge(n))?null==t?n.slice(v(n),y(n)+1):(t=Ge(t),n.slice(i(n,t),a(n,t)+1)):n}function Le(n){try{return n()}catch(t){return Ae(t)?t:Ze(t)}}function We(n,t){return Dt(n,t)}function Ne(n){return n}function Pe(n){var t=Xu(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Ur(u))return function(n){return null!=n&&u===n[e]&&ou.call(n,e)}}for(var o=r,i=ze(r),a=ze(r);o--;){var u=n[t[o]],f=Ur(u);i[o]=f,a[o]=f?u:Mt(u)}return function(n){if(o=r,null==n)return!o;for(;o--;)if(i[o]?a[o]!==n[t[o]]:!ou.call(n,t[o]))return false; +for(o=r;o--;)if(i[o]?!ou.call(n,t[o]):!ur(a[o],n[t[o]],null,true))return false;return true}}function $e(n,t,r){var e=true,u=Oe(t),o=null==r,i=o&&u&&Xu(t),a=i&&er(t,i);(i&&i.length&&!a.length||o&&!u)&&(o&&(r=t),a=false,t=n,n=this),a||(a=er(t,Xu(t))),false===r?e=false:Oe(r)&&"chain"in r&&(e=r.chain),r=-1,u=xe(n);for(o=a.length;++r=S)return r}else n=0;return sr(r,e)}}(),Du=_r(function(n,t,r){ou.call(n,r)?++n[r]:n[r]=1}),Mu=_r(function(n,t,r){ou.call(n,r)?n[r].push(t):n[r]=[t]}),zu=_r(function(n,t,r){n[r]=t +}),qu=_r(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Zu=de(se,2),Ku=br(Bt);Pu.argsClass||(we=function(n){var t=n&&typeof n=="object"?n.length:_;return typeof t=="number"&&-1--n?t.apply(this,arguments):void 0}},g.assign=Ku,g.at=function(t){var r=t?t.length:0;return typeof r=="number"&&-1t?0:t)},g.dropRight=function(n,t,r){var e=n?n.length:0;return t=e-((null==t||r?1:t)||0),Zr(n,0,0>t?0:t)},g.dropRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Ir(t,r,3);e--&&t(n[e],e,n););return Zr(n,0,e+1)},g.dropWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Ir(t,r,3);++e(p?u(p,f):i(s,f))){for(t=e;--t;){var h=o[t]; +if(0>(h?u(h,f):i(n[t],f)))continue n}p&&p.push(f),s.push(f)}return s},g.invert=function(n,t){for(var r=-1,e=Xu(n),u=e.length,o={};++rt?0:t)},g.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((null==t||r?1:t)||0),Zr(n,0>t?0:t)},g.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Ir(t,r,3);e--&&t(n[e],e,n););return Zr(n,e+1)},g.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0; +for(t=Ir(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},g.escape=function(n){return n=null==n?"":Ge(n),D.lastIndex=0,D.test(n)?n.replace(D,p):n},g.escapeRegExp=Fe,g.every=Qr,g.find=te,g.findIndex=Dr,g.findKey=function(n,t,r){return t=Ir(t,r,3),Xt(n,t,tr,true)},g.findLast=function(n,t,r){return t=Ir(t,r,3),Xt(n,t,Vt) +},g.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Ir(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},g.findLastKey=function(n,t,r){return t=Ir(t,r,3),Xt(n,t,rr,true)},g.findWhere=function(n,t){return te(n,Pe(t))},g.first=Mr,g.has=function(n,t){return n?ou.call(n,t):false},g.identity=Ne,g.indexOf=zr,g.isArguments=we,g.isArray=Vu,g.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&au.call(n)==at||false},g.isDate=function(n){return n&&typeof n=="object"&&au.call(n)==ft||false},g.isElement=je,g.isEmpty=function(n){if(null==n)return true; +var t=n.length;return typeof t=="number"&&-1r?Su(u+r,0):Cu(r||0,u-1))+1;else if(r)return u=Vr(n,t)-1,e&&n[u]===t?u:-1;for(r=t===t;u--;)if(e=n[u],r?e===t:e!==e)return u;return-1},g.max=oe,g.min=function(n,t,r){var e=1/0,u=e,i=typeof t;"number"!=i&&"string"!=i||!r||r[t]!==n||(t=null);var i=null==t,a=!(i&&Vu(n))&&Ce(n);if(i&&!a)for(r=-1,n=$r(n),i=n.length;++rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},g.template=function(n,t,r){var e=g.templateSettings;t=Ku({},r||t,e,$t),n=Ge(null==n?"":n),r=Ku({},t.imports,e.imports,$t); +var u,o,i=Xu(r),a=Re(r),f=0;r=t.interpolate||G;var l="__p+='";if(r=Xe((t.escape||G).source+"|"+r.source+"|"+(r===q?Z:G).source+"|"+(t.evaluate||G).source+"|$","g"),n.replace(r,function(t,r,e,i,a,c){return e||(e=i),l+=n.slice(f,c).replace(nt,h),r&&(u=true,l+="'+__e("+r+")+'"),a&&(o=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(N,""):l).replace(P,"$1").replace($,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Le(function(){return Ke(i,"return "+l).apply(_,a) +}),t.source=l,Ae(t))throw t;return t},g.trim=Te,g.trimLeft=function(n,t){return(n=null==n?"":Ge(n))?null==t?n.slice(v(n)):(t=Ge(t),n.slice(i(n,t))):n},g.trimRight=function(n,t){return(n=null==n?"":Ge(n))?null==t?n.slice(0,y(n)+1):(t=Ge(t),n.slice(0,a(n,t)+1)):n},g.trunc=function(n,t){var r=30,e="...";if(Oe(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Ge(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Ge(n),r>=n.length)return n;var o=r-e.length;if(1>o)return e; +if(r=n.slice(0,o),null==u)return r+e;if(Se(u)){if(n.slice(o).search(u)){var i,a,f=n.slice(0,o);for(u.global||(u=Xe(u.source,(K.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(f);)a=i.index;r=r.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1t?0:+t||0,n.length),n)},tr(g,function(n,t){var r="sample"!=t;g.prototype[t]||(g.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new X(o,u):o})}),g.VERSION=b,g.prototype.chain=function(){return this.__chain__=true,this},g.prototype.toJSON=Gr,g.prototype.toString=function(){return Ge(this.__wrapped__) +},g.prototype.value=Gr,g.prototype.valueOf=Gr,tt(["join","pop","shift"],function(n){var t=Qe[n];g.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new X(r,n):r}}),tt(["push","reverse","sort","unshift"],function(n){var t=Qe[n];g.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tt(["concat","splice"],function(n){var t=Qe[n];g.prototype[n]=function(){return new X(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Pu.spliceObjects||tt(["pop","shift","splice"],function(n){var t=Qe[n],r="splice"==n; +g.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new X(u,n):u}}),g}var _,b="3.0.0-pre",w=1,j=2,A=4,x=8,O=16,E=32,I=64,S=150,C=16,k="__lodash_"+b.replace(/[-.]/g,"_")+"__",R="Expected a function",F=Math.pow(2,32)-1,U=Math.pow(2,53)-1,T="__lodash_placeholder__",L=0,W=/^[A-Z]+$/,N=/\b__p\+='';/g,P=/\b(__p\+=)''\+/g,$=/(__e\(.*?\)|\b__t\))\+'';/g,B=/&(?:amp|lt|gt|quot|#39|#96);/g,D=/[&<>"'`]/g,M=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,K=/\w*$/,V=/^\s*function[ \n\r\t]+\w/,Y=/^0[xX]/,J=/^\[object .+?Constructor\]$/,X=/[\xC0-\xFF]/g,G=/($^)/,H=/[.*+?^${}()|[\]\/\\]/g,Q=/\bthis\b/,nt=/['\n\r\u2028\u2029\\]/g,tt=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,rt=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",et="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),ut="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ot="[object Arguments]",it="[object Array]",at="[object Boolean]",ft="[object Date]",lt="[object Error]",ct="[object Function]",st="[object Number]",pt="[object Object]",ht="[object RegExp]",gt="[object String]",vt="[object ArrayBuffer]",yt="[object Float32Array]",mt="[object Float64Array]",dt="[object Int8Array]",_t="[object Int16Array]",bt="[object Int32Array]",wt="[object Uint8Array]",jt="[object Uint8ClampedArray]",At="[object Uint16Array]",xt="[object Uint32Array]",Ot={}; +Ot[ot]=Ot[it]=Ot[yt]=Ot[mt]=Ot[dt]=Ot[_t]=Ot[bt]=Ot[wt]=Ot[jt]=Ot[At]=Ot[xt]=true,Ot[vt]=Ot[at]=Ot[ft]=Ot[lt]=Ot[ct]=Ot["[object Map]"]=Ot[st]=Ot[pt]=Ot[ht]=Ot["[object Set]"]=Ot[gt]=Ot["[object WeakMap]"]=false;var Et={};Et[ot]=Et[it]=Et[vt]=Et[at]=Et[ft]=Et[yt]=Et[mt]=Et[dt]=Et[_t]=Et[bt]=Et[st]=Et[pt]=Et[ht]=Et[gt]=Et[wt]=Et[jt]=Et[At]=Et[xt]=true,Et[lt]=Et[ct]=Et["[object Map]"]=Et["[object Set]"]=Et["[object WeakMap]"]=false;var It={leading:false,maxWait:0,trailing:false},St={configurable:false,enumerable:false,value:null,writable:false},Ct={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},kt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Rt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"AE","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\xd7":" ","\xf7":" "},Ft={"function":true,object:true},Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tt=Ft[typeof window]&&window||this,Lt=Ft[typeof exports]&&exports&&!exports.nodeType&&exports,Ft=Ft[typeof module]&&module&&!module.nodeType&&module,Wt=Lt&&Ft&&typeof global=="object"&&global; +!Wt||Wt.global!==Wt&&Wt.window!==Wt&&Wt.self!==Wt||(Tt=Wt);var Wt=Ft&&Ft.exports===Lt&&Lt,Nt=function(){try{({toString:0}+"")}catch(n){return function(){return false}}return function(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}}(),Pt=d();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Tt._=Pt, define(function(){return Pt})):Lt&&Ft?Wt?(Ft.exports=Pt)._=Pt:Lt._=Pt:Tt._=Pt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 97228c370..4cc42a490 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -210,7 +210,7 @@ * **Note:** Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't require escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. - * See [Mathias' article](http://mathiasbynens.be/notes/ambiguous-ampersands) + * See [Mathias Bynens's article](http://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * Backticks are escaped because in Internet Explorer < 9, they can break out @@ -487,7 +487,7 @@ * given string. * * @private - * @param {Function} callback The function called to combine each word. + * @param {Function} callback The function invoked to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { @@ -738,25 +738,25 @@ * * The chainable wrapper functions are: * `after`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `callback`, - * `chain`, `chunk`, `compact`, `compose`, `concat`, `constant`, `countBy`, - * `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, - * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, - * `flattenDeep`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, - * `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, `matches`, `memoize`, - * `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, `pairs`, `partial`, - * `partialRight`, `partition`, `pick`, `pluck`, `property`, `pull`, `pullAt`, - * `push`, `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, - * `sort`, `sortBy`, `splice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, - * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, - * `unzip`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, - * and `zipObject` + * `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `drop`, + * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, `flattenDeep`, + * `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, + * `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, + * `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, + * `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, + * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `pluck`, `property`, + * `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, `rest`, `reverse`, + * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `times`, `toArray`, + * `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, + * `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` * * The non-chainable wrapper functions are: * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `contains`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, - * `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, + * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, + * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, + * `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, * `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, `isFunction`, * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, @@ -859,18 +859,6 @@ support.dom = false; } - /** - * Detect if the host objects are detectable (IE < 9). - * - * @memberOf _.support - * @type boolean - */ - try { - support.hostObject = !({ 'toString': 0 } + ''); - } catch(e) { - support.hostObject = false; - } - /** * Detect if `arguments` object indexes are non-enumerable. * @@ -959,7 +947,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { @@ -980,7 +968,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { @@ -1000,7 +988,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns `true` if all elements passed the predicate check, * else `false` */ @@ -1022,7 +1010,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { @@ -1042,7 +1030,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { @@ -1066,7 +1054,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray=false] Specify using the first element of * `array` as the initial value. @@ -1091,7 +1079,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray=false] Specify using the last element of * `array` as the initial value. @@ -1115,7 +1103,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passed the predicate check, * else `false`. */ @@ -1421,7 +1409,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ function baseEach(collection, iteratee) { @@ -1446,7 +1434,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ function baseEachRight(collection, iteratee) { @@ -1469,7 +1457,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns `true` if all elements passed the predicate check, * else `false` */ @@ -1489,7 +1477,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { @@ -1510,7 +1498,7 @@ * * @private * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @param {boolean} [retKey=false] Specify returning the key of the found * element instead of the element itself. @@ -1570,13 +1558,13 @@ /** * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` executing `iteratee` for + * over `object` properties returned by `keysFunc` invoking `iteratee` for * each property. Iterator functions may exit iteration early by explicitly * returning `false`. * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ @@ -1600,7 +1588,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ @@ -1623,7 +1611,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForIn(object, iteratee) { @@ -1636,7 +1624,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { @@ -1649,7 +1637,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { @@ -1707,7 +1695,7 @@ othType = typeof other; // exit early for unlike primitive values - if (value === value && (value == null || other == null || + if (!(valType == 'number' && othType == 'number') && (value == null || other == null || (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object'))) { return false; } @@ -1722,13 +1710,13 @@ if (othIsArg) { othClass = objectClass; } - if (valClass != othClass) { - return false; - } - var isArr = arrayLikeClasses[valClass], - isErr = valClass == errorClass; + var valIsArr = arrayLikeClasses[valClass], + valIsErr = valClass == errorClass, + valIsObj = valClass == objectClass, + othIsObj = othClass == objectClass; - if (isArr) { + var isSameClass = valClass == othClass; + if (isSameClass && valIsArr) { var valLength = value.length, othLength = other.length; @@ -1736,78 +1724,84 @@ return false; } } - else if (isErr || (valClass == objectClass)) { + else { // unwrap any `lodash` wrapped values - var valWrapped = hasOwnProperty.call(value, '__wrapped__'), - othWrapped = hasOwnProperty.call(other, '__wrapped__'); + var valWrapped = valIsObj && hasOwnProperty.call(value, '__wrapped__'), + othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (valWrapped || othWrapped) { return baseIsEqual(valWrapped ? value.__wrapped__ : value, othWrapped ? other.__wrapped__ : other, customizer, isWhere, stackA, stackB); } - // in older versions of Opera, `arguments` objects have `Array` constructors - var valCtor = valIsArg ? Object : value.constructor, - othCtor = othIsArg ? Object : other.constructor; + if (!isSameClass) { + return false; + } + if (valIsErr || valIsObj) { + // in older versions of Opera, `arguments` objects have `Array` constructors + var valCtor = valIsArg ? Object : value.constructor, + othCtor = othIsArg ? Object : other.constructor; - if (isErr) { - // error objects of different types are not equal - if (valCtor.prototype.name != othCtor.prototype.name) { - return false; - } - } else { - var valHasCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), - othHasCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); - - if (valHasCtor != othHasCtor) { - return false; - } - if (!valHasCtor) { - // non `Object` object instances with different constructors are not equal - if (valCtor != othCtor && - !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && - ('constructor' in value && 'constructor' in other) - ) { + if (valIsErr) { + // error objects of different types are not equal + if (valCtor.prototype.name != othCtor.prototype.name) { return false; } } - } - var valProps = isErr ? ['message', 'name'] : keys(value), - othProps = isErr ? valProps : keys(other); + else { + var valHasCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), + othHasCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); - if (valIsArg) { - valProps.push('length'); + if (valHasCtor != othHasCtor) { + return false; + } + if (!valHasCtor) { + // non `Object` object instances with different constructors are not equal + if (valCtor != othCtor && + !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && + ('constructor' in value && 'constructor' in other) + ) { + return false; + } + } + } + var valProps = valIsErr ? ['message', 'name'] : keys(value), + othProps = valIsErr ? valProps : keys(other); + + if (valIsArg) { + valProps.push('length'); + } + if (othIsArg) { + othProps.push('length'); + } + valLength = valProps.length; + othLength = othProps.length; + if (valLength != othLength && !isWhere) { + return false; + } } - if (othIsArg) { - othProps.push('length'); - } - valLength = valProps.length; - othLength = othProps.length; - if (valLength != othLength && !isWhere) { + else { + switch (valClass) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal + return +value == +other; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return (value != +value) + ? other != +other + // but treat `-0` vs. `+0` as not equal + : (value == 0 ? ((1 / value) == (1 / other)) : value == +other); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) and + // treat strings primitives and string objects as equal + return value == String(other); + } return false; } } - else { - switch (valClass) { - case boolClass: - case dateClass: - // coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal - return +value == +other; - - case numberClass: - // treat `NaN` vs. `NaN` as equal - return (value != +value) - ? other != +other - // but treat `-0` vs. `+0` as not equal - : (value == 0 ? ((1 / value) == (1 / other)) : value == +other); - - case regexpClass: - case stringClass: - // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) and - // treat strings primitives and string objects as equal - return value == String(other); - } - return false; - } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) @@ -1826,7 +1820,7 @@ // recursively compare objects and arrays (susceptible to call stack limits) result = true; - if (isArr) { + if (valIsArr) { // deep compare the contents, ignoring non-numeric properties while (result && ++index < valLength) { var valValue = value[index]; @@ -1850,7 +1844,7 @@ else { while (result && ++index < valLength) { var key = valProps[index]; - result = isErr || hasOwnProperty.call(other, key); + result = valIsErr || hasOwnProperty.call(other, key); if (result) { valValue = value[key]; @@ -1901,7 +1895,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { @@ -2045,7 +2039,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initFromCollection Specify using the first or last element * of `collection` as the initial value. @@ -2089,7 +2083,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passed the predicate check, * else `false`. */ @@ -2110,7 +2104,7 @@ * @private * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {boolean} [retHighest=false] Specify returning the highest, instead * of the lowest, index at which a value should be inserted into `array`. * @returns {number} Returns the index at which `value` should be inserted @@ -2148,7 +2142,7 @@ * * @private * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function called per iteration. + * @param {Function} [iteratee] The function invoked per iteration. * @returns {Array} Returns the new duplicate-value-free array. */ function baseUniq(array, iteratee) { @@ -2656,7 +2650,7 @@ * Gets the appropriate "callback" function. If the `_.callback` method is * customized this function returns the custom method, otherwise it returns * the `baseCallback` function. If arguments are provided the chosen function - * is executed with the arguments and its result is returned. + * is invoked with them and its result is returned. * * @private * @returns {Function} Returns the chosen function or its result. @@ -2688,7 +2682,7 @@ * Gets the appropriate "indexOf" function. If the `_.indexOf` method is * customized this function returns the custom method, otherwise it returns * the `baseIndexOf` function. If arguments are provided the chosen function - * is executed with the arguments and its result is returned. + * is invoked with them and its result is returned. * * @private * @returns {Function|number} Returns the chosen function or its result. @@ -2830,7 +2824,7 @@ * * @private * @param {Object} object The source object. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Object} Returns the new object. */ function pickByCallback(object, predicate) { @@ -2871,7 +2865,7 @@ /** * Sets metadata for `func`. * - * **Note**: If this function becomes hot, i.e. is called a lot in a short + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses. * @@ -2890,7 +2884,7 @@ lastCalled = stamp; if (remaining > 0) { - if (++count > HOT_COUNT) { + if (++count >= HOT_COUNT) { return key; } } else { @@ -2913,8 +2907,9 @@ var Ctor, result; - // avoid non `Object` objects, `arguments` objects, and DOM elements - if (!(value && toString.call(value) == objectClass) || + // exit early for non `Object` objects + if (!(value && typeof value == 'object' && + toString.call(value) == objectClass) || (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, isFunction(Ctor) && !(Ctor instanceof Ctor)))) { return false; @@ -2964,7 +2959,7 @@ * * @private * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function called per iteration. + * @param {Function} [iteratee] The function invoked per iteration. * @returns {Array} Returns the new duplicate-value-free array. */ function sortedUniq(array, iteratee) { @@ -3190,7 +3185,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -3239,7 +3234,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -3286,7 +3281,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3340,7 +3335,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3639,11 +3634,11 @@ * Removes all provided values from `array` using `SameValueZero` for equality * comparisons. * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * `SameValueZero` is like strict equality, e.g. `===`, except that `NaN` matches - * `NaN`. See the [ES6 spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. + * **Notes:** + * - Unlike `_.without`, this method mutates `array`. + * - `SameValueZero` is like strict equality, e.g. `===`, except that `NaN` matches `NaN`. + * See the [ES6 spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * for more details. * * @static * @memberOf _ @@ -3722,7 +3717,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3814,7 +3809,7 @@ /** * Uses a binary search to determine the lowest index at which a value should * be inserted into a given sorted array in order to maintain the sort order - * of the array. If an iteratee function is provided it is executed for `value` + * of the array. If an iteratee function is provided it is invoked for `value` * and each element of `array` to compute their sort ranking. The iteratee * function is bound to `thisArg` and invoked with one argument; (value). * @@ -3830,7 +3825,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -3871,7 +3866,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -3966,7 +3961,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -4015,7 +4010,7 @@ * @type Function * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per element. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the slice of `array`. @@ -4073,7 +4068,7 @@ * Creates a duplicate-value-free version of an array using `SameValueZero` * for equality comparisons. Providing `true` for `isSorted` performs a faster * search algorithm for sorted arrays. If an iteratee function is provided it - * is executed for each value in the array to generate the criterion by which + * is invoked for each value in the array to generate the criterion by which * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, array). * @@ -4094,7 +4089,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {boolean} [isSorted=false] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4505,7 +4500,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4542,7 +4537,7 @@ * @alias all * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4591,7 +4586,7 @@ * @alias select * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4638,7 +4633,7 @@ * @alias detect * @category Collection * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4681,7 +4676,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -4725,8 +4720,8 @@ } /** - * Iterates over elements of `collection` executing `iteratee` for each - * element. The `iteratee` is bound to `thisArg` and invoked with three arguments; + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The `iteratee` is bound to `thisArg` and invoked with three arguments; * (value, index|key, collection). Iterator functions may exit iteration early * by explicitly returning `false`. * @@ -4739,7 +4734,7 @@ * @alias each * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array|Object|string} Returns `collection`. * @example @@ -4765,7 +4760,7 @@ * @alias eachRight * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array|Object|string} Returns `collection`. * @example @@ -4797,7 +4792,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4840,7 +4835,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4867,9 +4862,9 @@ /** * Invokes the method named by `methodName` on each element in the collection, - * returning an array of the results of each invoked method. Additional arguments - * is provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in the collection. + * returning an array of the results of each invoked method. Any additional + * arguments are provided to each invoked method. If `methodName` is a function + * it is invoked for, and `this` bound to, each element in the collection. * * @static * @memberOf _ @@ -4908,7 +4903,7 @@ * @alias collect * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -4940,7 +4935,7 @@ /** * Retrieves the maximum value of `collection`. If the collection is empty * or falsey `-Infinity` is returned. If an iteratee function is provided it - * is executed for each value in the collection to generate the criterion by + * is invoked for each value in the collection to generate the criterion by * which the value is ranked. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, collection). * @@ -4955,7 +4950,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5023,7 +5018,7 @@ /** * Retrieves the minimum value of `collection`. If the collection is empty * or falsey `Infinity` is returned. If an iteratee function is provided it - * is executed for each value in the collection to generate the criterion by + * is invoked for each value in the collection to generate the criterion by * which the value is ranked. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, collection). * @@ -5038,7 +5033,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -5120,7 +5115,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5177,7 +5172,7 @@ /** * Reduces a collection to a value which is the accumulated result of running * each element in the collection through `iteratee`, where each successive - * execution consumes the return value of the previous execution. If `accumulator` + * invocation is supplied the return value of the previous. If `accumulator` * is not provided the first element of the collection is used as the initial * value. The `iteratee` is bound to `thisArg`and invoked with four arguments; * (accumulator, value, index|key, collection). @@ -5187,7 +5182,7 @@ * @alias foldl, inject * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -5216,7 +5211,7 @@ * @alias foldr * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -5246,7 +5241,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5384,7 +5379,7 @@ * @alias any * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5438,7 +5433,7 @@ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. * @param {Array|Function|Object|string} [iteratee=identity] The function - * called per iteration. If property name(s) or an object is provided it + * invoked per iteration. If property name(s) or an object is provided it * is used to create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array} Returns the new sorted array. @@ -5554,13 +5549,13 @@ /*--------------------------------------------------------------------------*/ /** - * The opposite of `_.before`; this method creates a function that executes + * The opposite of `_.before`; this method creates a function that invokes * `func` only after it is called `n` times. * * @static * @memberOf _ * @category Function - * @param {number} n The number of calls before `func` is executed. + * @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 @@ -5589,13 +5584,13 @@ } /** - * Creates a function that executes `func`, with the `this` binding and + * Creates a function that invokes `func`, with the `this` binding and * arguments of the created function, until it is called `n` times. * * @static * @memberOf _ * @category Function - * @param {number} n The number of times `func` may be executed. + * @param {number} n The number of times `func` may be called. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example @@ -5734,62 +5729,8 @@ } /** - * Creates a function that is the composition of the provided functions, - * where each function consumes the return value of the function that follows. - * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. - * Each function is executed with the `this` binding of the composed function. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to compose. - * @returns {Function} Returns the new composed function. - * @example - * - * var realNameMap = { - * 'pebbles': 'penelope' - * }; - * - * var format = function(name) { - * name = realNameMap[name.toLowerCase()] || name; - * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); - * }; - * - * var greet = function(formatted) { - * return 'Hiya ' + formatted + '!'; - * }; - * - * var welcome = _.compose(greet, format); - * welcome('pebbles'); - * // => 'Hiya Penelope!' - */ - function compose() { - var funcs = arguments, - length = funcs.length, - index = length - 1; - - if (!length) { - return function() {}; - } - while (length--) { - if (!isFunction(funcs[length])) { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - length = index; - var result = funcs[length].apply(this, arguments); - - while (length--) { - result = funcs[length].call(this, result); - } - return result; - }; - } - - /** - * Creates a function which accepts one or more arguments of `func` that when - * invoked either executes `func` returning its result, if all `func` arguments + * 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` can be specified * if `func.length` is not sufficient. @@ -5857,14 +5798,14 @@ } /** - * Creates a function that delays the execution of `func` until after `wait` + * Creates a function that delays the invocation of `func` until after `wait` * milliseconds have elapsed since the last time it was invoked. The created - * function comes with a `cancel` method to cancel delayed calls. Provide an + * function comes with a `cancel` method to cancel delayed invokes. 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` call. + * debounced function return the result of the last `func` invocation. * - * **Note:** If `leading` and `trailing` options are `true`, `func` is called on + * **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. * @@ -5877,11 +5818,11 @@ * @param {Function} func The function to debounce. * @param {number} wait The number of milliseconds to delay. * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify execution on the leading + * @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 is called. - * @param {boolean} [options.trailing=true] Specify execution on the trailing + * delayed before it is invoked. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing * edge of the timeout. * @returns {Function} Returns the new debounced function. * @example @@ -5889,13 +5830,13 @@ * // avoid costly calculations while the window size is in flux * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * - * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * // 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 executed once after 1 second of debounced calls + * // 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 @@ -6033,8 +5974,8 @@ } /** - * Defers executing the `func` function until the current call stack has - * cleared. Additional arguments are provided to `func` when it is invoked. + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it is invoked. * * @static * @memberOf _ @@ -6056,14 +5997,14 @@ } /** - * Executes the `func` function after `wait` milliseconds. Additional arguments - * are provided to `func` when it is invoked. + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it is invoked. * * @static * @memberOf _ * @category Function * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay execution. + * @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 @@ -6079,12 +6020,102 @@ return setTimeout(function() { func.apply(undefined, args); }, wait); } + /** + * Creates a function that invokes 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 add(x, y) { + * return x + y; + * } + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow(add, square); + * addSquare(1, 2); + * // => 9 + */ + function flow() { + var funcs = arguments, + length = funcs.length; + + if (!length) { + return function() {}; + } + if (!arrayEvery(funcs, isFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var index = 0, + result = funcs[index].apply(this, arguments); + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + } + + /** + * 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 add(x, y) { + * return x + y; + * } + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight(square, add); + * addSquare(1, 2); + * // => 9 + */ + function flowRight() { + var funcs = arguments, + fromIndex = funcs.length - 1; + + if (fromIndex < 0) { + return function() {}; + } + if (!arrayEvery(funcs, isFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var index = fromIndex, + result = funcs[index].apply(this, arguments); + + while (index--) { + result = funcs[index].call(this, result); + } + return result; + }; + } + /** * 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 used as the cache key. The `func` is - * executed with the `this` binding of the memoized function. The result cache + * invoked with the `this` binding of the memoized function. The result cache * is exposed as the `cache` property on the memoized function. * * @static @@ -6127,14 +6158,14 @@ return hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = func.apply(this, arguments)); - } + }; memoized.cache = {}; return memoized; } /** * Creates a function that negates the result of the predicate `func`. The - * `func` function is executed with the `this` binding and arguments of the + * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static @@ -6161,8 +6192,8 @@ } /** - * Creates a function that is restricted to execute `func` once. Repeat calls - * to the function return the value of the first call. The `func` is executed + * 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 of the created function. * * @static @@ -6176,17 +6207,17 @@ * var initialize = _.once(createApplication); * initialize(); * initialize(); - * // `initialize` executes `createApplication` once + * // `initialize` invokes `createApplication` once */ var once = partial(before, 2); /** - * Creates a function that invokes `func` with any additional `partial` arguments - * prepended to those provided to the new function. This method is similar to - * `_.bind` except it does **not** alter the `this` binding. + * Creates a function that invokes `func` with `partial` arguments prepended + * to those provided to the new function. This method is similar to `_.bind` + * except it does **not** alter the `this` binding. * - * **Note:** This method does not set the `length` property of partially applied - * functions. + * **Note:** This method does not set the `length` property of partially + * applied functions. * * @static * @memberOf _ @@ -6247,15 +6278,15 @@ } /** - * Creates a function that only calls the `func` function at most once per - * every `wait` milliseconds. The created function comes with a `cancel` method - * to cancel delayed calls. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. + * Creates a function that only invokes `func` at most once per every `wait` + * milliseconds. The created function comes with a `cancel` method to cancel + * delayed invokes. 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 called on - * the trailing edge of the timeout only if the the throttled function is + * **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) @@ -6265,11 +6296,11 @@ * @memberOf _ * @category Function * @param {Function} func The function to throttle. - * @param {number} wait The number of milliseconds to throttle executions to. + * @param {number} wait The number of milliseconds to throttle invocations to. * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify execution on the leading + * @param {boolean} [options.leading=true] Specify invoking on the leading * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify execution on the trailing + * @param {boolean} [options.trailing=true] Specify invoking on the trailing * edge of the timeout. * @returns {Function} Returns the new throttled function. * @example @@ -6277,7 +6308,7 @@ * // avoid excessively updating the position while scrolling * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * - * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }) * jQuery('.interactive').on('click', throttled); * @@ -6305,9 +6336,9 @@ /** * Creates a function that provides `value` to the wrapper function as its - * first argument. Additional arguments provided to the function are appended - * to those provided to the wrapper function. The wrapper is executed with - * the `this` binding of the created function. + * 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 _ @@ -6333,7 +6364,7 @@ /** * Assigns own enumerable properties of source object(s) to the destination * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is executed to produce the assigned values. + * If `customizer` is provided it is invoked to produce the assigned values. * The `customizer` is bound to `thisArg` and invoked with five arguments; * (objectValue, sourceValue, key, object, source). * @@ -6363,7 +6394,7 @@ /** * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, * otherwise they are assigned by reference. If `customizer` is provided it is - * executed to produce the cloned values. If `customizer` returns `undefined` + * invoked to produce the cloned values. If `customizer` returns `undefined` * cloning is handled by the method instead. The `customizer` is bound to * `thisArg` and invoked with two argument; (value, index|key). * @@ -6425,7 +6456,7 @@ } /** - * Creates a deep clone of `value`. If `customizer` is provided it is executed + * Creates a deep clone of `value`. If `customizer` is provided it is invoked * to produce the cloned values. If `customizer` returns `undefined` cloning * is handled by the method instead. The `customizer` is bound to `thisArg` * and invoked with two argument; (value, index|key). @@ -6550,7 +6581,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -6596,7 +6627,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -6628,7 +6659,7 @@ } /** - * Iterates over own and inherited enumerable properties of an object executing + * Iterates over own and inherited enumerable properties of an object invoking * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, key, object). Iterator functions may exit * iteration early by explicitly returning `false`. @@ -6637,7 +6668,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6669,7 +6700,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6692,7 +6723,7 @@ } /** - * Iterates over own enumerable properties of an object executing `iteratee` + * Iterates over own enumerable properties of an object invoking `iteratee` * for each property. The `iteratee` is bound to `thisArg` and invoked with * three arguments; (value, key, object). Iterator functions may exit iteration * early by explicitly returning `false`. @@ -6701,7 +6732,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6726,7 +6757,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Object} Returns `object`. * @example @@ -6754,7 +6785,7 @@ * @example * * _.functions(_); - * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + * // => ['all', 'any', 'bind', ...] */ function functions(object) { return baseFunctions(object, keysIn(object)); @@ -6845,7 +6876,8 @@ * // => false */ function isArguments(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && toString.call(value) == argsClass) || false; } @@ -6981,7 +7013,7 @@ /** * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is executed to compare values. + * equivalent. If `customizer` is provided it is invoked to compare values. * If `customizer` returns `undefined` comparisons are handled by the method * instead. The `customizer` is bound to `thisArg` and invoked with three * arguments; (value, other, key). @@ -7175,12 +7207,7 @@ if (isFunction(value)) { return reNative.test(fnToString.call(value)); } - if (value && typeof value == 'object') { - return !('constructor' in value) && isHostObject(value) - ? reNative.test(value) - : reHostCtor.test(toString.call(value)); - } - return false; + return (value && typeof value == 'object' && reHostCtor.test(value)) || false; } /** @@ -7435,7 +7462,7 @@ * @memberOf _ * @category Object * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -7468,8 +7495,8 @@ * Recursively merges own enumerable properties of the source object(s), that * don't resolve to `undefined` into the destination object. Subsequent sources * overwrite property assignments of previous sources. If `customizer` is - * provided it is executed to produce the merged values of the destination - * and source properties. If `customizer` returns `undefined` merging is handled + * provided it is invoked to produce the merged values of the destination and + * source properties. If `customizer` returns `undefined` merging is handled * by the method instead. The `customizer` is bound to `thisArg` and invoked * with five arguments; (objectValue, sourceValue, key, object, source). * @@ -7520,7 +7547,7 @@ /** * Creates a shallow clone of `object` excluding the specified properties. * Property names may be specified as individual arguments or as arrays of - * property names. If a predicate is provided it is executed for each property + * property names. If a predicate is provided it is invoked for each property * of `object` omitting the properties the predicate returns truthy for. The * predicate is bound to `thisArg` and invoked with three arguments; * (value, key, object). @@ -7529,7 +7556,7 @@ * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function called per + * @param {Function|...(string|string[])} [predicate] The function invoked per * iteration or property names to omit, specified as individual property * names or arrays of property names. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -7589,7 +7616,7 @@ /** * Creates a shallow clone of `object` composed of the specified properties. * Property names may be specified as individual arguments or as arrays of - * property names. If a predicate is provided it is executed for each property + * property names. If a predicate is provided it is invoked for each property * of `object` picking the properties the predicate returns truthy for. The * predicate is bound to `thisArg` and invoked with three arguments; * (value, key, object). @@ -7598,7 +7625,7 @@ * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function called per + * @param {Function|...(string|string[])} [predicate] The function invoked per * iteration or property names to pick, specified as individual property * names or arrays of property names. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -7626,7 +7653,7 @@ /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own - * enumerable properties through `iteratee`, with each execution potentially + * enumerable properties through `iteratee`, with each invocation potentially * mutating the `accumulator` object. The `iteratee` is bound to `thisArg` * and invoked with four arguments; (accumulator, value, key, object). Iterator * functions may exit iteration early by explicitly returning `false`. @@ -7635,7 +7662,7 @@ * @memberOf _ * @category Object * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -7808,7 +7835,7 @@ } /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to + * Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to * their corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional characters @@ -8437,7 +8464,7 @@ /** * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, and `'` in `string` to their + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their * corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional HTML @@ -8463,7 +8490,7 @@ /*--------------------------------------------------------------------------*/ /** - * Attempts to execute `func`, returning either the result or the caught + * Attempts to invoke `func`, returning either the result or the caught * error object. * * @static @@ -8766,7 +8793,7 @@ * @example * * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be called + * // => logs the number of milliseconds it took for the deferred function to be invoked */ var now = nativeNow || function() { return new Date().getTime(); @@ -9005,15 +9032,15 @@ } /** - * Executes the iteratee function `n` times, returning an array of the results - * of each execution. The `iteratee` is bound to `thisArg` and invoked with + * Invokes the iteratee function `n` times, returning an array of the results + * of each invocation. The `iteratee` is bound to `thisArg` and invoked with * one argument; (index). * * @static * @memberOf _ * @category Utility - * @param {number} n The number of times to execute `iteratee`. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array} Returns the array of results. * @example @@ -9022,10 +9049,10 @@ * // => [3, 6, 4] * * _.times(3, function(n) { mage.castSpell(n); }); - * // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively + * // => invokes `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively * * _.times(3, function(n) { this.cast(n); }, mage); - * // => also calls `mage.castSpell(n)` three times + * // => also invokes `mage.castSpell(n)` three times */ function times(n, iteratee, thisArg) { n = nativeIsFinite(n = +n) && n > -1 ? n : 0; @@ -9085,7 +9112,6 @@ lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; - lodash.compose = compose; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; @@ -9103,6 +9129,8 @@ lodash.filter = filter; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; + lodash.flow = flow; + lodash.flowRight = flowRight; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; @@ -9165,7 +9193,9 @@ lodash.zipObject = zipObject; // add aliases + lodash.backflow = flowRight; lodash.collect = map; + lodash.compose = flowRight; lodash.each = forEach; lodash.eachRight = forEachRight; lodash.extend = assign; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 93c5c3717..8a9458147 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,69 +4,69 @@ * Build: `lodash modern -o ./dist/lodash.js` */ ;(function(){function n(n,t){for(var r=-1,e=t.length,u=Array(e);++rt||typeof n=="undefined")return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) -}function v(n){for(var t=-1,r=n.length;++ti(t,a)&&c.push(a);return c}function qt(n,t){var r=n?n.length:0;if(typeof r!="number"||-1>=r||r>T)return Gt(n,t); +}function f(n,t){for(var r=n.length;r--&&-1=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) +}function v(n){for(var t=-1,r=n.length;++ti(t,a)&&c.push(a);return c}function qt(n,t){var r=n?n.length:0;if(typeof r!="number"||-1>=r||r>T)return Ht(n,t); for(var e=-1,u=Nr(n);++e=r||r>T)return Qt(n,t);for(var e=Nr(n);r--&&false!==t(e[r],r,e););return n}function Zt(n,t){var r=true;return qt(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Kt(n,t){var r=[];return qt(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function Vt(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function Yt(n,t,r,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++e>>1,a=r(n[f]),c=e?a<=t:ao(l,s)&&((t||a)&&l.push(s),c.push(p))}return c}function sr(n,t){for(var r=-1,e=t(n),u=e.length,o=Be(u);++rt)return r; -var e=typeof arguments[2];if("number"!=e&&"string"!=e||!arguments[3]||arguments[3][arguments[2]]!==arguments[1]||(t=2),3e?ju(u+e,0):e||0;else if(e)return e=qr(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function Mr(n){return zr(n,1) -}function zr(n,t,r){var u=-1,o=n?n.length:0;if(t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),r=typeof r=="undefined"||r>o?o:+r||0,0>r&&(r+=o),r&&r==o&&!t)return e(n);for(o=t>r?0:r-t,r=Be(o);++ur?ju(e+r,0):r||0:0,typeof n=="string"||!Bu(n)&&Oe(n)?ru&&(u=f);else t=i&&f?o:xr(t,r,3),qt(n,function(n,r,o){r=t(n,r,o),(r>e||-1/0===r&&r===u)&&(e=r,u=n)});return u}function ee(n,t){return te(n,$e(t))}function ue(n,t,r,e){return(Bu(n)?St:fr)(n,xr(t,e,4),r,3>arguments.length,qt)}function oe(n,t,r,e){return(Bu(n)?Ct:fr)(n,xr(t,e,4),r,3>arguments.length,Pt) -}function ie(n){n=Nr(n);for(var t=-1,r=n.length,e=Be(r);++targuments.length)return Ar(n,w,null,t);var r=zr(arguments,2),e=Tr(r,ce.placeholder);return or(n,w|E,r,e,t)}function le(n,t){var r=w|j;if(2=r||r>t?(f&&iu(f),r=s,f=p=s=_,r&&(h=Vu(),a=n.apply(l,i),p||f||(i=l=null))):p=su(e,r)}function u(){p&&iu(p),f=p=s=_,(v||g!==t)&&(h=Vu(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=Vu(),l=this,s=v&&(p||!y),false===g)var r=y&&!p;else{f||y||(h=c);var o=g-(c-h),d=0>=o||o>g; -d?(f&&(f=iu(f)),h=c,a=n.apply(l,i)):f||(f=su(u,o))}return d&&p?p=iu(p):p||t===g||(p=su(e,t)),r&&(d=true,a=n.apply(l,i)),!d||p||f||(i=l=null),a}var i,f,a,c,l,p,s,h=0,g=false,v=true;if(!be(n))throw new Ye(C);if(t=0>t?0:t,true===r)var y=true,v=false;else we(r)&&(y=r.leading,g="maxWait"in r&&ju(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){p&&iu(p),f&&iu(f),f=p=s=_},o}function ge(n){var t=zr(arguments,1),r=Tr(t,ge.placeholder);return or(n,E,t,r)}function ve(n){var t=zr(arguments,1),r=Tr(t,ve.placeholder); -return or(n,I,t,r)}function ye(n){return nr(n,Ee(n))}function de(n){return n&&typeof n=="object"&&typeof n.length=="number"&&tu.call(n)==ut||false}function me(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,e=n.constructor,u=-1,e=e&&n===e.prototype,o=r-1,i=Be(r),f=0t||null==n||!bu(t))return r;n=Ve(n);do t%2&&(r+=n),t=fu(t/2),n+=n;while(t);return r}function Se(n,t){return(n=null==n?"":Ve(n))?null==t?n.slice(v(n),y(n)+1):(t=Ve(t),n.slice(i(n,t),f(n,t)+1)):n}function Ce(n){try{return n()}catch(t){return _e(t)?t:Me(t)}}function Fe(n,t){return $t(n,t)}function Te(n){return n}function Ue(n){var t=zu(n),r=t.length; -if(1==r){var e=t[0],u=n[e];if(Sr(u))return function(n){return null!=n&&u===n[e]&&Qe.call(n,e)}}for(var o=r,i=Be(r),f=Be(r);o--;){var u=n[t[o]],a=Sr(u);i[o]=a,f[o]=a?u:Bt(u)}return function(n){if(o=r,null==n)return!o;for(;o--;)if(i[o]?f[o]!==n[t[o]]:!Qe.call(n,t[o]))return false;for(o=r;o--;)if(i[o]?!Qe.call(n,t[o]):!tr(f[o],n[t[o]],null,true))return false;return true}}function We(n,t,r){var e=true,u=we(t),o=null==r,i=o&&u&&zu(t),f=i&&nr(t,i);(i&&i.length&&!f.length||o&&!u)&&(o&&(r=t),f=false,t=n,n=this),f||(f=nr(t,zu(t))),false===r?e=false:we(r)&&"chain"in r&&(e=r.chain),r=-1,u=be(n); -for(o=f.length;++rk)return r}else n=0;return ar(r,e)}}(),Tu=yr(function(n,t,r){Qe.call(n,r)?++n[r]:n[r]=1}),Uu=yr(function(n,t,r){Qe.call(n,r)?n[r].push(t):n[r]=[t]}),Wu=yr(function(n,t,r){n[r]=t -}),Nu=yr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Lu=ge(ae,2),$u=dr(Lt),Bu=_u||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&tu.call(n)==ot||false};Su.dom||(me=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!Mu(n)||false});var Du=Ou||function(n){return typeof n=="number"&&bu(n)},Mu=au?function(n){if(!n||tu.call(n)!=lt)return false;var t=n.valueOf,r=je(t)&&(r=au(t))&&au(r);return r?n==r||au(n)==r:Ur(n)}:Ur,zu=wu?function(n){n=Lr(n);var t=n.constructor,r=n.length; -return t&&n===t.prototype||typeof r=="number"&&0--n?t.apply(this,arguments):void 0}},g.assign=$u,g.at=function(t){var r=t?t.length:0;return typeof r=="number"&&-1t?0:t)},g.dropRight=function(n,t,r){var e=n?n.length:0;return t=e-((null==t||r?1:t)||0),zr(n,0,0>t?0:t)},g.dropRightWhile=function(n,t,r){var e=n?n.length:0;for(t=xr(t,r,3);e--&&t(n[e],e,n););return zr(n,0,e+1)},g.dropWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=xr(t,r,3);++e(s?u(s,a):i(p,a))){for(t=e;--t;){var h=o[t];if(0>(h?u(h,a):i(n[t],a)))continue n}s&&s.push(a),p.push(a)}return p},g.invert=function(n,t){for(var r=-1,e=zu(n),u=e.length,o={};++rt?0:t)},g.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((null==t||r?1:t)||0),zr(n,0>t?0:t)},g.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=xr(t,r,3);e--&&t(n[e],e,n););return zr(n,e+1)},g.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=xr(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},g.escape=function(n){return n=null==n?"":Ve(n),M.lastIndex=0,M.test(n)?n.replace(M,s):n},g.escapeRegExp=ke,g.every=Jr,g.find=Gr,g.findIndex=$r,g.findKey=function(n,t,r){return t=xr(t,r,3),Vt(n,t,Gt,true)},g.findLast=function(n,t,r){return t=xr(t,r,3),Vt(n,t,Pt)},g.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=xr(t,r,3);e--;)if(t(n[e],e,n))return e; -return-1},g.findLastKey=function(n,t,r){return t=xr(t,r,3),Vt(n,t,Qt,true)},g.findWhere=function(n,t){return Gr(n,Ue(t))},g.first=Br,g.has=function(n,t){return n?Qe.call(n,t):false},g.identity=Te,g.indexOf=Dr,g.isArguments=de,g.isArray=Bu,g.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&tu.call(n)==it||false},g.isDate=function(n){return n&&typeof n=="object"&&tu.call(n)==ft||false},g.isElement=me,g.isEmpty=function(n){if(null==n)return true;var t=n.length;return typeof t=="number"&&-1r?ju(u+r,0):Au(r||0,u-1))+1; -else if(r)return u=Pr(n,t)-1,e&&n[u]===t?u:-1;for(r=t===t;u--;)if(e=n[u],r?e===t:e!==e)return u;return-1},g.max=re,g.min=function(n,t,r){var e=1/0,u=e,i=typeof t;"number"!=i&&"string"!=i||!r||r[t]!==n||(t=null);var i=null==t,f=!(i&&Bu(n))&&Oe(n);if(i&&!f)for(r=-1,n=Nr(n),i=n.length;++rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},g.template=function(n,t,r){var e=g.templateSettings;t=$u({},r||t,e,Nt),n=Ve(null==n?"":n),r=$u({},t.imports,e.imports,Nt); -var u,o,i=zu(r),f=Ie(r),a=0;r=t.interpolate||X;var c="__p+='";if(r=Ke((t.escape||X).source+"|"+r.source+"|"+(r===P?Z:X).source+"|"+(t.evaluate||X).source+"|$","g"),n.replace(r,function(t,r,e,i,f,l){return e||(e=i),c+=n.slice(a,l).replace(nt,h),r&&(u=true,c+="'+__e("+r+")+'"),f&&(o=true,c+="';"+f+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),a=l+t.length,t}),c+="';",(t=t.variable)||(c="with(obj){"+c+"}"),c=(o?c.replace(L,""):c).replace($,"$1").replace(B,"$1;"),c="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}",t=Ce(function(){return ze(i,"return "+c).apply(_,f) -}),t.source=c,_e(t))throw t;return t},g.trim=Se,g.trimLeft=function(n,t){return(n=null==n?"":Ve(n))?null==t?n.slice(v(n)):(t=Ve(t),n.slice(i(n,t))):n},g.trimRight=function(n,t){return(n=null==n?"":Ve(n))?null==t?n.slice(0,y(n)+1):(t=Ve(t),n.slice(0,f(n,t)+1)):n},g.trunc=function(n,t){var r=30,e="...";if(we(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Ve(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Ve(n),r>=n.length)return n;var o=r-e.length;if(1>o)return e; -if(r=n.slice(0,o),null==u)return r+e;if(xe(u)){if(n.slice(o).search(u)){var i,f,a=n.slice(0,o);for(u.global||(u=Ke(u.source,(K.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(a);)f=i.index;r=r.slice(0,null==f?o:f)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1t?0:+t||0,n.length),n)},Gt(g,function(n,t){var r="sample"!=t;g.prototype[t]||(g.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new J(o,u):o})}),g.VERSION=b,g.prototype.chain=function(){return this.__chain__=true,this},g.prototype.toJSON=Yr,g.prototype.toString=function(){return Ve(this.__wrapped__) -},g.prototype.value=Yr,g.prototype.valueOf=Yr,tt(["join","pop","shift"],function(n){var t=He[n];g.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new J(r,n):r}}),tt(["push","reverse","sort","unshift"],function(n){var t=He[n];g.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tt(["concat","splice"],function(n){var t=He[n];g.prototype[n]=function(){return new J(t.apply(this.__wrapped__,arguments),this.__chain__)}}),g}var _,b="3.0.0-pre",w=1,j=2,A=4,x=8,O=16,E=32,I=64,k=150,R=16,S="__lodash_"+b.replace(/[-.]/g,"_")+"__",C="Expected a function",F=Math.pow(2,32)-1,T=Math.pow(2,53)-1,U="__lodash_placeholder__",W=0,N=/^[A-Z]+$/,L=/\b__p\+='';/g,$=/\b(__p\+=)''\+/g,B=/(__e\(.*?\)|\b__t\))\+'';/g,D=/&(?:amp|lt|gt|quot|#39|#96);/g,M=/[&<>"'`]/g,z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,P=/<%=([\s\S]+?)%>/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,K=/\w*$/,V=/^\s*function[ \n\r\t]+\w/,Y=/^0[xX]/,H=/^\[object .+?Constructor\]$/,J=/[\xC0-\xFF]/g,X=/($^)/,G=/[.*+?^${}()|[\]\/\\]/g,Q=/\bthis\b/,nt=/['\n\r\u2028\u2029\\]/g,tt=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,rt=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",et="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),ut="[object Arguments]",ot="[object Array]",it="[object Boolean]",ft="[object Date]",at="[object Error]",ct="[object Number]",lt="[object Object]",pt="[object RegExp]",st="[object String]",ht="[object ArrayBuffer]",gt="[object Float32Array]",vt="[object Float64Array]",yt="[object Int8Array]",dt="[object Int16Array]",mt="[object Int32Array]",_t="[object Uint8Array]",bt="[object Uint8ClampedArray]",wt="[object Uint16Array]",jt="[object Uint32Array]",At={}; -At[ut]=At[ot]=At[gt]=At[vt]=At[yt]=At[dt]=At[mt]=At[_t]=At[bt]=At[wt]=At[jt]=true,At[ht]=At[it]=At[ft]=At[at]=At["[object Function]"]=At["[object Map]"]=At[ct]=At[lt]=At[pt]=At["[object Set]"]=At[st]=At["[object WeakMap]"]=false;var xt={};xt[ut]=xt[ot]=xt[ht]=xt[it]=xt[ft]=xt[gt]=xt[vt]=xt[yt]=xt[dt]=xt[mt]=xt[ct]=xt[lt]=xt[pt]=xt[st]=xt[_t]=xt[bt]=xt[wt]=xt[jt]=true,xt[at]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Set]"]=xt["[object WeakMap]"]=false;var Ot={leading:false,maxWait:0,trailing:false},Et={configurable:false,enumerable:false,value:null,writable:false},It={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},kt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Rt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"AE","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\xd7":" ","\xf7":" "},St={"function":true,object:true},Ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ft=St[typeof window]&&window||this,Tt=St[typeof exports]&&exports&&!exports.nodeType&&exports,St=St[typeof module]&&module&&!module.nodeType&&module,Ut=Tt&&St&&typeof global=="object"&&global; +if(f&&typeof f=="object"&&typeof f.length=="number"&&(Du(f)||me(f))){t&&(f=Yt(f,t,r));var a=-1,c=f.length;for(i.length+=c;++al))return false}else{var g=s&&nu.call(n,"__wrapped__"),h=h&&nu.call(t,"__wrapped__"); +if(g||h)return tr(g?n.__wrapped__:n,h?t.__wrapped__:t,r,e,u,o);if(!p)return false;if(!f&&!s){switch(c){case it:case ft:return+n==+t;case ct:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case pt:case st:return n==Ye(t)}return false}if(g=l?Ke:n.constructor,c=i?Ke:t.constructor,f){if(g.prototype.name!=c.prototype.name)return false}else if(s=!l&&nu.call(n,"constructor"),h=!i&&nu.call(t,"constructor"),s!=h||!(s||g==c||we(g)&&g instanceof g&&we(c)&&c instanceof c)&&"constructor"in n&&"constructor"in t)return false;if(g=f?["message","name"]:qu(n),c=f?g:qu(t),l&&g.push("length"),i&&c.push("length"),l=g.length,s=c.length,l!=s&&!e)return false +}for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n)return o[c]==t;if(u.push(n),o.push(t),i=true,a)for(;i&&++c>>1,a=r(n[f]),c=e?a<=t:ao(l,s)&&((t||a)&&l.push(s),c.push(p))}return c}function sr(n,t){for(var r=-1,e=t(n),u=e.length,o=De(u);++rt)return r; +var e=typeof arguments[2];if("number"!=e&&"string"!=e||!arguments[3]||arguments[3][arguments[2]]!==arguments[1]||(t=2),3e?Au(u+e,0):e||0;else if(e)return e=qr(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function Mr(n){return zr(n,1)}function zr(n,t,r){var u=-1,o=n?n.length:0;if(t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),r=typeof r=="undefined"||r>o?o:+r||0,0>r&&(r+=o),r&&r==o&&!t)return e(n);for(o=t>r?0:r-t,r=De(o);++ur?Au(e+r,0):r||0:0,typeof n=="string"||!Du(n)&&Oe(n)?ru&&(u=f);else t=i&&f?o:xr(t,r,3),qt(n,function(n,r,o){r=t(n,r,o),(r>e||-1/0===r&&r===u)&&(e=r,u=n) +});return u}function ee(n,t){return te(n,Be(t))}function ue(n,t,r,e){return(Du(n)?St:fr)(n,xr(t,e,4),r,3>arguments.length,qt)}function oe(n,t,r,e){return(Du(n)?Ct:fr)(n,xr(t,e,4),r,3>arguments.length,Pt)}function ie(n){n=Nr(n);for(var t=-1,r=n.length,e=De(r);++targuments.length)return Ar(n,w,null,t);var r=zr(arguments,2),e=Tr(r,ce.placeholder);return or(n,w|O,r,e,t)}function le(n,t){var r=w|j;if(2=r||r>t?(f&&fu(f),r=s,f=p=s=_,r&&(h=Yu(),a=n.apply(l,i),p||f||(i=l=null))):p=hu(e,r) +}function u(){p&&fu(p),f=p=s=_,(v||g!==t)&&(h=Yu(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=Yu(),l=this,s=v&&(p||!y),false===g)var r=y&&!p;else{f||y||(h=c);var o=g-(c-h),d=0>=o||o>g;d?(f&&(f=fu(f)),h=c,a=n.apply(l,i)):f||(f=hu(u,o))}return d&&p?p=fu(p):p||t===g||(p=hu(e,t)),r&&(d=true,a=n.apply(l,i)),!d||p||f||(i=l=null),a}var i,f,a,c,l,p,s,h=0,g=false,v=true;if(!we(n))throw new Je(C);if(t=0>t?0:t,true===r)var y=true,v=false;else je(r)&&(y=r.leading,g="maxWait"in r&&Au(+r.maxWait||0,t),v="trailing"in r?r.trailing:v); +return o.cancel=function(){p&&fu(p),f&&fu(f),f=p=s=_},o}function ge(){var n=arguments,t=n.length-1;if(0>t)return function(){};if(!It(n,we))throw new Je(C);return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function ve(n){var t=zr(arguments,1),r=Tr(t,ve.placeholder);return or(n,O,t,r)}function ye(n){var t=zr(arguments,1),r=Tr(t,ye.placeholder);return or(n,I,t,r)}function de(n){return nr(n,Ie(n))}function me(n){var t=n&&typeof n=="object"?n.length:_;return typeof t=="number"&&-1>>0,e=n.constructor,u=-1,e=e&&n===e.prototype,o=r-1,i=De(r),f=0t||null==n||!wu(t))return r;n=Ye(n);do t%2&&(r+=n),t=au(t/2),n+=n;while(t);return r}function Ce(n,t){return(n=null==n?"":Ye(n))?null==t?n.slice(v(n),y(n)+1):(t=Ye(t),n.slice(i(n,t),f(n,t)+1)):n}function Fe(n){try{return n()}catch(t){return be(t)?t:ze(t)}}function Te(n,t){return $t(n,t)}function Ue(n){return n}function We(n){var t=qu(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Sr(u))return function(n){return null!=n&&u===n[e]&&nu.call(n,e)}}for(var o=r,i=De(r),f=De(r);o--;){var u=n[t[o]],a=Sr(u); +i[o]=a,f[o]=a?u:Bt(u)}return function(n){if(o=r,null==n)return!o;for(;o--;)if(i[o]?f[o]!==n[t[o]]:!nu.call(n,t[o]))return false;for(o=r;o--;)if(i[o]?!nu.call(n,t[o]):!tr(f[o],n[t[o]],null,true))return false;return true}}function Ne(n,t,r){var e=true,u=je(t),o=null==r,i=o&&u&&qu(t),f=i&&nr(t,i);(i&&i.length&&!f.length||o&&!u)&&(o&&(r=t),f=false,t=n,n=this),f||(f=nr(t,qu(t))),false===r?e=false:je(r)&&"chain"in r&&(e=r.chain),r=-1,u=we(n);for(o=f.length;++r=k)return r}else n=0;return ar(r,e)}}(),Uu=yr(function(n,t,r){nu.call(n,r)?++n[r]:n[r]=1}),Wu=yr(function(n,t,r){nu.call(n,r)?n[r].push(t):n[r]=[t]}),Nu=yr(function(n,t,r){n[r]=t}),Lu=yr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),$u=ve(ae,2),Bu=dr(Lt),Du=bu||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ru.call(n)==ot||false +};Cu.dom||(_e=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!zu(n)||false});var Mu=Ou||function(n){return typeof n=="number"&&wu(n)},zu=cu?function(n){if(!n||ru.call(n)!=lt)return false;var t=n.valueOf,r=Ae(t)&&(r=cu(t))&&cu(r);return r?n==r||cu(n)==r:Ur(n)}:Ur,qu=ju?function(n){n=Lr(n);var t=n.constructor,r=n.length;return t&&n===t.prototype||typeof r=="number"&&0--n?t.apply(this,arguments):void 0}},g.assign=Bu,g.at=function(t){var r=t?t.length:0; +return typeof r=="number"&&-1t?0:t)},g.dropRight=function(n,t,r){var e=n?n.length:0;return t=e-((null==t||r?1:t)||0),zr(n,0,0>t?0:t)},g.dropRightWhile=function(n,t,r){var e=n?n.length:0;for(t=xr(t,r,3);e--&&t(n[e],e,n););return zr(n,0,e+1)},g.dropWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=xr(t,r,3);++e(s?u(s,a):i(p,a))){for(t=e;--t;){var h=o[t]; +if(0>(h?u(h,a):i(n[t],a)))continue n}s&&s.push(a),p.push(a)}return p},g.invert=function(n,t){for(var r=-1,e=qu(n),u=e.length,o={};++rt?0:t)},g.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((null==t||r?1:t)||0),zr(n,0>t?0:t)},g.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=xr(t,r,3);e--&&t(n[e],e,n););return zr(n,e+1)},g.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0; +for(t=xr(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},g.escape=function(n){return n=null==n?"":Ye(n),M.lastIndex=0,M.test(n)?n.replace(M,s):n},g.escapeRegExp=Re,g.every=Xr,g.find=Hr,g.findIndex=$r,g.findKey=function(n,t,r){return t=xr(t,r,3),Vt(n,t,Ht,true)},g.findLast=function(n,t,r){return t=xr(t,r,3),Vt(n,t,Pt) +},g.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=xr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},g.findLastKey=function(n,t,r){return t=xr(t,r,3),Vt(n,t,Qt,true)},g.findWhere=function(n,t){return Hr(n,We(t))},g.first=Br,g.has=function(n,t){return n?nu.call(n,t):false},g.identity=Ue,g.indexOf=Dr,g.isArguments=me,g.isArray=Du,g.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ru.call(n)==it||false},g.isDate=function(n){return n&&typeof n=="object"&&ru.call(n)==ft||false},g.isElement=_e,g.isEmpty=function(n){if(null==n)return true; +var t=n.length;return typeof t=="number"&&-1r?Au(u+r,0):xu(r||0,u-1))+1;else if(r)return u=Pr(n,t)-1,e&&n[u]===t?u:-1;for(r=t===t;u--;)if(e=n[u],r?e===t:e!==e)return u;return-1},g.max=re,g.min=function(n,t,r){var e=1/0,u=e,i=typeof t;"number"!=i&&"string"!=i||!r||r[t]!==n||(t=null);var i=null==t,f=!(i&&Du(n))&&Oe(n);if(i&&!f)for(r=-1,n=Nr(n),i=n.length;++rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},g.template=function(n,t,r){var e=g.templateSettings;t=Bu({},r||t,e,Nt),n=Ye(null==n?"":n),r=Bu({},t.imports,e.imports,Nt); +var u,o,i=qu(r),f=ke(r),a=0;r=t.interpolate||G;var c="__p+='";if(r=Ve((t.escape||G).source+"|"+r.source+"|"+(r===P?Z:G).source+"|"+(t.evaluate||G).source+"|$","g"),n.replace(r,function(t,r,e,i,f,l){return e||(e=i),c+=n.slice(a,l).replace(nt,h),r&&(u=true,c+="'+__e("+r+")+'"),f&&(o=true,c+="';"+f+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),a=l+t.length,t}),c+="';",(t=t.variable)||(c="with(obj){"+c+"}"),c=(o?c.replace(L,""):c).replace($,"$1").replace(B,"$1;"),c="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}",t=Fe(function(){return qe(i,"return "+c).apply(_,f) +}),t.source=c,be(t))throw t;return t},g.trim=Ce,g.trimLeft=function(n,t){return(n=null==n?"":Ye(n))?null==t?n.slice(v(n)):(t=Ye(t),n.slice(i(n,t))):n},g.trimRight=function(n,t){return(n=null==n?"":Ye(n))?null==t?n.slice(0,y(n)+1):(t=Ye(t),n.slice(0,f(n,t)+1)):n},g.trunc=function(n,t){var r=30,e="...";if(je(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Ye(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Ye(n),r>=n.length)return n;var o=r-e.length;if(1>o)return e; +if(r=n.slice(0,o),null==u)return r+e;if(Ee(u)){if(n.slice(o).search(u)){var i,f,a=n.slice(0,o);for(u.global||(u=Ve(u.source,(K.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(a);)f=i.index;r=r.slice(0,null==f?o:f)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1t?0:+t||0,n.length),n)},Ht(g,function(n,t){var r="sample"!=t;g.prototype[t]||(g.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new X(o,u):o})}),g.VERSION=b,g.prototype.chain=function(){return this.__chain__=true,this},g.prototype.toJSON=Yr,g.prototype.toString=function(){return Ye(this.__wrapped__) +},g.prototype.value=Yr,g.prototype.valueOf=Yr,tt(["join","pop","shift"],function(n){var t=Xe[n];g.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new X(r,n):r}}),tt(["push","reverse","sort","unshift"],function(n){var t=Xe[n];g.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tt(["concat","splice"],function(n){var t=Xe[n];g.prototype[n]=function(){return new X(t.apply(this.__wrapped__,arguments),this.__chain__)}}),g}var _,b="3.0.0-pre",w=1,j=2,A=4,x=8,E=16,O=32,I=64,k=150,R=16,S="__lodash_"+b.replace(/[-.]/g,"_")+"__",C="Expected a function",F=Math.pow(2,32)-1,T=Math.pow(2,53)-1,U="__lodash_placeholder__",W=0,N=/^[A-Z]+$/,L=/\b__p\+='';/g,$=/\b(__p\+=)''\+/g,B=/(__e\(.*?\)|\b__t\))\+'';/g,D=/&(?:amp|lt|gt|quot|#39|#96);/g,M=/[&<>"'`]/g,z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,P=/<%=([\s\S]+?)%>/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,K=/\w*$/,V=/^\s*function[ \n\r\t]+\w/,Y=/^0[xX]/,J=/^\[object .+?Constructor\]$/,X=/[\xC0-\xFF]/g,G=/($^)/,H=/[.*+?^${}()|[\]\/\\]/g,Q=/\bthis\b/,nt=/['\n\r\u2028\u2029\\]/g,tt=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,rt=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",et="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),ut="[object Arguments]",ot="[object Array]",it="[object Boolean]",ft="[object Date]",at="[object Error]",ct="[object Number]",lt="[object Object]",pt="[object RegExp]",st="[object String]",ht="[object ArrayBuffer]",gt="[object Float32Array]",vt="[object Float64Array]",yt="[object Int8Array]",dt="[object Int16Array]",mt="[object Int32Array]",_t="[object Uint8Array]",bt="[object Uint8ClampedArray]",wt="[object Uint16Array]",jt="[object Uint32Array]",At={}; +At[ut]=At[ot]=At[gt]=At[vt]=At[yt]=At[dt]=At[mt]=At[_t]=At[bt]=At[wt]=At[jt]=true,At[ht]=At[it]=At[ft]=At[at]=At["[object Function]"]=At["[object Map]"]=At[ct]=At[lt]=At[pt]=At["[object Set]"]=At[st]=At["[object WeakMap]"]=false;var xt={};xt[ut]=xt[ot]=xt[ht]=xt[it]=xt[ft]=xt[gt]=xt[vt]=xt[yt]=xt[dt]=xt[mt]=xt[ct]=xt[lt]=xt[pt]=xt[st]=xt[_t]=xt[bt]=xt[wt]=xt[jt]=true,xt[at]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Set]"]=xt["[object WeakMap]"]=false;var Et={leading:false,maxWait:0,trailing:false},Ot={configurable:false,enumerable:false,value:null,writable:false},It={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},kt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Rt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"AE","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\xd7":" ","\xf7":" "},St={"function":true,object:true},Ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ft=St[typeof window]&&window||this,Tt=St[typeof exports]&&exports&&!exports.nodeType&&exports,St=St[typeof module]&&module&&!module.nodeType&&module,Ut=Tt&&St&&typeof global=="object"&&global; !Ut||Ut.global!==Ut&&Ut.window!==Ut&&Ut.self!==Ut||(Ft=Ut);var Ut=St&&St.exports===Tt&&Tt,Wt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=Wt, define(function(){return Wt})):Tt&&St?Ut?(St.exports=Wt)._=Wt:Tt._=Wt:Ft._=Wt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index d1a822643..32ce69e61 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -120,7 +120,7 @@ * **Note:** Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't require escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. - * See [Mathias' article](http://mathiasbynens.be/notes/ambiguous-ampersands) + * See [Mathias Bynens's article](http://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * Backticks are escaped because in Internet Explorer < 9, they can break out @@ -348,25 +348,25 @@ * * The chainable wrapper functions are: * `after`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `callback`, - * `chain`, `chunk`, `compact`, `compose`, `concat`, `constant`, `countBy`, - * `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, - * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, - * `flattenDeep`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, - * `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, `matches`, `memoize`, - * `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, `pairs`, `partial`, - * `partialRight`, `partition`, `pick`, `pluck`, `property`, `pull`, `pullAt`, - * `push`, `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, - * `sort`, `sortBy`, `splice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, - * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, - * `unzip`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, - * and `zipObject` + * `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `drop`, + * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, `flattenDeep`, + * `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, + * `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, + * `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, + * `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, + * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `pluck`, `property`, + * `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, `rest`, `reverse`, + * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `times`, `toArray`, + * `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, + * `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` * * The non-chainable wrapper functions are: * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `contains`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, - * `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, + * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, + * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, + * `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, * `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, `isFunction`, * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, @@ -449,18 +449,6 @@ * @type boolean */ support.spliceObjects = (splice.call(object, 0, 1), !object[0]); - - /** - * Detect if the host objects are detectable (IE < 9). - * - * @memberOf _.support - * @type boolean - */ - try { - support.hostObject = !({ 'toString': 0 } + ''); - } catch(e) { - support.hostObject = false; - } }(0, 0)); /** @@ -515,7 +503,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { @@ -536,7 +524,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns `true` if all elements passed the predicate check, * else `false` */ @@ -558,7 +546,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { @@ -578,7 +566,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { @@ -602,7 +590,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray=false] Specify using the first element of * `array` as the initial value. @@ -627,7 +615,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray=false] Specify using the last element of * `array` as the initial value. @@ -651,7 +639,7 @@ * * @private * @param {Array} array The array to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passed the predicate check, * else `false`. */ @@ -788,7 +776,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ function baseEach(collection, iteratee) { @@ -813,7 +801,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ function baseEachRight(collection, iteratee) { @@ -836,7 +824,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns `true` if all elements passed the predicate check, * else `false` */ @@ -856,7 +844,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { @@ -877,7 +865,7 @@ * * @private * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @param {boolean} [retKey=false] Specify returning the key of the found * element instead of the element itself. @@ -937,13 +925,13 @@ /** * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` executing `iteratee` for + * over `object` properties returned by `keysFunc` invoking `iteratee` for * each property. Iterator functions may exit iteration early by explicitly * returning `false`. * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ @@ -967,7 +955,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ @@ -990,7 +978,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForIn(object, iteratee) { @@ -1003,7 +991,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { @@ -1016,7 +1004,7 @@ * * @private * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { @@ -1199,7 +1187,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { @@ -1254,7 +1242,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initFromCollection Specify using the first or last element * of `collection` as the initial value. @@ -1276,7 +1264,7 @@ * * @private * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passed the predicate check, * else `false`. */ @@ -1297,7 +1285,7 @@ * @private * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function} iteratee The function called per iteration. + * @param {Function} iteratee The function invoked per iteration. * @param {boolean} [retHighest=false] Specify returning the highest, instead * of the lowest, index at which a value should be inserted into `array`. * @returns {number} Returns the index at which `value` should be inserted @@ -1335,7 +1323,7 @@ * * @private * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function called per iteration. + * @param {Function} [iteratee] The function invoked per iteration. * @returns {Array} Returns the new duplicate-value-free array. */ function baseUniq(array, iteratee) { @@ -1611,7 +1599,7 @@ * Gets the appropriate "indexOf" function. If the `_.indexOf` method is * customized this function returns the custom method, otherwise it returns * the `baseIndexOf` function. If arguments are provided the chosen function - * is executed with the arguments and its result is returned. + * is invoked with them and its result is returned. * * @private * @returns {Function|number} Returns the chosen function or its result. @@ -1651,7 +1639,7 @@ * * @private * @param {Object} object The source object. - * @param {Function} predicate The function called per iteration. + * @param {Function} predicate The function invoked per iteration. * @returns {Object} Returns the new object. */ function pickByCallback(object, predicate) { @@ -1718,7 +1706,7 @@ * * @private * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function called per iteration. + * @param {Function} [iteratee] The function invoked per iteration. * @returns {Array} Returns the new duplicate-value-free array. */ function sortedUniq(array, iteratee) { @@ -1875,7 +1863,7 @@ * @memberOf _ * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -2215,7 +2203,7 @@ /** * Uses a binary search to determine the lowest index at which a value should * be inserted into a given sorted array in order to maintain the sort order - * of the array. If an iteratee function is provided it is executed for `value` + * of the array. If an iteratee function is provided it is invoked for `value` * and each element of `array` to compute their sort ranking. The iteratee * function is bound to `thisArg` and invoked with one argument; (value). * @@ -2231,7 +2219,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -2315,7 +2303,7 @@ * Creates a duplicate-value-free version of an array using `SameValueZero` * for equality comparisons. Providing `true` for `isSorted` performs a faster * search algorithm for sorted arrays. If an iteratee function is provided it - * is executed for each value in the array to generate the criterion by which + * is invoked for each value in the array to generate the criterion by which * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, array). * @@ -2336,7 +2324,7 @@ * @category Array * @param {Array} array The array to inspect. * @param {boolean} [isSorted=false] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -2661,7 +2649,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -2698,7 +2686,7 @@ * @alias all * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -2747,7 +2735,7 @@ * @alias select * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -2794,7 +2782,7 @@ * @alias detect * @category Collection * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -2858,8 +2846,8 @@ } /** - * Iterates over elements of `collection` executing `iteratee` for each - * element. The `iteratee` is bound to `thisArg` and invoked with three arguments; + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The `iteratee` is bound to `thisArg` and invoked with three arguments; * (value, index|key, collection). Iterator functions may exit iteration early * by explicitly returning `false`. * @@ -2872,7 +2860,7 @@ * @alias each * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array|Object|string} Returns `collection`. * @example @@ -2907,7 +2895,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -2950,7 +2938,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -2977,9 +2965,9 @@ /** * Invokes the method named by `methodName` on each element in the collection, - * returning an array of the results of each invoked method. Additional arguments - * is provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in the collection. + * returning an array of the results of each invoked method. Any additional + * arguments are provided to each invoked method. If `methodName` is a function + * it is invoked for, and `this` bound to, each element in the collection. * * @static * @memberOf _ @@ -3018,7 +3006,7 @@ * @alias collect * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=identity] The function called + * @param {Function|Object|string} [iteratee=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -3050,7 +3038,7 @@ /** * Retrieves the maximum value of `collection`. If the collection is empty * or falsey `-Infinity` is returned. If an iteratee function is provided it - * is executed for each value in the collection to generate the criterion by + * is invoked for each value in the collection to generate the criterion by * which the value is ranked. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, collection). * @@ -3065,7 +3053,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -3128,7 +3116,7 @@ /** * Retrieves the minimum value of `collection`. If the collection is empty * or falsey `Infinity` is returned. If an iteratee function is provided it - * is executed for each value in the collection to generate the criterion by + * is invoked for each value in the collection to generate the criterion by * which the value is ranked. The `iteratee` is bound to `thisArg` and invoked * with three arguments; (value, index, collection). * @@ -3143,7 +3131,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee] The function called per iteration. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. * If a property name or object is provided it is used to create a "_.pluck" * or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. @@ -3220,7 +3208,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3277,7 +3265,7 @@ /** * Reduces a collection to a value which is the accumulated result of running * each element in the collection through `iteratee`, where each successive - * execution consumes the return value of the previous execution. If `accumulator` + * invocation is supplied the return value of the previous. If `accumulator` * is not provided the first element of the collection is used as the initial * value. The `iteratee` is bound to `thisArg`and invoked with four arguments; * (accumulator, value, index|key, collection). @@ -3287,7 +3275,7 @@ * @alias foldl, inject * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -3316,7 +3304,7 @@ * @alias foldr * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {*} Returns the accumulated value. @@ -3346,7 +3334,7 @@ * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3484,7 +3472,7 @@ * @alias any * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=identity] The function called + * @param {Function|Object|string} [predicate=identity] The function invoked * per iteration. If a property name or object is provided it is used to * create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -3538,7 +3526,7 @@ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. * @param {Array|Function|Object|string} [iteratee=identity] The function - * called per iteration. If property name(s) or an object is provided it + * invoked per iteration. If property name(s) or an object is provided it * is used to create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array} Returns the new sorted array. @@ -3642,13 +3630,13 @@ /*--------------------------------------------------------------------------*/ /** - * The opposite of `_.before`; this method creates a function that executes + * The opposite of `_.before`; this method creates a function that invokes * `func` only after it is called `n` times. * * @static * @memberOf _ * @category Function - * @param {number} n The number of calls before `func` is executed. + * @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 @@ -3677,13 +3665,13 @@ } /** - * Creates a function that executes `func`, with the `this` binding and + * Creates a function that invokes `func`, with the `this` binding and * arguments of the created function, until it is called `n` times. * * @static * @memberOf _ * @category Function - * @param {number} n The number of times `func` may be executed. + * @param {number} n The number of times `func` may be called. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example @@ -3772,68 +3760,14 @@ } /** - * Creates a function that is the composition of the provided functions, - * where each function consumes the return value of the function that follows. - * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. - * Each function is executed with the `this` binding of the composed function. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to compose. - * @returns {Function} Returns the new composed function. - * @example - * - * var realNameMap = { - * 'pebbles': 'penelope' - * }; - * - * var format = function(name) { - * name = realNameMap[name.toLowerCase()] || name; - * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); - * }; - * - * var greet = function(formatted) { - * return 'Hiya ' + formatted + '!'; - * }; - * - * var welcome = _.compose(greet, format); - * welcome('pebbles'); - * // => 'Hiya Penelope!' - */ - function compose() { - var funcs = arguments, - length = funcs.length, - index = length - 1; - - if (!length) { - return function() {}; - } - while (length--) { - if (!isFunction(funcs[length])) { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - length = index; - var result = funcs[length].apply(this, arguments); - - while (length--) { - result = funcs[length].call(this, result); - } - return result; - }; - } - - /** - * Creates a function that delays the execution of `func` until after `wait` + * Creates a function that delays the invocation of `func` until after `wait` * milliseconds have elapsed since the last time it was invoked. The created - * function comes with a `cancel` method to cancel delayed calls. Provide an + * function comes with a `cancel` method to cancel delayed invokes. 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` call. + * debounced function return the result of the last `func` invocation. * - * **Note:** If `leading` and `trailing` options are `true`, `func` is called on + * **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. * @@ -3846,11 +3780,11 @@ * @param {Function} func The function to debounce. * @param {number} wait The number of milliseconds to delay. * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify execution on the leading + * @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 is called. - * @param {boolean} [options.trailing=true] Specify execution on the trailing + * delayed before it is invoked. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing * edge of the timeout. * @returns {Function} Returns the new debounced function. * @example @@ -3858,13 +3792,13 @@ * // avoid costly calculations while the window size is in flux * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * - * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * // 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 executed once after 1 second of debounced calls + * // 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 @@ -4002,8 +3936,8 @@ } /** - * Defers executing the `func` function until the current call stack has - * cleared. Additional arguments are provided to `func` when it is invoked. + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it is invoked. * * @static * @memberOf _ @@ -4025,14 +3959,14 @@ } /** - * Executes the `func` function after `wait` milliseconds. Additional arguments - * are provided to `func` when it is invoked. + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it is invoked. * * @static * @memberOf _ * @category Function * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay execution. + * @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 @@ -4048,12 +3982,57 @@ return setTimeout(function() { func.apply(undefined, args); }, wait); } + /** + * 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 add(x, y) { + * return x + y; + * } + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight(square, add); + * addSquare(1, 2); + * // => 9 + */ + function flowRight() { + var funcs = arguments, + fromIndex = funcs.length - 1; + + if (fromIndex < 0) { + return function() {}; + } + if (!arrayEvery(funcs, isFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var index = fromIndex, + result = funcs[index].apply(this, arguments); + + while (index--) { + result = funcs[index].call(this, result); + } + return result; + }; + } + /** * 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 used as the cache key. The `func` is - * executed with the `this` binding of the memoized function. The result cache + * invoked with the `this` binding of the memoized function. The result cache * is exposed as the `cache` property on the memoized function. * * @static @@ -4100,8 +4079,8 @@ } /** - * Creates a function that is restricted to execute `func` once. Repeat calls - * to the function return the value of the first call. The `func` is executed + * 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 of the created function. * * @static @@ -4115,17 +4094,17 @@ * var initialize = _.once(createApplication); * initialize(); * initialize(); - * // `initialize` executes `createApplication` once + * // `initialize` invokes `createApplication` once */ var once = partial(before, 2); /** - * Creates a function that invokes `func` with any additional `partial` arguments - * prepended to those provided to the new function. This method is similar to - * `_.bind` except it does **not** alter the `this` binding. + * Creates a function that invokes `func` with `partial` arguments prepended + * to those provided to the new function. This method is similar to `_.bind` + * except it does **not** alter the `this` binding. * - * **Note:** This method does not set the `length` property of partially applied - * functions. + * **Note:** This method does not set the `length` property of partially + * applied functions. * * @static * @memberOf _ @@ -4148,15 +4127,15 @@ } /** - * Creates a function that only calls the `func` function at most once per - * every `wait` milliseconds. The created function comes with a `cancel` method - * to cancel delayed calls. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. + * Creates a function that only invokes `func` at most once per every `wait` + * milliseconds. The created function comes with a `cancel` method to cancel + * delayed invokes. 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 called on - * the trailing edge of the timeout only if the the throttled function is + * **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) @@ -4166,11 +4145,11 @@ * @memberOf _ * @category Function * @param {Function} func The function to throttle. - * @param {number} wait The number of milliseconds to throttle executions to. + * @param {number} wait The number of milliseconds to throttle invocations to. * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify execution on the leading + * @param {boolean} [options.leading=true] Specify invoking on the leading * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify execution on the trailing + * @param {boolean} [options.trailing=true] Specify invoking on the trailing * edge of the timeout. * @returns {Function} Returns the new throttled function. * @example @@ -4178,7 +4157,7 @@ * // avoid excessively updating the position while scrolling * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * - * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }) * jQuery('.interactive').on('click', throttled); * @@ -4207,9 +4186,9 @@ /** * Creates a function that provides `value` to the wrapper function as its - * first argument. Additional arguments provided to the function are appended - * to those provided to the wrapper function. The wrapper is executed with - * the `this` binding of the created function. + * 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 _ @@ -4235,7 +4214,7 @@ /** * Assigns own enumerable properties of source object(s) to the destination * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is executed to produce the assigned values. + * If `customizer` is provided it is invoked to produce the assigned values. * The `customizer` is bound to `thisArg` and invoked with five arguments; * (objectValue, sourceValue, key, object, source). * @@ -4284,7 +4263,7 @@ /** * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, * otherwise they are assigned by reference. If `customizer` is provided it is - * executed to produce the cloned values. If `customizer` returns `undefined` + * invoked to produce the cloned values. If `customizer` returns `undefined` * cloning is handled by the method instead. The `customizer` is bound to * `thisArg` and invoked with two argument; (value, index|key). * @@ -4388,7 +4367,7 @@ * @example * * _.functions(_); - * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + * // => ['all', 'any', 'bind', ...] */ function functions(object) { return baseFunctions(object, keysIn(object)); @@ -4468,7 +4447,8 @@ * // => false */ function isArguments(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && toString.call(value) == argsClass) || false; } // fallback for environments without a `[[Class]]` for `arguments` objects @@ -4603,7 +4583,7 @@ /** * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is executed to compare values. + * equivalent. If `customizer` is provided it is invoked to compare values. * If `customizer` returns `undefined` comparisons are handled by the method * instead. The `customizer` is bound to `thisArg` and invoked with three * arguments; (value, other, key). @@ -4801,12 +4781,7 @@ if (isFunction(value)) { return reNative.test(fnToString.call(value)); } - if (value && typeof value == 'object') { - return !('constructor' in value) && isHostObject(value) - ? reNative.test(value) - : reHostCtor.test(toString.call(value)); - } - return false; + return (value && typeof value == 'object' && reHostCtor.test(value)) || false; } /** @@ -4976,7 +4951,7 @@ /** * Creates a shallow clone of `object` excluding the specified properties. * Property names may be specified as individual arguments or as arrays of - * property names. If a predicate is provided it is executed for each property + * property names. If a predicate is provided it is invoked for each property * of `object` omitting the properties the predicate returns truthy for. The * predicate is bound to `thisArg` and invoked with three arguments; * (value, key, object). @@ -4985,7 +4960,7 @@ * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function called per + * @param {Function|...(string|string[])} [predicate] The function invoked per * iteration or property names to omit, specified as individual property * names or arrays of property names. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5040,7 +5015,7 @@ /** * Creates a shallow clone of `object` composed of the specified properties. * Property names may be specified as individual arguments or as arrays of - * property names. If a predicate is provided it is executed for each property + * property names. If a predicate is provided it is invoked for each property * of `object` picking the properties the predicate returns truthy for. The * predicate is bound to `thisArg` and invoked with three arguments; * (value, key, object). @@ -5049,7 +5024,7 @@ * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function called per + * @param {Function|...(string|string[])} [predicate] The function invoked per * iteration or property names to pick, specified as individual property * names or arrays of property names. * @param {*} [thisArg] The `this` binding of `predicate`. @@ -5097,7 +5072,7 @@ /*--------------------------------------------------------------------------*/ /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to + * Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to * their corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional characters @@ -5297,7 +5272,7 @@ /** * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, and `'` in `string` to their + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their * corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional HTML @@ -5323,7 +5298,7 @@ /*--------------------------------------------------------------------------*/ /** - * Attempts to execute `func`, returning either the result or the caught + * Attempts to invoke `func`, returning either the result or the caught * error object. * * @static @@ -5521,7 +5496,7 @@ * @example * * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be called + * // => logs the number of milliseconds it took for the deferred function to be invoked */ var now = nativeNow || function() { return new Date().getTime(); @@ -5700,15 +5675,15 @@ } /** - * Executes the iteratee function `n` times, returning an array of the results - * of each execution. The `iteratee` is bound to `thisArg` and invoked with + * Invokes the iteratee function `n` times, returning an array of the results + * of each invocation. The `iteratee` is bound to `thisArg` and invoked with * one argument; (index). * * @static * @memberOf _ * @category Utility - * @param {number} n The number of times to execute `iteratee`. - * @param {Function} [iteratee=identity] The function called per iteration. + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} [iteratee=identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array} Returns the array of results. * @example @@ -5717,10 +5692,10 @@ * // => [3, 6, 4] * * _.times(3, function(n) { mage.castSpell(n); }); - * // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively + * // => invokes `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively * * _.times(3, function(n) { this.cast(n); }, mage); - * // => also calls `mage.castSpell(n)` three times + * // => also invokes `mage.castSpell(n)` three times */ function times(n, iteratee, thisArg) { n = nativeIsFinite(n = +n) && n > -1 ? n : 0; @@ -5774,7 +5749,6 @@ lodash.bindAll = bindAll; lodash.chain = chain; lodash.compact = compact; - lodash.compose = compose; lodash.constant = constant; lodash.countBy = countBy; lodash.debounce = debounce; @@ -5826,6 +5800,7 @@ // add aliases lodash.collect = map; + lodash.compose = flowRight; lodash.each = forEach; lodash.extend = assign; lodash.methods = functions; diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index f0c9b9e3d..b0144d385 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -8,38 +8,38 @@ return t}function h(n,r){for(var t=-1,e=n.length;++tu(r,i)&&o.push(i)}return o}function b(n,r){var t=n?n.length:0;if(typeof t!="number"||-1>=t||t>Br){for(var t=-1,e=Nt(n),u=e.length;++t=t||t>Br){for(var t=Nt(n),e=t.length;e--;){var u=t[e];if(r(n[u],u,n)===Fr)break}return n}for(e=z(n);t--&&r(e[t],t,e)!==Fr;);return n }function d(n,r){var t=true;return b(n,function(n,e,u){return(t=!!r(n,e,u))||Fr}),t}function j(n,r){var t=[];return b(n,function(n,e,u){r(n,e,u)&&t.push(n)}),t}function w(n,r,t){var e;return t(n,function(n,t,u){return r(n,t,u)?(e=n,Fr):void 0}),e}function A(n,r,t,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++ee(i,f)&&(r&&i.push(f),o.push(a))}return o}function M(n,r){return function(t,e,u){var o=r?r():{};if(e=v(e,u,3),$t(t)){u=-1;for(var i=t.length;++ur?0:r)}function H(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?At(u+e,0):e||0;else if(e)return e=G(r,t),u&&r[e]===t?e:-1; -return n(r,t,e)}function P(n,r,t){return V(n,null==r||t?1:0>r?0:r)}function V(n,t,e){var u=-1,o=n?n.length:0;if(t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),e=typeof e=="undefined"||e>o?o:+e||0,0>e&&(e+=o),e&&e==o&&!t)return r(n);for(o=t>e?0:e-t,e=Array(o);++u>>1,a=t(n[i]),f=ar?0:r)}function P(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?At(u+e,0):e||0;else if(e)return e=H(r,t),u&&r[e]===t?e:-1; +return n(r,t,e)}function V(n,r,t){return G(n,null==r||t?1:0>r?0:r)}function G(n,t,e){var u=-1,o=n?n.length:0;if(t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),e=typeof e=="undefined"||e>o?o:+e||0,0>e&&(e+=o),e&&e==o&&!t)return r(n);for(o=t>e?0:e-t,e=Array(o);++u>>1,a=t(n[i]),f=au&&(u=i)}else r=v(r,t,3),b(n,function(n,t,o){t=r(n,t,o),(t>e||-1/0===t&&t===u)&&(e=t,u=n)});return u}function rr(n,r){return Z(n,Er(r))}function tr(n,r,t,e){return($t(n)?s:S)(n,v(r,e,4),t,3>arguments.length,b)}function er(n,r,t,e){return($t(n)?g:S)(n,v(r,e,4),t,3>arguments.length,_)}function ur(n){n=z(n);for(var r=-1,t=n.length,e=Array(t);++rarguments.length?R(n,kr,r):O(n,kr|Ir,V(arguments,2),[],r)}function ar(n,r,t){function e(){var t=r-(Rt()-c);0>=t||t>r?(a&&clearTimeout(a),t=s,a=p=s=Or,t&&(g=Rt(),f=n.apply(l,i),p||a||(i=l=null))):p=setTimeout(e,t)}function u(){p&&clearTimeout(p),a=p=s=Or,(v||h!==r)&&(g=Rt(),f=n.apply(l,i),p||a||(i=l=null))}function o(){if(i=arguments,c=Rt(),l=this,s=v&&(p||!y),false===h)var t=y&&!p;else{a||y||(g=c);var o=h-(c-g),m=0>=o||o>h;m?(a&&(a=clearTimeout(a)),g=c,f=n.apply(l,i)):a||(a=setTimeout(u,o)) -}return m&&p?p=clearTimeout(p):p||r===h||(p=setTimeout(e,r)),t&&(m=true,f=n.apply(l,i)),!m||p||a||(i=l=null),f}var i,a,f,c,l,p,s,g=0,h=false,v=true;if(!hr(n))throw new TypeError(Mr);if(r=0>r?0:r,true===t)var y=true,v=false;else vr(t)&&(y=t.leading,h="maxWait"in t&&At(+t.maxWait||0,r),v="trailing"in t?t.trailing:v);return o.cancel=function(){p&&clearTimeout(p),a&&clearTimeout(a),a=p=s=Or},o}function fr(n){for(var r=V(arguments,1),t=r,e=fr.placeholder,u=-1,o=t.length,i=-1,a=[];++uarguments.length?R(n,kr,r):O(n,kr|Ir,G(arguments,2),[],r)}function ar(n,r,t){function e(){var t=r-(Rt()-c);0>=t||t>r?(a&&clearTimeout(a),t=s,a=p=s=Or,t&&(g=Rt(),f=n.apply(l,i),p||a||(i=l=null))):p=setTimeout(e,t)}function u(){p&&clearTimeout(p),a=p=s=Or,(v||h!==r)&&(g=Rt(),f=n.apply(l,i),p||a||(i=l=null))}function o(){if(i=arguments,c=Rt(),l=this,s=v&&(p||!y),false===h)var t=y&&!p;else{a||y||(g=c);var o=h-(c-g),m=0>=o||o>h;m?(a&&(a=clearTimeout(a)),g=c,f=n.apply(l,i)):a||(a=setTimeout(u,o)) +}return m&&p?p=clearTimeout(p):p||r===h||(p=setTimeout(e,r)),t&&(m=true,f=n.apply(l,i)),!m||p||a||(i=l=null),f}var i,a,f,c,l,p,s,g=0,h=false,v=true;if(!hr(n))throw new TypeError(Mr);if(r=0>r?0:r,true===t)var y=true,v=false;else vr(t)&&(y=t.leading,h="maxWait"in t&&At(+t.maxWait||0,r),v="trailing"in t?t.trailing:v);return o.cancel=function(){p&&clearTimeout(p),a&&clearTimeout(a),a=p=s=Or},o}function fr(n){for(var r=G(arguments,1),t=r,e=fr.placeholder,u=-1,o=t.length,i=-1,a=[];++u"'`]/g,Wr=/^\[object .+?Constructor\]$/,Dr=/($^)/,zr=/[.*+?^${}()|[\]\/\\]/g,Cr=/['\n\r\u2028\u2029\\]/g,Hr="[object Arguments]",Pr="[object Boolean]",Vr="[object Date]",Gr="[object Error]",Jr="[object Number]",Kr="[object Object]",Lr="[object RegExp]",Qr="[object String]",Xr={}; -Xr[Hr]=Xr["[object Array]"]=Xr["[object Float32Array]"]=Xr["[object Float64Array]"]=Xr["[object Int8Array]"]=Xr["[object Int16Array]"]=Xr["[object Int32Array]"]=Xr["[object Uint8Array]"]=Xr["[object Uint8ClampedArray]"]=Xr["[object Uint16Array]"]=Xr["[object Uint32Array]"]=true,Xr["[object ArrayBuffer]"]=Xr[Pr]=Xr[Vr]=Xr[Gr]=Xr["[object Function]"]=Xr["[object Map]"]=Xr[Jr]=Xr[Kr]=Xr[Lr]=Xr["[object Set]"]=Xr[Qr]=Xr["[object WeakMap]"]=false;var Yr={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Zr={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},nt={"function":true,object:true},rt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=nt[typeof window]&&window||this,et=nt[typeof exports]&&exports&&!exports.nodeType&&exports,ut=nt[typeof module]&&module&&!module.nodeType&&module,ot=et&&ut&&typeof global=="object"&&global; +hr(n[i])&&(o[++u]=i)}return o}function sr(n){var r=n&&typeof n=="object"?n.length:Or;return typeof r=="number"&&-1"'`]/g,Wr=/^\[object .+?Constructor\]$/,Dr=/($^)/,zr=/[.*+?^${}()|[\]\/\\]/g,Cr=/['\n\r\u2028\u2029\\]/g,Pr="[object Arguments]",Vr="[object Boolean]",Gr="[object Date]",Hr="[object Error]",Jr="[object Number]",Kr="[object Object]",Lr="[object RegExp]",Qr="[object String]",Xr={}; +Xr[Pr]=Xr["[object Array]"]=Xr["[object Float32Array]"]=Xr["[object Float64Array]"]=Xr["[object Int8Array]"]=Xr["[object Int16Array]"]=Xr["[object Int32Array]"]=Xr["[object Uint8Array]"]=Xr["[object Uint8ClampedArray]"]=Xr["[object Uint16Array]"]=Xr["[object Uint32Array]"]=true,Xr["[object ArrayBuffer]"]=Xr[Vr]=Xr[Gr]=Xr[Hr]=Xr["[object Function]"]=Xr["[object Map]"]=Xr[Jr]=Xr[Kr]=Xr[Lr]=Xr["[object Set]"]=Xr[Qr]=Xr["[object WeakMap]"]=false;var Yr={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Zr={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},nt={"function":true,object:true},rt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=nt[typeof window]&&window||this,et=nt[typeof exports]&&exports&&!exports.nodeType&&exports,ut=nt[typeof module]&&module&&!module.nodeType&&module,ot=et&&ut&&typeof global=="object"&&global; !ot||ot.global!==ot&&ot.window!==ot&&ot.self!==ot||(tt=ot);var it=ut&&ut.exports===et&&et,at=Array.prototype,ft=Object.prototype,ct=Function.prototype.toString,lt=ft.hasOwnProperty,pt=tt._,st=ft.toString,gt=RegExp("^"+function(n){return n=null==n?"":n+"",zr.lastIndex=0,zr.test(n)?n.replace(zr,"\\$&"):n}(st).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ht=Math.ceil,vt=Math.floor,yt=at.push,mt=ft.propertyIsEnumerable,bt=at.splice,_t=yr(_t=Object.create)&&_t,dt=yr(dt=Array.isArray)&&dt,jt=tt.isFinite,wt=yr(wt=Object.keys)&&wt,At=Math.max,xt=Math.min,Tt=yr(Tt=Date.now)&&Tt,Et=Math.random,Ot={}; -!function(){var n={0:1,length:1};Ot.spliceObjects=(bt.call(n,0,1),!n[0]);try{Ot.hostObject=!({toString:0}+"")}catch(r){Ot.hostObject=false}}(0,0),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},_t||(y=function(){function n(){}return function(r){if(vr(r)){n.prototype=r;var t=new n;n.prototype=null}return t||tt.Object()}}());var kt=P,St=C,It=M(function(n,r,t){lt.call(n,t)?++n[t]:n[t]=1}),Ft=M(function(n,r,t){lt.call(n,t)?n[t].push(r):n[t]=[r] -}),Mt=M(function(n,r,t){n[t]=r}),qt=M(function(n,r,t){n[t?0:1].push(r)},function(){return[[],[]]}),Bt=fr(function(n,r){var t;if(!hr(r))throw new TypeError(Mr);return function(){return 0<--n?t=r.apply(this,arguments):r=null,t}},2);sr(arguments)||(sr=function(n){var r=n&&typeof n=="object"?n.length:Or;return typeof r=="number"&&-1--n?r.apply(this,arguments):void 0}},i.bind=ir,i.bindAll=function(n){for(var r=n,t=1r?0:r)},i.intersection=function(){for(var n=[],r=-1,t=arguments.length;++ri(f,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;f.push(e)}return f},i.invert=function(n){for(var r=-1,t=Nt(n),e=t.length,u={};++ro?0:o>>>0);for(r=v(r,e,3),b(n,function(n,t,e){i[++u]={a:r(n,t,e),b:u,c:n}}),o=i.length,i.sort(t);o--;)i[o]=i[o].c;return i},i.take=St,i.tap=function(n,r){return r(n),n},i.throttle=function(n,r,t){var e=true,u=true;if(!hr(n))throw new TypeError(funcErrorText);return false===t?e=false:vr(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),ar(n,r,{leading:e,maxWait:r,trailing:u}) -},i.times=function(n,r,t){n=jt(n=+n)&&-1r?0:r))},i.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?At(e+t,0):xt(t||0,e-1))+1);e--;)if(n[e]===r)return e;return-1},i.max=nr,i.min=function(n,r,t){var e=1/0,u=e,o=typeof r; -if("number"!=o&&"string"!=o||!t||t[r]!==n||(r=null),null==r)for(t=-1,n=z(n),o=n.length;++tr?0:+r||0,n.length),n)},Tr(cr({},i)),i.VERSION="3.0.0-pre",i.prototype.chain=function(){return this.__chain__=true,this},i.prototype.value=function(){return this.__wrapped__ -},f("pop push reverse shift sort splice unshift".split(" "),function(n){var r=at[n];i.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Ot.spliceObjects||0!==n.length||delete n[0],this}}),f(["concat","join","slice"],function(n){var r=at[n];i.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new a(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(tt._=i, define("underscore",function(){return i -})):et&&ut?it?(ut.exports=i)._=i:et._=i:tt._=i}).call(this); \ No newline at end of file +!function(){var n={0:1,length:1};Ot.spliceObjects=(bt.call(n,0,1),!n[0])}(0,0),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},_t||(y=function(){function n(){}return function(r){if(vr(r)){n.prototype=r;var t=new n;n.prototype=null}return t||tt.Object()}}());var kt=V,St=C,It=M(function(n,r,t){lt.call(n,t)?++n[t]:n[t]=1}),Ft=M(function(n,r,t){lt.call(n,t)?n[t].push(r):n[t]=[r]}),Mt=M(function(n,r,t){n[t]=r}),qt=M(function(n,r,t){n[t?0:1].push(r) +},function(){return[[],[]]}),Bt=fr(function(n,r){var t;if(!hr(r))throw new TypeError(Mr);return function(){return 0<--n?t=r.apply(this,arguments):r=null,t}},2);sr(arguments)||(sr=function(n){var r=n&&typeof n=="object"?n.length:Or;return typeof r=="number"&&-1--n?r.apply(this,arguments):void 0}},i.bind=ir,i.bindAll=function(n){for(var r=n,t=1r?0:r)},i.intersection=function(){for(var n=[],r=-1,t=arguments.length;++ri(f,e)){for(r=t;--r;)if(0>i(n[r],e))continue n; +f.push(e)}return f},i.invert=function(n){for(var r=-1,t=Nt(n),e=t.length,u={};++ro?0:o>>>0); +for(r=v(r,e,3),b(n,function(n,t,e){i[++u]={a:r(n,t,e),b:u,c:n}}),o=i.length,i.sort(t);o--;)i[o]=i[o].c;return i},i.take=St,i.tap=function(n,r){return r(n),n},i.throttle=function(n,r,t){var e=true,u=true;if(!hr(n))throw new TypeError(funcErrorText);return false===t?e=false:vr(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),ar(n,r,{leading:e,maxWait:r,trailing:u})},i.times=function(n,r,t){n=jt(n=+n)&&-1r)return function(){}; +if(!c(n,hr))throw new TypeError(Mr);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},i.each=Y,i.extend=cr,i.methods=pr,i.object=function(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||$t(n[0])||(r=[]);++tr?0:r))},i.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?At(e+t,0):xt(t||0,e-1))+1);e--;)if(n[e]===r)return e; +return-1},i.max=nr,i.min=function(n,r,t){var e=1/0,u=e,o=typeof r;if("number"!=o&&"string"!=o||!t||t[r]!==n||(r=null),null==r)for(t=-1,n=z(n),o=n.length;++tr?0:+r||0,n.length),n) +},Tr(cr({},i)),i.VERSION="3.0.0-pre",i.prototype.chain=function(){return this.__chain__=true,this},i.prototype.value=function(){return this.__wrapped__},f("pop push reverse shift sort splice unshift".split(" "),function(n){var r=at[n];i.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Ot.spliceObjects||0!==n.length||delete n[0],this}}),f(["concat","join","slice"],function(n){var r=at[n];i.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new a(n),n.__chain__=true),n +}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(tt._=i, define("underscore",function(){return i})):et&&ut?it?(ut.exports=i)._=i:et._=i:tt._=i}).call(this); \ No newline at end of file