From aa303df3876cd3b42d161b41176f69c4048fa169 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 11 Sep 2015 18:25:03 -0700 Subject: [PATCH] Update core builds. --- lodash.core.js | 1101 +++++++++++++++++++++++--------------------- lodash.core.min.js | 50 +- 2 files changed, 613 insertions(+), 538 deletions(-) diff --git a/lodash.core.js b/lodash.core.js index b81942303..ec5e71377 100644 --- a/lodash.core.js +++ b/lodash.core.js @@ -19,9 +19,23 @@ var BIND_FLAG = 1, PARTIAL_FLAG = 32; + /** Used to compose bitmasks for comparison styles. */ + var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** Used as references for `-Infinity` and `Infinity`. */ + var NEGATIVE_INFINITY = 1 / -0, + POSITIVE_INFINITY = 1 / 0; + /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', @@ -85,274 +99,6 @@ /*--------------------------------------------------------------------------*/ - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` or `undefined` values. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - return value == null ? '' : (value + ''); - } - - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[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`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch(e) {} - } - return result; - } - - /** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /*--------------------------------------------------------------------------*/ - - /** Used for native method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype, - stringProto = String.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Native value references. */ - var Reflect = root.Reflect, - enumerate = Reflect ? Reflect.enumerate : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /* Native method references for those with the same name as other `lodash` methods. */ - var nativeFloor = Math.floor, - nativeIsFinite = root.isFinite, - nativeKeys = Object.keys, - nativeMax = Math.max; - - /** Used as references for `-Infinity` and `Infinity`. */ - var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, - POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - - /** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that retrieve a single value or may return a - * primitive value will automatically end the chain returning the unwrapped - * value. Explicit chaining may be enabled using `_.chain`. The execution of - * chained methods is lazy, that is, execution is deferred until `_#value` - * is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization strategy which merge iteratee calls; this can help - * to avoid the creation of intermediate data structures and greatly reduce the - * number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `find`, `findLast`, `first`, `initial`, `last`, `map`, `reject`, `rest`, - * `reverse`, `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, - * and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignWith`, `at`, `before`, `bind`, `bindAll`, - * `bindKey`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, - * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, `flatten`, - * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, - * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `initial`, - * `intersection`, `invert`, `invoke`, `iteratee`, `keyBy`, `keys`, `keysIn`, - * `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, - * `merge`, `mergeWith` `method`, `methodOf`, `mixin`, `modArgs`, `negate`, - * `omit`, `omitBy`, `once`, `pairs`, `partial`, `partialRight`, `partition`, - * `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAt`, - * `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, `reverse`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByOrder`, - * `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, - * `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, `transform`, - * `union`, `uniq`, `uniqBy`, `unshift`, `unzip`, `unzipWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, - * `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `get`, `gt`, `gte`, - * `has`, `hasIn`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, - * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite` `isFunction`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, - * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, - * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`, - * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, - * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `sum`, `sumBy`, `template`, - * `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, - * and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(sum, n) { - * return sum + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. - */ - function LodashWrapper(value, chainAll, actions) { - this.__wrapped__ = value; - this.__actions__ = actions || []; - this.__chain__ = !!chainAll; - } - - /*------------------------------------------------------------------------*/ - /** * Creates a new array joining `array` with `other`. * @@ -419,7 +165,7 @@ * for equality comparisons. * * @private - * @param {Object} object The object to augment. + * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ @@ -431,6 +177,433 @@ } } + /** + * The base implementation of methods like `_.find` and `_.findKey` without + * support for callback shorthands, which iterates over `collection` using + * the provided `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to search. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFind(collection, predicate, eachFunc, retKey) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = retKey ? key : value; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight` without support + * for callback shorthands, which iterates over `collection` using the provided + * `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @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. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initFromCollection + ? (initFromCollection = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.times` without support for callback shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + return value == null ? '' : (value + ''); + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object) { + return copyObjectWith(source, props, object); + } + + /** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index], + newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; + + assignValue(object, key, newValue); + } + return object; + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** + * Used by `_.defaults` to customize its `_.assign` use. + * + * @private + * @param {*} objValue The destination object property value. + * @param {*} srcValue The source object property value. + * @returns {*} Returns the value to assign to the destination object. + */ + function extendDefaults(objValue, srcValue) { + return objValue === undefined ? srcValue : objValue; + } + + /** + * 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`. + */ + function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for native method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype, + stringProto = String.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Native value references. */ + var Reflect = root.Reflect, + enumerate = Reflect ? Reflect.enumerate : undefined, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeFloor = Math.floor, + nativeIsFinite = root.isFinite, + nativeKeys = Object.keys, + nativeMax = Math.max; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chaining. Methods that operate on and return arrays, collections, and + * functions can be chained together. Methods that retrieve a single value or + * may return a primitive value will automatically end the chain sequence and + * return the unwrapped value. Otherwise, the value must be unwrapped with + * `_#value`. + * + * Explicit chaining, which requires unwrapping with `_#value` in all cases, + * may be enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, execution is deferred + * until `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. Shortcut + * fusion is an optimization strategy which merge iteratee calls; this can help + * to avoid the creation of intermediate data structures and greatly reduce the + * number of iteratee executions. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, + * `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, + * `find`, `findLast`, `first`, `initial`, `last`, `map`, `reject`, `rest`, + * `reverse`, `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, + * and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignWith`, `at`, `before`, `bind`, `bindAll`, + * `bindKey`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, + * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, + * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, + * `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, `flatten`, + * `flattenDeep`, `flip`, `flow`, `flowRight`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, + * `initial`, `intersection`, `invert`, `invoke`, `iteratee`, `keyBy`, `keys`, + * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith` `method`, `methodOf`, `mixin`, `modArgs`, + * `modArgsSet', 'negate`, `omit`, `omitBy`, `once`, `pairs`, `partial`, + * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, + * `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, `reject`, + * `remove`, `rest`, `restParam`, `reverse`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `sortByOrder`, `splice`, `spread`, `take`, + * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, + * `times`, `toArray`, `toPath`, `toPlainObject`, `transform`, `union`, `uniq`, + * `uniqBy`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, + * `without`, `wrap`, `xor`, `zip`, `zipObject`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, + * `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `get`, `gt`, `gte`, + * `has`, `hasIn`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, + * `isArray`, `isArrayLike`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, + * `isEqual`, `isEqualWith`, `isError`, `isFinite` `isFunction`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, + * `isObjectLike`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, + * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`, + * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`, + * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, + * `round`, `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `sum`, `sumBy`, `template`, `toInteger', 'trim`, `trimLeft`, + * `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words` + * + * The wrapper method `sample` will return a wrapped value when `n` is provided, + * otherwise an unwrapped value is returned. + * + * @name _ + * @constructor + * @category Chain + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(sum, n) { + * return sum + n; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(n) { + * return n * n; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable chaining for all wrapper methods. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + /*------------------------------------------------------------------------*/ + /** * The base implementation of `_.create` without support for assigning * properties to the created object. @@ -513,29 +686,6 @@ return result; } - /** - * The base implementation of methods like `_.find` and `_.findKey` without - * support for callback shorthands, which iterates over `collection` using - * the provided `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - /** * The base implementation of `_.flatten` with support for restricting flattening. * @@ -618,19 +768,22 @@ * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison * @param {Array} [stackA] Tracks traversed `value` objects. * @param {Array} [stackB] Tracks traversed `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ - function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { + function baseIsEqual(value, other, customizer, bitmask, stackA, stackB) { if (value === other) { return true; } if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { return value !== value && other !== other; } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stackA, stackB); } /** @@ -643,12 +796,12 @@ * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {Array} [stackA=[]] Tracks traversed `value` objects. * @param {Array} [stackB=[]] Tracks traversed `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stackA, stackB) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, @@ -671,14 +824,15 @@ isSameTag = objTag == othTag; if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag); + return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); } - if (!isLoose) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + if (!isPartial) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stackA, stackB); } } if (!isSameTag) { @@ -699,7 +853,7 @@ stackA.push(object); stackB.push(other); - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stackA, stackB); stackA.pop(); stackB.pop(); @@ -758,14 +912,7 @@ // An alternative implementation intended for IE < 9 with es6-shim. if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { baseKeysIn = function(object) { - var data, - iterator = enumerate(object), - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; + return iteratorToArray(enumerate(object)); }; } @@ -845,28 +992,6 @@ }; } - /** - * The base implementation of `_.reduce` and `_.reduceRight` without support - * for callback shorthands, which iterates over `collection` using the provided - * `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @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. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - /** * The base implementation of `_.slice` without an iteratee call guard. * @@ -898,6 +1023,16 @@ return result; } + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + var copyArray = baseSlice; + /** * The base implementation of `_.some` without support for callback shorthands. * @@ -916,41 +1051,6 @@ return !!result; } - /** - * The base implementation of `_.times` without support for callback shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return baseMap(props, function(key) { - return object[key]; - }); - } - /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each @@ -968,55 +1068,6 @@ }, result); } - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - var copyArray = baseSlice; - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object) { - return copyObjectWith(source, props, object); - } - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; - } - /** * Creates a function like `_.assign`. * @@ -1109,16 +1160,6 @@ // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); @@ -1135,7 +1176,7 @@ * * @private * @param {Function} func The function to partially apply arguments to. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to the new function. * @returns {Function} Returns the new bound function. @@ -1177,17 +1218,19 @@ * @param {Array} other The other array to compare. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {Array} [stackA] Tracks traversed `value` objects. * @param {Array} [stackB] Tracks traversed `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ - function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { + function equalArrays(array, other, equalFunc, customizer, bitmask, stackA, stackB) { var index = -1, + isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, arrLength = array.length, othLength = other.length; - if (arrLength != othLength && !(isLoose && othLength > arrLength)) { + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Ignore non-index properties. @@ -1202,13 +1245,13 @@ return false; } // Recursively compare arrays (susceptible to call stack limits). - if (isLoose) { + if (isUnordered) { if (!baseSome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stackA, stackB); })) { return false; } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stackA, stackB))) { return false; } } @@ -1226,9 +1269,12 @@ * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function equalByTag(object, other, tag) { + function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { switch (tag) { case boolTag: case dateTag: @@ -1263,35 +1309,41 @@ * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {Array} [stackA] Tracks traversed `value` objects. * @param {Array} [stackB] Tracks traversed `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objProps = keys(object), + function equalObjects(object, other, equalFunc, customizer, bitmask, stackA, stackB) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; - if (objLength != othLength && !isLoose) { + if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; - if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { + if (!(isPartial ? key in other : hasOwnProperty.call(other, key)) || + !(isUnordered || key == othProps[index])) { return false; } } - var skipCtor = isLoose; + var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; // Recursively compare objects (susceptible to call stack limits). - if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { + if (!(result === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stackA, stackB)) + : result + )) { return false; } skipCtor || (skipCtor = key == 'constructor'); @@ -1311,18 +1363,6 @@ return true; } - /** - * Used by `_.defaults` to customize its `_.assign` use. - * - * @private - * @param {*} objValue The destination object property value. - * @param {*} srcValue The source object property value. - * @returns {*} Returns the value to assign to the destination object. - */ - function extendDefaults(objValue, srcValue) { - return objValue === undefined ? srcValue : objValue; - } - /** * Gets the "length" property value of `object`. * @@ -1353,53 +1393,14 @@ } /** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ - function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && objToString.call(value) == funcTag) && isLength(getLength(value)); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is a prototype. + * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { - var Ctor = !!value && value.constructor, + var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; @@ -1416,17 +1417,6 @@ return typeof value == 'function' ? value : identity; } - /** - * Converts `value` to an integer. - * - * @private - * @param {*} value The value to convert. - * @returns {number} Returns the integer. - */ - function toInteger(value) { - return nativeFloor(value) || 0; - } - /** * Creates a clone of `wrapper`. * @@ -1435,7 +1425,9 @@ * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { - return new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, copyArray(wrapper.__actions__)); + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + return result; } /*------------------------------------------------------------------------*/ @@ -1596,8 +1588,8 @@ /*------------------------------------------------------------------------*/ /** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. + * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. + * The result of such method chaining must be unwrapped with `_#value`. * * @static * @memberOf _ @@ -2404,7 +2396,7 @@ * ]; * * var shallow = _.clone(users); - * shallow[0] === users[0]; + * console.log(shallow[0] === users[0]); * // => true */ function clone(value) { @@ -2439,7 +2431,7 @@ } /** - * Checks if `value` is classified as an `arguments` object. + * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ @@ -2455,8 +2447,9 @@ * // => false */ function isArguments(value) { - return isObjectLike(value) && isArrayLike(value) && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isObjectLike(value) && isArrayLike(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objToString.call(value) == argsTag); } /** @@ -2478,6 +2471,33 @@ */ var isArray = Array.isArray; + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(function() { return arguments; }()); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && + !(typeof value == 'function' && objToString.call(value) == funcTag) && isLength(getLength(value)); + } + /** * Checks if `value` is classified as a boolean primitive or object. * @@ -2574,7 +2594,7 @@ * _.isEqual(object, other); * // => true * - * object == other; + * object === other; * // => false */ function isEqual(value, other) { @@ -2673,7 +2693,10 @@ * _.isObject([1, 2, 3]); * // => true * - * _.isObject(1); + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); * // => false */ function isObject(value) { @@ -2683,6 +2706,33 @@ return !!value && (type == 'object' || type == 'function'); } + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + /** * Checks if `value` is `NaN`. * @@ -2889,6 +2939,31 @@ return value.length ? copyArray(value) : []; } + /** + * Converts `value` to an integer. + * + * **Note:** This function is based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger('3.14'); + * // => 3 + * + * _.toInteger(NaN); + * // => 0 + * + * _.toInteger(-Infinity); + * // => -Infinity + */ + function toInteger(value) { + return nativeFloor(value) || 0; + } + /*------------------------------------------------------------------------*/ /** diff --git a/lodash.core.min.js b/lodash.core.min.js index c5aefcf33..a98886e30 100644 --- a/lodash.core.min.js +++ b/lodash.core.min.js @@ -3,28 +3,28 @@ * lodash 3.10.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash core exports="global,amd" -o ./lodash.core.js` */ -;(function(){function n(n){return n&&n.Object===Object?n:null}function t(n){return fn[n]}function r(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function e(n){return!!n&&typeof n=="object"}function u(n){if(e(n)&&!qn(n)){if(n instanceof o)return n;if(bn.call(n,"__wrapped__"))return new o(n.__wrapped__,n.__chain__,Bn(n.__actions__))}return new o(n)}function o(n,t,r){this.__wrapped__=n,this.__actions__=r||[],this.__chain__=!!t}function i(n,t,r,e){for(var u=-1,o=n.length,i=e,c=i;++ut&&(t=-t>u?0:u+t),r=r===en||r>u?u:On(r)||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:en,o=typeof o=="function"?(u--,o):en;for(t=Object(t);++ef))return false; -for(;++c-1&&0==n%1&&(null==t?9007199254740991:t)>n}function V(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function M(n){var t=!!n&&n.constructor;return n===(typeof t=="function"&&t.prototype||gn)}function P(n,t){return Sn(n,typeof t=="function"?t:tn)}function Y(n){return null==n?0:(n=$(n)?n:W(n),n.length)}function z(n,t){ -var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=On(n)||0,function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=en),r}}function C(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Nn(t===en?n.length-1:On(t)||0,0),function(){for(var r=arguments,e=-1,u=Nn(r.length-t,0),o=Array(u);++et}function J(n){return e(n)&&$(n)&&bn.call(n,"callee")&&!En.call(n,"callee"); -}function U(n){return H(n)&&"[object Function]"==mn.call(n)}function H(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function K(n){return typeof n=="number"||e(n)&&"[object Number]"==mn.call(n)}function L(n){return typeof n=="string"||e(n)&&"[object String]"==mn.call(n)}function Q(n,t){return t>n}function W(n){var t=M(n);if(!t&&!$(n))return An(Object(n));var r,e=R(n),u=e.length,o=!!u;for(r in n)!bn.call(n,r)||o&&q(r,u)||t&&"constructor"==r||e.push(r);return e}function X(n){for(var t=-1,r=M(n),e=_(n),u=e.length,o=R(n),i=o.length,c=!!i;++t"'`]/g,on=RegExp(un.source),cn=/^\d+$/,fn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},an={"function":true,object:true},ln=an[typeof module]&&module&&!module.nodeType?module:null,pn=n(an[typeof self]&&self),sn=n(an[typeof window]&&window),hn=n(an[typeof this]&&this),yn=n((an[typeof exports]&&exports&&!exports.nodeType?exports:null)&&ln&&typeof global=="object"&&global)||sn!==(hn&&hn.window)&&sn||pn||hn||Function("return this")(),vn=Array.prototype,gn=Object.prototype,_n=String.prototype,bn=gn.hasOwnProperty,jn=0,mn=gn.toString,dn=yn._,wn=(an=yn.f)?an.g:en,En=gn.propertyIsEnumerable,On=Math.floor,xn=yn.isFinite,An=Object.keys,Nn=Math.max,In=Number.NEGATIVE_INFINITY,Tn=Number.POSITIVE_INFINITY,kn=function(){ -function n(){}return function(t){if(H(t)){n.prototype=t;var r=new n;n.prototype=en}return r||{}}}(),Sn=function(n,t){return function(r,e){if(null==r)return r;if(!$(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),d("c"))},u.tap=function(n,t){return t(n),n},u.thru=function(n,t){return t(n)},u.toArray=function(n){return $(n)?n.length?Bn(n):[]:nn(n)},u.values=nn,u.each=P,rn(u,u),u.clone=function(n){if(H(n))if(qn(n))n=Bn(n);else{var t=W(n);n=N(n,t,void 0)}return n},u.escape=function(n){return(n=null==n?"":n+"")&&on.test(n)?n.replace(un,t):n},u.every=function(n,t,r){return t=r?en:t,a(n,g(t))},u.find=function(n,t){ -return p(n,g(t),Sn)},u.first=function(n){return n?n[0]:en},u.forEach=P,u.has=function(n,t){return null!=n&&bn.call(n,t)},u.identity=tn,u.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Nn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,Sn)},u.result=Z,u.size=Y,u.some=function(n,t,r){return t=r?en:t,O(n,g(t))},u.uniqueId=function(n){var t=++jn;return(null==n?"":n+"")+t},rn(u,function(){var n={};return h(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),{chain:false}),u.VERSION="3.10.1", -Sn("join pop push replace reverse shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?_n:vn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n);u.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),u.prototype.run=u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=function(){return A(this.__wrapped__,this.__actions__)},(sn||pn||{})._=u, -typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return u}):yn._=u}).call(this); \ No newline at end of file +;(function(){function n(n,t,r,e){for(var u=-1,o=n.length,i=e,c=i;++u-1&&0==n%1&&(null==t?9007199254740991:t)>n}function p(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function s(n){if(K(n)&&!qn(n)){ +if(n instanceof h)return n;if(mn.call(n,"__wrapped__")){var t=new h(n.__wrapped__,n.__chain__);return t.__actions__=Dn(n.__actions__),t}}return new h(n)}function h(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function y(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(en,r)},t)}function v(n,t){var r=true;return Fn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function _(n,t){var r=[];return Fn(n,function(n,e,u){t(n,e,u)&&r.push(n); +}),r}function g(n,r,e,u){u||(u=[]);for(var o=-1,i=n.length;++ot&&(t=-t>u?0:u+t),r=r===en||r>u?u:An(r)||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:en,o=typeof o=="function"?(u--,o):en;for(t=Object(t);++ea))return false;for(;++c=n&&(t=en),r}}function J(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Sn(t===en?n.length-1:An(t)||0,0),function(){for(var r=arguments,e=-1,u=Sn(r.length-t,0),o=Array(u);++et}function U(n){return K(n)&&V(n)&&mn.call(n,"callee")&&(!xn.call(n,"callee")||"[object Arguments]"==wn.call(n))}function V(n){return null!=n&&!(typeof n=="function"&&"[object Function]"==wn.call(n))&&p(Rn(n))}function G(n){return H(n)&&"[object Function]"==wn.call(n)}function H(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function K(n){return!!n&&typeof n=="object"}function L(n){return typeof n=="number"||K(n)&&"[object Number]"==wn.call(n)}function Q(n){return typeof n=="string"||K(n)&&"[object String]"==wn.call(n); +}function W(n,t){return t>n}function X(n){var t=q(n);if(!t&&!V(n))return Nn(Object(n));var r,e=$(n),u=e.length,o=!!u;for(r in n)!mn.call(n,r)||o&&l(r,u)||t&&"constructor"==r||e.push(r);return e}function Y(n){for(var t=-1,r=q(n),e=w(n),u=e.length,o=$(n),i=o.length,c=!!i;++t"'`]/g,fn=RegExp(cn.source),an=/^\d+$/,ln={"&":"&","<":"<", +">":">",'"':""","'":"'","`":"`"},pn={"function":true,object:true},sn=pn[typeof module]&&module&&!module.nodeType?module:null,hn=o(pn[typeof self]&&self),yn=o(pn[typeof window]&&window),vn=o(pn[typeof this]&&this),_n=o((pn[typeof exports]&&exports&&!exports.nodeType?exports:null)&&sn&&typeof global=="object"&&global)||yn!==(vn&&vn.window)&&yn||hn||vn||Function("return this")(),gn=Array.prototype,bn=Object.prototype,jn=String.prototype,mn=bn.hasOwnProperty,dn=0,wn=bn.toString,On=_n._,En=(pn=_n.f)?pn.g:en,xn=bn.propertyIsEnumerable,An=Math.floor,kn=_n.isFinite,Nn=Object.keys,Sn=Math.max,Tn=function(){ +function n(){}return function(t){if(H(t)){n.prototype=t;var r=new n;n.prototype=en}return r||{}}}(),Fn=function(n,t){return function(r,e){if(null==r)return r;if(!V(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),A("c"))},s.tap=function(n,t){return t(n),n},s.thru=function(n,t){return t(n)},s.toArray=function(n){return V(n)?n.length?Dn(n):[]:nn(n)},s.values=nn,s.each=M,rn(s,s),s.clone=function(n){if(H(n))if(qn(n))n=Dn(n);else{var t=X(n);n=i(n,t,void 0)}return n},s.escape=function(n){return(n=null==n?"":n+"")&&fn.test(n)?n.replace(cn,c):n},s.every=function(n,t,r){return t=r?en:t,v(n,d(t))},s.find=function(n,t){ +return r(n,d(t),Fn)},s.first=function(n){return n?n[0]:en},s.forEach=M,s.has=function(n,t){return null!=n&&mn.call(n,t)},s.identity=tn,s.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Sn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,Fn)},s.result=Z,s.size=z,s.some=function(n,t,r){return t=r?en:t,N(n,d(t))},s.uniqueId=function(n){var t=++dn;return(null==n?"":n+"")+t},rn(s,function(){var n={};return b(s,function(t,r){s.prototype[r]||(n[r]=t)}),n}(),{chain:false}),s.VERSION="3.10.1", +Fn("join pop push replace reverse shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?jn:gn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n);s.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),s.prototype.run=s.prototype.toJSON=s.prototype.valueOf=s.prototype.value=function(){return S(this.__wrapped__,this.__actions__)},(yn||hn||{})._=s, +typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return s}):_n._=s}).call(this); \ No newline at end of file