From d2aa55a3bd025782aa454f0dacd6158ee2df518d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 2 Sep 2014 09:25:42 -0700 Subject: [PATCH] Rebuild dist. --- dist/lodash.compat.js | 1218 ++++++++++++++++----------------- dist/lodash.compat.min.js | 142 ++-- dist/lodash.js | 1188 ++++++++++++++++---------------- dist/lodash.min.js | 135 ++-- dist/lodash.underscore.js | 1118 +++++++++++++++--------------- dist/lodash.underscore.min.js | 80 +-- 6 files changed, 1934 insertions(+), 1947 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 1b52aa206..4ea957a48 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -3,7 +3,7 @@ * Lo-Dash 3.0.0-pre (Custom Build) * Build: `lodash -o ./dist/lodash.compat.js` * Copyright 2012-2014 The Dojo Foundation - * Based on Underscore.js 1.6.0 + * Based on Underscore.js 1.7.0 * Copyright 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ @@ -28,9 +28,6 @@ var HOT_COUNT = 150, HOT_SPAN = 16; - /** Used as the property name for wrapper metadata */ - var EXPANDO = '__lodash_' + VERSION.replace(/[-.]/g, '_') + '__'; - /** Used as the TypeError message for "Functions" methods */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -202,14 +199,6 @@ 'trailing': false }; - /** Used as the property descriptor for wrapper metadata */ - var descriptor = { - 'configurable': false, - 'enumerable': false, - 'value': null, - 'writable': false - }; - /** * Used to convert characters to HTML entities. * @@ -722,17 +711,6 @@ return result; }()); - /** Used to set metadata on functions */ - var defineProperty = (function() { - // IE 8 only accepts DOM elements - try { - var o = {}, - func = isNative(func = Object.defineProperty) && func, - result = func(o, o, o) && func; - } catch(e) {} - return result; - }()); - /* Native method references for those with the same name as other `lodash` methods */ var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, @@ -779,7 +757,7 @@ } }); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps the given value to enable intuitive @@ -1098,7 +1076,7 @@ } }; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * A specialized version of `_.forEach` for arrays without support for @@ -2151,7 +2129,7 @@ var data = getData(func), arity = data ? data[2] : func.length; - arity -= args.length; + arity = nativeMax(arity - args.length, 0); } return (bitmask & PARTIAL_FLAG) ? createWrapper(func, bitmask, arity, thisArg, args, holders) @@ -2226,19 +2204,10 @@ * @param {*} data The metadata. * @returns {Function} Returns `func`. */ - function baseSetData(func, data) { + var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; - } - // fallback for environments without `WeakMap` - if (!WeakMap) { - baseSetData = !defineProperty ? identity : function(func, value) { - descriptor.value = value; - defineProperty(func, EXPANDO, descriptor); - descriptor.value = null; - return func; - }; - } + }; /** * The base implementation of `_.some` without support for callback shorthands @@ -2831,15 +2800,9 @@ * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ - function getData(func) { + var getData = !metaMap ? noop : function(func) { return metaMap.get(func); - } - // fallback for environments without `WeakMap` - if (!WeakMap) { - getData = !defineProperty ? noop : function(func) { - return func[EXPANDO]; - }; - } + }; /** * Gets the appropriate "indexOf" function. If the `_.indexOf` method is @@ -3196,7 +3159,7 @@ return isObject(value) ? value : Object(value); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. @@ -4467,7 +4430,7 @@ return result; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object that wraps `value` with explicit method @@ -4588,7 +4551,7 @@ return this.__wrapped__; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates an array of elements corresponding to the specified keys, or indexes, @@ -5733,7 +5696,7 @@ return filter(collection, matches(source)); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes @@ -5760,7 +5723,13 @@ */ function after(n, func) { if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); + if (isFunction(n)) { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } } n = nativeIsFinite(n = +n) ? n : 0; return function() { @@ -5788,7 +5757,13 @@ function before(n, func) { var result; if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); + if (isFunction(n)) { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } } return function() { if (--n > 0) { @@ -6546,37 +6521,7 @@ return basePartial(wrapper, PARTIAL_FLAG, [value], []); } - /*--------------------------------------------------------------------------*/ - - /** - * 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 invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments; - * (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns the destination object. - * @example - * - * _.assign({ 'name': 'fred' }, { 'age': 40 }, { 'employer': 'slate' }); - * // => { 'name': 'fred', 'age': 40, 'employer': 'slate' } - * - * var defaults = _.partialRight(_.assign, function(value, other) { - * return typeof value == 'undefined' ? other : value; - * }); - * - * defaults({ 'name': 'barney' }, { 'age': 36 }, { 'name': 'fred', 'employer': 'slate' }); - * // => { 'name': 'barney', 'age': 36, 'employer': 'slate' } - */ - var assign = createAssigner(baseAssign); + /*------------------------------------------------------------------------*/ /** * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, @@ -6593,7 +6538,7 @@ * * @static * @memberOf _ - * @category Object + * @category Lang * @param {*} value The value to clone. * @param {boolean} [isDeep=false] Specify a deep clone. * @param {Function} [customizer] The function to customize cloning values. @@ -6656,7 +6601,7 @@ * * @static * @memberOf _ - * @category Object + * @category Lang * @param {*} value The value to deep clone. * @param {Function} [customizer] The function to customize cloning values. * @param {*} [thisArg] The `this` binding of `customizer`. @@ -6689,6 +6634,563 @@ return baseClone(value, true, customizer); } + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + 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 + if (!support.argsClass) { + isArguments = function(value) { + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; + }; + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * (function() { return _.isArray(arguments); })(); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass) || false; + }; + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return (value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass) || false; + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return (value && typeof value == 'object' && value.nodeType === 1 && + (support.nodeClass ? toString.call(value).indexOf('Element') > -1 : isHostObject(value))) || false; + } + // fallback for environments without DOM support + if (!support.dom) { + isElement = function(value) { + return (value && typeof value == 'object' && value.nodeType === 1 && + !isPlainObject(value)) || false; + }; + } + + /** + * Checks if a collection is empty. A value is considered empty unless it is + * an array-like value with a length greater than `0` or an object with own + * enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + var length = value.length; + if ((typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER) && + (isArray(value) || isString(value) || isArguments(value) || + (typeof value == 'object' && isFunction(value.splice)))) { + return !length; + } + return !keys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * 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). + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. Provide a customizer function to extend support + * for comparing other values. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare to `other`. + * @param {*} other The value to compare to `value`. + * @param {Function} [customizer] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var other = { 'name': 'fred' }; + * + * object == other; + * // => false + * + * _.isEqual(object, other); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function() { + * return _.every(arguments, _.bind(RegExp.prototype.test, /^h(?:i|ello)$/)) || undefined; + * }); + * // => true + */ + function isEqual(value, other, customizer, thisArg) { + customizer = typeof customizer == 'function' && baseCallback(customizer, thisArg, 3); + return (!customizer && isStrictComparable(value) && isStrictComparable(other)) + ? value === other + : baseIsEqual(value, other, customizer); + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on ES6 `Number.isFinite`. See the + * [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(10); + * // => true + * + * _.isFinite('10'); + * // => false + * + * _.isFinite(true); + * // => false + * + * _.isFinite(Object(10)); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + var isFinite = nativeNumIsFinite || function(value) { + return typeof value == 'number' && nativeIsFinite(value); + }; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // avoid a Chakra bug in IE 11 + // https://github.com/jashkenas/underscore/issues/1621 + return typeof value == 'function' || false; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value == 'function' && toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // avoid a V8 bug in Chrome 19-20 + // https://code.google.com/p/v8/issues/detail?id=2291 + var type = typeof value; + return type == 'function' || (value && type == 'object') || false; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is not the same as native `isNaN` which returns `true` + * for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the `[[Class]]` check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isFunction(value)) { + return reNative.test(fnToString.call(value)); + } + return (value && typeof value == 'object' && + (isHostObject(value) ? reNative : reHostCtor).test(value)) || false; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(8.4); + * // => true + * + * _.isNumber(NaN); + * // => true + * + * _.isNumber('8.4'); + * // => false + */ + function isNumber(value) { + var type = typeof value; + return type == 'number' || + (value && type == 'object' && toString.call(value) == numberClass) || false; + } + + /** + * Checks if `value` is an object created by the `Object` constructor or has + * a `[[Prototype]]` of `null`. + * + * **Note:** This method assumes objects created by the `Object` constructor + * have no inherited enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * _.isPlainObject(new Shape); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) { + return false; + } + var valueOf = value.valueOf, + objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? (value == objProto || getPrototypeOf(value) == objProto) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return (isObject(value) && toString.call(value) == regexpClass) || false; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (value && typeof value == 'object' && toString.call(value) == stringClass) || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /*------------------------------------------------------------------------*/ + + /** + * 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 invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments; + * (objectValue, sourceValue, key, object, source). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'fred' }, { 'age': 40 }, { 'employer': 'slate' }); + * // => { 'name': 'fred', 'age': 40, 'employer': 'slate' } + * + * var defaults = _.partialRight(_.assign, function(value, other) { + * return typeof value == 'undefined' ? other : value; + * }); + * + * defaults({ 'name': 'barney' }, { 'age': 36 }, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'age': 36, 'employer': 'slate' } + */ + var assign = createAssigner(baseAssign); + /** * Creates an object that inherits from the given `prototype` object. If a * `properties` object is provided its own enumerable properties are assigned @@ -7046,524 +7548,6 @@ return result; } - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - 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 - if (!support.argsClass) { - isArguments = function(value) { - var length = (value && typeof value == 'object') ? value.length : undefined; - return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; - }; - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * (function() { return _.isArray(arguments); })(); - * // => false - */ - var isArray = nativeIsArray || function(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass) || false; - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return (value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass) || false; - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return (value && typeof value == 'object' && value.nodeType === 1 && - (support.nodeClass ? toString.call(value).indexOf('Element') > -1 : isHostObject(value))) || false; - } - // fallback for environments without DOM support - if (!support.dom) { - isElement = function(value) { - return (value && typeof value == 'object' && value.nodeType === 1 && - !isPlainObject(value)) || false; - }; - } - - /** - * Checks if a collection is empty. A value is considered empty unless it is - * an array-like value with a length greater than `0` or an object with own - * enumerable properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - var length = value.length; - if ((typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER) && - (isArray(value) || isString(value) || isArguments(value) || - (typeof value == 'object' && isFunction(value.splice)))) { - return !length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * 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). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to compare to `other`. - * @param {*} other The value to compare to `value`. - * @param {Function} [customizer] The function to customize comparing values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'name': 'fred' }; - * var other = { 'name': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * var words = ['hello', 'goodbye']; - * var otherWords = ['hi', 'goodbye']; - * - * _.isEqual(words, otherWords, function() { - * return _.every(arguments, _.bind(RegExp.prototype.test, /^h(?:i|ello)$/)) || undefined; - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = typeof customizer == 'function' && baseCallback(customizer, thisArg, 3); - return (!customizer && isStrictComparable(value) && isStrictComparable(other)) - ? value === other - : baseIsEqual(value, other, customizer); - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on ES6 `Number.isFinite`. See the - * [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - var isFinite = nativeNumIsFinite || function(value) { - return typeof value == 'number' && nativeIsFinite(value); - }; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // avoid a Chakra bug in IE 11 - // https://github.com/jashkenas/underscore/issues/1621 - return typeof value == 'function' || false; - } - // fallback for older versions of Chrome and Safari - if (isFunction(/x/)) { - isFunction = function(value) { - return typeof value == 'function' && toString.call(value) == funcClass; - }; - } - - /** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // avoid a V8 bug in Chrome 19-20 - // https://code.google.com/p/v8/issues/detail?id=2291 - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as native `isNaN` which returns `true` - * for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // `NaN` as a primitive is the only value that is not equal to itself - // (perform the `[[Class]]` check first to avoid errors with some host objects in IE) - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - */ - function isNative(value) { - if (isFunction(value)) { - return reNative.test(fnToString.call(value)); - } - return (value && typeof value == 'object' && - (isHostObject(value) ? reNative : reHostCtor).test(value)) || false; - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - var type = typeof value; - return type == 'number' || - (value && type == 'object' && toString.call(value) == numberClass) || false; - } - - /** - * Checks if `value` is an object created by the `Object` constructor or has - * a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * _.isPlainObject(new Shape); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) { - return false; - } - var valueOf = value.valueOf, - objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? (value == objProto || getPrototypeOf(value) == objProto) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return (isObject(value) && toString.call(value) == regexpClass) || false; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (value && typeof value == 'object' && toString.call(value) == stringClass) || false; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return typeof value == 'undefined'; - } - /** * Creates an array of the own enumerable property names of `object`. * @@ -7980,7 +7964,7 @@ return baseValues(object, keysIn); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Converts `string` to camel case. @@ -8714,7 +8698,7 @@ : string; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught @@ -9319,13 +9303,7 @@ return String(prefix == null ? '' : prefix) + id; } - /*--------------------------------------------------------------------------*/ - - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - // assign default placeholders - bind.placeholder = bindKey.placeholder = curry.placeholder = curryRight.placeholder = partial.placeholder = partialRight.placeholder = lodash; + /*------------------------------------------------------------------------*/ // add functions that return wrapped values when chaining lodash.after = after; @@ -9436,7 +9414,7 @@ // add functions to `lodash.prototype` mixin(lodash, baseAssign({}, lodash)); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions that return unwrapped values when chaining lodash.attempt = attempt; @@ -9531,7 +9509,7 @@ return source; }()), false); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions capable of returning wrapped and unwrapped values when chaining lodash.sample = sample; @@ -9550,7 +9528,7 @@ } }); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * The semantic version number. @@ -9561,12 +9539,18 @@ */ lodash.VERSION = VERSION; + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; - lodash.prototype.toJSON = wrapperValueOf; lodash.prototype.toString = wrapperToString; - lodash.prototype.value = wrapperValueOf; - lodash.prototype.valueOf = wrapperValueOf; + lodash.prototype.toJSON = lodash.prototype.value = lodash.prototype.valueOf = wrapperValueOf; + + // assign default placeholders + arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { + lodash[methodName].placeholder = lodash; + }); // add `Array` functions that return unwrapped values arrayEach(['join', 'pop', 'shift'], function(methodName) { diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index bf061c411..f52700419 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -1,76 +1,76 @@ /** * @license - * Lo-Dash 3.0.0-pre (Custom Build) lodash.com/license | Underscore.js 1.6.0 underscorejs.org/LICENSE + * Lo-Dash 3.0.0-pre (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE * 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 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 +}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)&&c.push(f);return c}function qt(n,t){var r=n?n.length:0;if(typeof r!="number"||-1>=r||r>F)return Qt(n,t); +for(var e=-1,u=Lr(n);++e=r||r>F)return nr(n,t);for(var e=Lr(n);r--&&false!==t(e[r],r,e););return n}function Kt(n,t){var r=true;return qt(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Vt(n,t){var r=[];return qt(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function Yt(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 Jt(n,t,r,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++el))return false}else{var g=p&&nu.call(n,"__wrapped__"),h=h&&nu.call(t,"__wrapped__"); +if(g||h)return rr(g?n.__wrapped__:n,h?t.__wrapped__:t,r,e,u,o);if(!s)return false;if(!a&&!p){switch(c){case it:case at:return+n==+t;case lt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case pt:case ht:return n==Ke(t)}return false}if(Fu.argsClass||(l=ve(n),i=ve(t)),g=l?qe:n.constructor,c=i?qe:t.constructor,a){if(g.prototype.name!=c.prototype.name)return false}else if(p=!l&&nu.call(n,"constructor"),h=!i&&nu.call(t,"constructor"),p!=h||!(p||g==c||de(g)&&g instanceof g&&de(c)&&c instanceof c)&&"constructor"in n&&"constructor"in t)return false; +if(g=a?["message","name"]:Ku(n),c=a?g:Ku(t),l&&g.push("length"),i&&c.push("length"),l=g.length,p=c.length,l!=p&&!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,f)for(;i&&++c>>1,f=r(n[a]),c=e?f<=t:fo(l,p)&&((t||f)&&l.push(p),c.push(s))}return c}function pr(n,t){for(var r=-1,e=t(n),u=e.length,o=$e(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>F)return Ee(n);if(n=Wr(n),Fu.unindexedChars&&Ae(n))for(var r=-1;++re?ju(u+e,0):e||0;else if(e)return e=Mr(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function Br(n){return Dr(n,1)}function Dr(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=$e(o);++ur?ju(e+r,0):r||0:0,typeof n=="string"||!Mu(n)&&Ae(n)?ru&&(u=a);else t=i&&a?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 te(n,t){return Qr(n,Ne(t))}function re(n,t,r,e){return(Mu(n)?Rt:fr)(n,xr(t,e,4),r,3>arguments.length,qt)}function ee(n,t,r,e){return(Mu(n)?kt:fr)(n,xr(t,e,4),r,3>arguments.length,Zt)}function ue(n){n=Lr(n);for(var t=-1,r=n.length,e=$e(r);++targuments.length)return Ar(n,w,null,t);var r=Dr(arguments,2),e=Fr(r,ae.placeholder);return ir(n,w|E,r,e,t)}function fe(n,t){var r=w|j;if(2=r||r>t?(a&&au(a),r=p,a=s=p=_,r&&(h=Gu(),f=n.apply(l,i),s||a||(i=l=null))):s=hu(e,r)}function u(){s&&au(s),a=s=p=_,(v||g!==t)&&(h=Gu(),f=n.apply(l,i),s||a||(i=l=null))}function o(){if(i=arguments,c=Gu(),l=this,p=v&&(s||!y),false===g)var r=y&&!s;else{a||y||(h=c);var o=g-(c-h),m=0>=o||o>g;m?(a&&(a=au(a)),h=c,f=n.apply(l,i)):a||(a=hu(u,o))}return m&&s?s=au(s):s||t===g||(s=hu(e,t)),r&&(m=true,f=n.apply(l,i)),!m||s||a||(i=l=null),f +}var i,a,f,c,l,s,p,h=0,g=false,v=true;if(!de(n))throw new Ve(R);if(t=0>t?0:t,true===r)var y=true,v=false;else _e(r)&&(y=r.leading,g="maxWait"in r&&ju(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&au(s),a&&au(a),a=s=p=_},o}function pe(){var n=arguments,t=n.length-1;if(0>t)return function(){};if(!It(n,de))throw new Ve(R);return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function he(n){var t=Dr(arguments,1),r=Fr(t,he.placeholder);return ir(n,E,t,r) +}function ge(n){var t=Dr(arguments,1),r=Fr(t,ge.placeholder);return ir(n,I,t,r)}function ve(n){var t=n&&typeof n=="object"?n.length:_;return typeof t=="number"&&-1t||null==n||!bu(t))return r;n=Ke(n);do t%2&&(r+=n),t=fu(t/2),n+=n; +while(t);return r}function Ce(n,t){return(n=null==n?"":Ke(n))?null==t?n.slice(v(n),y(n)+1):(t=Ke(t),n.slice(i(n,t),a(n,t)+1)):n}function Re(n){try{return n()}catch(t){return me(t)?t:Be(t)}}function ke(n,t){return Pt(n,t)}function Fe(n){return n}function Ue(n){var t=Ku(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Cr(u))return function(n){return null!=n&&u===n[e]&&nu.call(n,e)}}for(var o=r,i=$e(r),a=$e(r);o--;){var u=n[t[o]],f=Cr(u);i[o]=f,a[o]=f?u:Bt(u)}return function(n){if(o=r,null==n)return!o;for(;o--;)if(i[o]?a[o]!==n[t[o]]:!nu.call(n,t[o]))return false; +for(o=r;o--;)if(i[o]?!nu.call(n,t[o]):!rr(a[o],n[t[o]],null,true))return false;return true}}function Te(n,t,r){var e=true,u=_e(t),o=null==r,i=o&&u&&Ku(t),a=i&&tr(t,i);(i&&i.length&&!a.length||o&&!u)&&(o&&(r=t),a=false,t=n,n=this),a||(a=tr(t,Ku(t))),false===r?e=false:_e(r)&&"chain"in r&&(e=r.chain),r=-1,u=de(n);for(o=a.length;++r=S)return r}else n=0;return Uu(r,e)}}(),Nu=yr(function(n,t,r){nu.call(n,r)?++n[r]:n[r]=1}),$u=yr(function(n,t,r){nu.call(n,r)?n[r].push(t):n[r]=[t]}),Pu=yr(function(n,t,r){n[r]=t}),Bu=yr(function(n,t,r){n[r?0:1].push(t) +},function(){return[[],[]]}),Du=he(ie,2);Fu.argsClass||(ve=function(n){var t=n&&typeof n=="object"?n.length:_;return typeof t=="number"&&-1--n?t.apply(this,arguments):void 0}},g.assign=Zu,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),Dr(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 Dr(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(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=Ku(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),Dr(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 Dr(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?"":Ke(n),B.lastIndex=0,B.test(n)?n.replace(B,p):n},g.escapeRegExp=Ie,g.every=Yr,g.find=Xr,g.findIndex=Nr,g.findKey=function(n,t,r){return t=xr(t,r,3),Yt(n,t,Qt,true)},g.findLast=function(n,t,r){return t=xr(t,r,3),Yt(n,t,Zt) +},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),Yt(n,t,nr,true)},g.findWhere=function(n,t){return Xr(n,Ue(t))},g.first=$r,g.has=function(n,t){return n?nu.call(n,t):false},g.identity=Fe,g.indexOf=Pr,g.isArguments=ve,g.isArray=Mu,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)==at||false},g.isElement=ye,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=zr(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=ne,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&&Mu(n))&&Ae(n);if(i&&!a)for(r=-1,n=Lr(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=Zu({},r||t,e,Nt),n=Ke(null==n?"":n),r=Zu({},t.imports,e.imports,Nt); +var u,o,i=Ku(r),a=Ee(r),f=0;r=t.interpolate||X;var c="__p+='";if(r=Ze((t.escape||X).source+"|"+r.source+"|"+(r===z?q:X).source+"|"+(t.evaluate||X).source+"|$","g"),n.replace(r,function(t,r,e,i,a,l){return e||(e=i),c+=n.slice(f,l).replace(Q,h),r&&(u=true,c+="'+__e("+r+")+'"),a&&(o=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),f=l+t.length,t}),c+="';",(t=t.variable)||(c="with(obj){"+c+"}"),c=(o?c.replace(W,""):c).replace(N,"$1").replace($,"$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=Re(function(){return De(i,"return "+c).apply(_,a) +}),t.source=c,me(t))throw t;return t},g.trim=Ce,g.trimLeft=function(n,t){return(n=null==n?"":Ke(n))?null==t?n.slice(v(n)):(t=Ke(t),n.slice(i(n,t))):n},g.trimRight=function(n,t){return(n=null==n?"":Ke(n))?null==t?n.slice(0,y(n)+1):(t=Ke(t),n.slice(0,a(n,t)+1)):n},g.trunc=function(n,t){var r=30,e="...";if(_e(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Ke(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Ke(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(je(u)){if(n.slice(o).search(u)){var i,a,f=n.slice(0,o);for(u.global||(u=Ze(u.source,(Z.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)},Qt(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,J.prototype=g.prototype,g.prototype.chain=function(){return this.__chain__=true,this},g.prototype.toString=function(){return Ke(this.__wrapped__) +},g.prototype.toJSON=g.prototype.value=g.prototype.valueOf=function(){return this.__wrapped__},nt("bind bindKey curry curryRight partial partialRight".split(" "),function(n){g[n].placeholder=g}),nt(["join","pop","shift"],function(n){var t=Ye[n];g.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new J(r,n):r}}),nt(["push","reverse","sort","unshift"],function(n){var t=Ye[n];g.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),nt(["concat","splice"],function(n){var t=Ye[n]; +g.prototype[n]=function(){return new J(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Fu.spliceObjects||nt(["pop","shift","splice"],function(n){var t=Ye[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 J(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,R="Expected a function",k=Math.pow(2,32)-1,F=Math.pow(2,53)-1,U="__lodash_placeholder__",T=0,L=/^[A-Z]+$/,W=/\b__p\+='';/g,N=/\b(__p\+=)''\+/g,$=/(__e\(.*?\)|\b__t\))\+'';/g,P=/&(?:amp|lt|gt|quot|#39|#96);/g,B=/[&<>"'`]/g,D=/<%-([\s\S]+?)%>/g,M=/<%([\s\S]+?)%>/g,z=/<%=([\s\S]+?)%>/g,q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Z=/\w*$/,K=/^\s*function[ \n\r\t]+\w/,V=/^0[xX]/,Y=/^\[object .+?Constructor\]$/,J=/[\xC0-\xFF]/g,X=/($^)/,G=/[.*+?^${}()|[\]\/\\]/g,H=/\bthis\b/,Q=/['\n\r\u2028\u2029\\]/g,nt=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,tt=" \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",rt="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(" "),et="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ut="[object Arguments]",ot="[object Array]",it="[object Boolean]",at="[object Date]",ft="[object Error]",ct="[object Function]",lt="[object Number]",st="[object Object]",pt="[object RegExp]",ht="[object String]",gt="[object ArrayBuffer]",vt="[object Float32Array]",yt="[object Float64Array]",mt="[object Int8Array]",dt="[object Int16Array]",_t="[object Int32Array]",bt="[object Uint8Array]",wt="[object Uint8ClampedArray]",jt="[object Uint16Array]",At="[object Uint32Array]",xt={}; +xt[ut]=xt[ot]=xt[vt]=xt[yt]=xt[mt]=xt[dt]=xt[_t]=xt[bt]=xt[wt]=xt[jt]=xt[At]=true,xt[gt]=xt[it]=xt[at]=xt[ft]=xt[ct]=xt["[object Map]"]=xt[lt]=xt[st]=xt[pt]=xt["[object Set]"]=xt[ht]=xt["[object WeakMap]"]=false;var Ot={};Ot[ut]=Ot[ot]=Ot[gt]=Ot[it]=Ot[at]=Ot[vt]=Ot[yt]=Ot[mt]=Ot[dt]=Ot[_t]=Ot[lt]=Ot[st]=Ot[pt]=Ot[ht]=Ot[bt]=Ot[wt]=Ot[jt]=Ot[At]=true,Ot[ft]=Ot[ct]=Ot["[object Map]"]=Ot["[object Set]"]=Ot["[object WeakMap]"]=false;var Et={leading:false,maxWait:0,trailing:false},It={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},St={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ct={"\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":" "},Rt={"function":true,object:true},kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ft=Rt[typeof window]&&window||this,Ut=Rt[typeof exports]&&exports&&!exports.nodeType&&exports,Rt=Rt[typeof module]&&module&&!module.nodeType&&module,Tt=Ut&&Rt&&typeof global=="object"&&global; +!Tt||Tt.global!==Tt&&Tt.window!==Tt&&Tt.self!==Tt||(Ft=Tt);var Tt=Rt&&Rt.exports===Ut&&Ut,Lt=function(){try{({toString:0}+"")}catch(n){return function(){return false}}return function(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}}(),Wt=d();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=Wt, define(function(){return Wt})):Ut&&Rt?Tt?(Rt.exports=Wt)._=Wt:Ut._=Wt:Ft._=Wt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 4cc42a490..08af34a85 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -3,7 +3,7 @@ * Lo-Dash 3.0.0-pre (Custom Build) * Build: `lodash modern -o ./dist/lodash.js` * Copyright 2012-2014 The Dojo Foundation - * Based on Underscore.js 1.6.0 + * Based on Underscore.js 1.7.0 * Copyright 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ @@ -28,9 +28,6 @@ var HOT_COUNT = 150, HOT_SPAN = 16; - /** Used as the property name for wrapper metadata */ - var EXPANDO = '__lodash_' + VERSION.replace(/[-.]/g, '_') + '__'; - /** Used as the TypeError message for "Functions" methods */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -196,14 +193,6 @@ 'trailing': false }; - /** Used as the property descriptor for wrapper metadata */ - var descriptor = { - 'configurable': false, - 'enumerable': false, - 'value': null, - 'writable': false - }; - /** * Used to convert characters to HTML entities. * @@ -694,17 +683,6 @@ return result; }()); - /** Used to set metadata on functions */ - var defineProperty = (function() { - // IE 8 only accepts DOM elements - try { - var o = {}, - func = isNative(func = Object.defineProperty) && func, - result = func(o, o, o) && func; - } catch(e) {} - return result; - }()); - /* Native method references for those with the same name as other `lodash` methods */ var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, @@ -723,7 +701,7 @@ /** Used to store function metadata */ var metaMap = WeakMap && new WeakMap; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps the given value to enable intuitive @@ -939,7 +917,7 @@ } }; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * A specialized version of `_.forEach` for arrays without support for @@ -1988,7 +1966,7 @@ var data = getData(func), arity = data ? data[2] : func.length; - arity -= args.length; + arity = nativeMax(arity - args.length, 0); } return (bitmask & PARTIAL_FLAG) ? createWrapper(func, bitmask, arity, thisArg, args, holders) @@ -2063,19 +2041,10 @@ * @param {*} data The metadata. * @returns {Function} Returns `func`. */ - function baseSetData(func, data) { + var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; - } - // fallback for environments without `WeakMap` - if (!WeakMap) { - baseSetData = !defineProperty ? identity : function(func, value) { - descriptor.value = value; - defineProperty(func, EXPANDO, descriptor); - descriptor.value = null; - return func; - }; - } + }; /** * The base implementation of `_.some` without support for callback shorthands @@ -2668,15 +2637,9 @@ * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ - function getData(func) { + var getData = !metaMap ? noop : function(func) { return metaMap.get(func); - } - // fallback for environments without `WeakMap` - if (!WeakMap) { - getData = !defineProperty ? noop : function(func) { - return func[EXPANDO]; - }; - } + }; /** * Gets the appropriate "indexOf" function. If the `_.indexOf` method is @@ -3011,7 +2974,7 @@ return isObject(value) ? value : Object(value); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. @@ -4282,7 +4245,7 @@ return result; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object that wraps `value` with explicit method @@ -4403,7 +4366,7 @@ return this.__wrapped__; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates an array of elements corresponding to the specified keys, or indexes, @@ -5546,7 +5509,7 @@ return filter(collection, matches(source)); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes @@ -5573,7 +5536,13 @@ */ function after(n, func) { if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); + if (isFunction(n)) { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } } n = nativeIsFinite(n = +n) ? n : 0; return function() { @@ -5601,7 +5570,13 @@ function before(n, func) { var result; if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); + if (isFunction(n)) { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } } return function() { if (--n > 0) { @@ -6359,37 +6334,7 @@ return basePartial(wrapper, PARTIAL_FLAG, [value], []); } - /*--------------------------------------------------------------------------*/ - - /** - * 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 invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments; - * (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns the destination object. - * @example - * - * _.assign({ 'name': 'fred' }, { 'age': 40 }, { 'employer': 'slate' }); - * // => { 'name': 'fred', 'age': 40, 'employer': 'slate' } - * - * var defaults = _.partialRight(_.assign, function(value, other) { - * return typeof value == 'undefined' ? other : value; - * }); - * - * defaults({ 'name': 'barney' }, { 'age': 36 }, { 'name': 'fred', 'employer': 'slate' }); - * // => { 'name': 'barney', 'age': 36, 'employer': 'slate' } - */ - var assign = createAssigner(baseAssign); + /*------------------------------------------------------------------------*/ /** * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, @@ -6406,7 +6351,7 @@ * * @static * @memberOf _ - * @category Object + * @category Lang * @param {*} value The value to clone. * @param {boolean} [isDeep=false] Specify a deep clone. * @param {Function} [customizer] The function to customize cloning values. @@ -6469,7 +6414,7 @@ * * @static * @memberOf _ - * @category Object + * @category Lang * @param {*} value The value to deep clone. * @param {Function} [customizer] The function to customize cloning values. * @param {*} [thisArg] The `this` binding of `customizer`. @@ -6502,6 +6447,548 @@ return baseClone(value, true, customizer); } + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && + toString.call(value) == argsClass) || false; + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * (function() { return _.isArray(arguments); })(); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass) || false; + }; + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return (value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass) || false; + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return (value && typeof value == 'object' && value.nodeType === 1 && + toString.call(value).indexOf('Element') > -1) || false; + } + // fallback for environments without DOM support + if (!support.dom) { + isElement = function(value) { + return (value && typeof value == 'object' && value.nodeType === 1 && + !isPlainObject(value)) || false; + }; + } + + /** + * Checks if a collection is empty. A value is considered empty unless it is + * an array-like value with a length greater than `0` or an object with own + * enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + var length = value.length; + if ((typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER) && + (isArray(value) || isString(value) || isArguments(value) || + (typeof value == 'object' && isFunction(value.splice)))) { + return !length; + } + return !keys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * 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). + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. Provide a customizer function to extend support + * for comparing other values. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare to `other`. + * @param {*} other The value to compare to `value`. + * @param {Function} [customizer] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var other = { 'name': 'fred' }; + * + * object == other; + * // => false + * + * _.isEqual(object, other); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function() { + * return _.every(arguments, _.bind(RegExp.prototype.test, /^h(?:i|ello)$/)) || undefined; + * }); + * // => true + */ + function isEqual(value, other, customizer, thisArg) { + customizer = typeof customizer == 'function' && baseCallback(customizer, thisArg, 3); + return (!customizer && isStrictComparable(value) && isStrictComparable(other)) + ? value === other + : baseIsEqual(value, other, customizer); + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on ES6 `Number.isFinite`. See the + * [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(10); + * // => true + * + * _.isFinite('10'); + * // => false + * + * _.isFinite(true); + * // => false + * + * _.isFinite(Object(10)); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + var isFinite = nativeNumIsFinite || function(value) { + return typeof value == 'number' && nativeIsFinite(value); + }; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // avoid a Chakra bug in IE 11 + // https://github.com/jashkenas/underscore/issues/1621 + return typeof value == 'function' || false; + } + + /** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // avoid a V8 bug in Chrome 19-20 + // https://code.google.com/p/v8/issues/detail?id=2291 + var type = typeof value; + return type == 'function' || (value && type == 'object') || false; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is not the same as native `isNaN` which returns `true` + * for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the `[[Class]]` check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isFunction(value)) { + return reNative.test(fnToString.call(value)); + } + return (value && typeof value == 'object' && reHostCtor.test(value)) || false; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(8.4); + * // => true + * + * _.isNumber(NaN); + * // => true + * + * _.isNumber('8.4'); + * // => false + */ + function isNumber(value) { + var type = typeof value; + return type == 'number' || + (value && type == 'object' && toString.call(value) == numberClass) || false; + } + + /** + * Checks if `value` is an object created by the `Object` constructor or has + * a `[[Prototype]]` of `null`. + * + * **Note:** This method assumes objects created by the `Object` constructor + * have no inherited enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * _.isPlainObject(new Shape); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && toString.call(value) == objectClass)) { + return false; + } + var valueOf = value.valueOf, + objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? (value == objProto || getPrototypeOf(value) == objProto) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return (value && typeof value == 'object' && toString.call(value) == regexpClass) || false; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (value && typeof value == 'object' && toString.call(value) == stringClass) || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /*------------------------------------------------------------------------*/ + + /** + * 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 invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments; + * (objectValue, sourceValue, key, object, source). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'fred' }, { 'age': 40 }, { 'employer': 'slate' }); + * // => { 'name': 'fred', 'age': 40, 'employer': 'slate' } + * + * var defaults = _.partialRight(_.assign, function(value, other) { + * return typeof value == 'undefined' ? other : value; + * }); + * + * defaults({ 'name': 'barney' }, { 'age': 36 }, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'age': 36, 'employer': 'slate' } + */ + var assign = createAssigner(baseAssign); + /** * Creates an object that inherits from the given `prototype` object. If a * `properties` object is provided its own enumerable properties are assigned @@ -6859,509 +7346,6 @@ return result; } - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - var length = (value && typeof value == 'object') ? value.length : undefined; - return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && - toString.call(value) == argsClass) || false; - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * (function() { return _.isArray(arguments); })(); - * // => false - */ - var isArray = nativeIsArray || function(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass) || false; - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return (value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass) || false; - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return (value && typeof value == 'object' && value.nodeType === 1 && - toString.call(value).indexOf('Element') > -1) || false; - } - // fallback for environments without DOM support - if (!support.dom) { - isElement = function(value) { - return (value && typeof value == 'object' && value.nodeType === 1 && - !isPlainObject(value)) || false; - }; - } - - /** - * Checks if a collection is empty. A value is considered empty unless it is - * an array-like value with a length greater than `0` or an object with own - * enumerable properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - var length = value.length; - if ((typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER) && - (isArray(value) || isString(value) || isArguments(value) || - (typeof value == 'object' && isFunction(value.splice)))) { - return !length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * 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). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to compare to `other`. - * @param {*} other The value to compare to `value`. - * @param {Function} [customizer] The function to customize comparing values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'name': 'fred' }; - * var other = { 'name': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * var words = ['hello', 'goodbye']; - * var otherWords = ['hi', 'goodbye']; - * - * _.isEqual(words, otherWords, function() { - * return _.every(arguments, _.bind(RegExp.prototype.test, /^h(?:i|ello)$/)) || undefined; - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = typeof customizer == 'function' && baseCallback(customizer, thisArg, 3); - return (!customizer && isStrictComparable(value) && isStrictComparable(other)) - ? value === other - : baseIsEqual(value, other, customizer); - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on ES6 `Number.isFinite`. See the - * [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - var isFinite = nativeNumIsFinite || function(value) { - return typeof value == 'number' && nativeIsFinite(value); - }; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // avoid a Chakra bug in IE 11 - // https://github.com/jashkenas/underscore/issues/1621 - return typeof value == 'function' || false; - } - - /** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // avoid a V8 bug in Chrome 19-20 - // https://code.google.com/p/v8/issues/detail?id=2291 - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as native `isNaN` which returns `true` - * for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // `NaN` as a primitive is the only value that is not equal to itself - // (perform the `[[Class]]` check first to avoid errors with some host objects in IE) - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - */ - function isNative(value) { - if (isFunction(value)) { - return reNative.test(fnToString.call(value)); - } - return (value && typeof value == 'object' && reHostCtor.test(value)) || false; - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - var type = typeof value; - return type == 'number' || - (value && type == 'object' && toString.call(value) == numberClass) || false; - } - - /** - * Checks if `value` is an object created by the `Object` constructor or has - * a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * _.isPlainObject(new Shape); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && toString.call(value) == objectClass)) { - return false; - } - var valueOf = value.valueOf, - objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? (value == objProto || getPrototypeOf(value) == objProto) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return (value && typeof value == 'object' && toString.call(value) == regexpClass) || false; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (value && typeof value == 'object' && toString.call(value) == stringClass) || false; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return typeof value == 'undefined'; - } - /** * Creates an array of the own enumerable property names of `object`. * @@ -7753,7 +7737,7 @@ return baseValues(object, keysIn); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Converts `string` to camel case. @@ -8487,7 +8471,7 @@ : string; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught @@ -9092,13 +9076,7 @@ return String(prefix == null ? '' : prefix) + id; } - /*--------------------------------------------------------------------------*/ - - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - // assign default placeholders - bind.placeholder = bindKey.placeholder = curry.placeholder = curryRight.placeholder = partial.placeholder = partialRight.placeholder = lodash; + /*------------------------------------------------------------------------*/ // add functions that return wrapped values when chaining lodash.after = after; @@ -9209,7 +9187,7 @@ // add functions to `lodash.prototype` mixin(lodash, baseAssign({}, lodash)); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions that return unwrapped values when chaining lodash.attempt = attempt; @@ -9304,7 +9282,7 @@ return source; }()), false); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions capable of returning wrapped and unwrapped values when chaining lodash.sample = sample; @@ -9323,7 +9301,7 @@ } }); - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * The semantic version number. @@ -9334,12 +9312,18 @@ */ lodash.VERSION = VERSION; + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; - lodash.prototype.toJSON = wrapperValueOf; lodash.prototype.toString = wrapperToString; - lodash.prototype.value = wrapperValueOf; - lodash.prototype.valueOf = wrapperValueOf; + lodash.prototype.toJSON = lodash.prototype.value = lodash.prototype.valueOf = wrapperValueOf; + + // assign default placeholders + arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { + lodash[methodName].placeholder = lodash; + }); // add `Array` functions that return unwrapped values arrayEach(['join', 'pop', 'shift'], function(methodName) { diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 8a9458147..8df3e5fc6 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -1,72 +1,73 @@ /** * @license - * Lo-Dash 3.0.0-pre (Custom Build) lodash.com/license | Underscore.js 1.6.0 underscorejs.org/LICENSE + * Lo-Dash 3.0.0-pre (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE * 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 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=[];++el))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 +}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 Mt(n,t){var r=n?n.length:0;if(typeof r!="number"||-1>=r||r>F)return Xt(n,t); +for(var e=-1,u=Fr(n);++e=r||r>F)return Gt(n,t);for(var e=Fr(n);r--&&false!==t(e[r],r,e););return n}function qt(n,t){var r=true;return Mt(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Zt(n,t){var r=[];return Mt(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function Kt(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 Pt(n,t,r,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++el))return false}else{var g=s&&Je.call(n,"__wrapped__"),h=h&&Je.call(t,"__wrapped__"); +if(g||h)return Qt(g?n.__wrapped__:n,h?t.__wrapped__:t,r,e,u,o);if(!p)return false;if(!f&&!s){switch(c){case ot:case it:return+n==+t;case at:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case lt:case pt:return n==qe(t)}return false}if(g=l?Me:n.constructor,c=i?Me:t.constructor,f){if(g.prototype.name!=c.prototype.name)return false}else if(s=!l&&Je.call(n,"constructor"),h=!i&&Je.call(t,"constructor"),s!=h||!(s||g==c||ve(g)&&g instanceof g&&ve(c)&&c instanceof c)&&"constructor"in n&&"constructor"in t)return false;if(g=f?["message","name"]:Bu(n),c=f?g:Bu(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 cr(n,t){for(var r=-1,e=t(n),u=e.length,o=We(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?du(u+e,0):e||0;else if(e)return e=Br(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function Lr(n){return $r(n,1) +}function $r(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=We(o);++ur?du(e+r,0):r||0:0,typeof n=="string"||!Wu(n)&&_e(n)?ru&&(u=f);else t=i&&f?o:wr(t,r,3),Mt(n,function(n,r,o){r=t(n,r,o),(r>e||-1/0===r&&r===u)&&(e=r,u=n)});return u}function Hr(n,t){return Xr(n,Ue(t))}function Qr(n,t,r,e){return(Wu(n)?Rt:or)(n,wr(t,e,4),r,3>arguments.length,Mt)}function ne(n,t,r,e){return(Wu(n)?kt:or)(n,wr(t,e,4),r,3>arguments.length,zt) +}function te(n){n=Fr(n);for(var t=-1,r=n.length,e=We(r);++targuments.length)return _r(n,w,null,t);var r=$r(arguments,2),e=kr(r,ue.placeholder);return er(n,w|O,r,e,t)}function oe(n,t){var r=w|j; +if(2=r||r>t?(f&&ru(f),r=s,f=p=s=b,r&&(h=Zu(),a=n.apply(l,i),p||f||(i=l=null))):p=au(e,r)}function u(){p&&ru(p),f=p=s=b,(v||g!==t)&&(h=Zu(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=Zu(),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=ru(f)),h=c,a=n.apply(l,i)):f||(f=au(u,o))}return d&&p?p=ru(p):p||t===g||(p=au(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(!ve(n))throw new Ze(S);if(t=0>t?0:t,true===r)var y=true,v=false;else ye(r)&&(y=r.leading,g="maxWait"in r&&du(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){p&&ru(p),f&&ru(f),f=p=s=b},o}function ce(){var n=arguments,t=n.length-1;if(0>t)return function(){};if(!Et(n,ve))throw new Ze(S); +return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function le(n){var t=$r(arguments,1),r=kr(t,le.placeholder);return er(n,O,t,r)}function pe(n){var t=$r(arguments,1),r=kr(t,pe.placeholder);return er(n,I,t,r)}function se(n){var t=n&&typeof n=="object"?n.length:b;return typeof t=="number"&&-1>>0,e=n.constructor,u=-1,e=e&&n===e.prototype,o=r-1,i=We(r),f=0t||null==n||!vu(t))return r;n=qe(n);do t%2&&(r+=n),t=eu(t/2),n+=n;while(t);return r}function Oe(n,t){return(n=null==n?"":qe(n))?null==t?n.slice(v(n),y(n)+1):(t=qe(t),n.slice(i(n,t),f(n,t)+1)):n +}function Ie(n){try{return n()}catch(t){return ge(t)?t:Le(t)}}function Re(n,t){return Nt(n,t)}function ke(n){return n}function Se(n){var t=Bu(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Or(u))return function(n){return null!=n&&u===n[e]&&Je.call(n,e)}}for(var o=r,i=We(r),f=We(r);o--;){var u=n[t[o]],a=Or(u);i[o]=a,f[o]=a?u:Lt(u)}return function(n){if(o=r,null==n)return!o;for(;o--;)if(i[o]?f[o]!==n[t[o]]:!Je.call(n,t[o]))return false;for(o=r;o--;)if(i[o]?!Je.call(n,t[o]):!Qt(f[o],n[t[o]],null,true))return false; +return true}}function Ce(n,t,r){var e=true,u=ye(t),o=null==r,i=o&&u&&Bu(t),f=i&&Ht(t,i);(i&&i.length&&!f.length||o&&!u)&&(o&&(r=t),f=false,t=n,n=this),f||(f=Ht(t,Bu(t))),false===r?e=false:ye(r)&&"chain"in r&&(e=r.chain),r=-1,u=ve(n);for(o=f.length;++r=R)return r +}else n=0;return Ou(r,e)}}(),Su=hr(function(n,t,r){Je.call(n,r)?++n[r]:n[r]=1}),Cu=hr(function(n,t,r){Je.call(n,r)?n[r].push(t):n[r]=[t]}),Fu=hr(function(n,t,r){n[r]=t}),Tu=hr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Uu=le(ee,2),Wu=gu||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ge.call(n)==ut||false};Eu.dom||(he=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!Lu(n)||false});var Nu=_u||function(n){return typeof n=="number"&&vu(n)},Lu=uu?function(n){if(!n||Ge.call(n)!=ct)return false; +var t=n.valueOf,r=de(t)&&(r=uu(t))&&uu(r);return r?n==r||uu(n)==r:Sr(n)}:Sr,$u=gr(Wt),Bu=yu?function(n){n=Tr(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),$r(n,0,0>t?0:t)},g.dropRightWhile=function(n,t,r){var e=n?n.length:0;for(t=wr(t,r,3);e--&&t(n[e],e,n););return $r(n,0,e+1)},g.dropWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=wr(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=Bu(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),$r(n,0>t?0:t)},g.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=wr(t,r,3);e--&&t(n[e],e,n););return $r(n,e+1)},g.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=wr(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?"":qe(n),D.lastIndex=0,D.test(n)?n.replace(D,s):n},g.escapeRegExp=xe,g.every=Kr,g.find=Vr,g.findIndex=Ur,g.findKey=function(n,t,r){return t=wr(t,r,3),Kt(n,t,Xt,true)},g.findLast=function(n,t,r){return t=wr(t,r,3),Kt(n,t,zt)},g.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=wr(t,r,3);e--;)if(t(n[e],e,n))return e; +return-1},g.findLastKey=function(n,t,r){return t=wr(t,r,3),Kt(n,t,Gt,true)},g.findWhere=function(n,t){return Vr(n,Se(t))},g.first=Wr,g.has=function(n,t){return n?Je.call(n,t):false},g.identity=ke,g.indexOf=Nr,g.isArguments=se,g.isArray=Wu,g.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Ge.call(n)==ot||false},g.isDate=function(n){return n&&typeof n=="object"&&Ge.call(n)==it||false},g.isElement=he,g.isEmpty=function(n){if(null==n)return true;var t=n.length;return typeof t=="number"&&-1r?du(u+r,0):mu(r||0,u-1))+1; +else if(r)return u=Dr(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=Gr,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&&Wu(n))&&_e(n);if(i&&!f)for(r=-1,n=Fr(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,Ut),n=qe(null==n?"":n),r=$u({},t.imports,e.imports,Ut); +var u,o,i=Bu(r),f=Ae(r),a=0;r=t.interpolate||X;var c="__p+='";if(r=ze((t.escape||X).source+"|"+r.source+"|"+(r===q?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(Q,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(N,""):c).replace(L,"$1").replace($,"$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=Ie(function(){return $e(i,"return "+c).apply(b,f) +}),t.source=c,ge(t))throw t;return t},g.trim=Oe,g.trimLeft=function(n,t){return(n=null==n?"":qe(n))?null==t?n.slice(v(n)):(t=qe(t),n.slice(i(n,t))):n},g.trimRight=function(n,t){return(n=null==n?"":qe(n))?null==t?n.slice(0,y(n)+1):(t=qe(t),n.slice(0,f(n,t)+1)):n},g.trunc=function(n,t){var r=30,e="...";if(ye(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?qe(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":qe(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(be(u)){if(n.slice(o).search(u)){var i,f,a=n.slice(0,o);for(u.global||(u=ze(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)},Xt(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=_,J.prototype=g.prototype,g.prototype.chain=function(){return this.__chain__=true,this},g.prototype.toString=function(){return qe(this.__wrapped__) +},g.prototype.toJSON=g.prototype.value=g.prototype.valueOf=function(){return this.__wrapped__},nt("bind bindKey curry curryRight partial partialRight".split(" "),function(n){g[n].placeholder=g}),nt(["join","pop","shift"],function(n){var t=Ke[n];g.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new J(r,n):r}}),nt(["push","reverse","sort","unshift"],function(n){var t=Ke[n];g.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),nt(["concat","splice"],function(n){var t=Ke[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,E=16,O=32,I=64,R=150,k=16,S="Expected a function",C=Math.pow(2,32)-1,F=Math.pow(2,53)-1,T="__lodash_placeholder__",U=0,W=/^[A-Z]+$/,N=/\b__p\+='';/g,L=/\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*$/,P=/^\s*function[ \n\r\t]+\w/,V=/^0[xX]/,Y=/^\[object .+?Constructor\]$/,J=/[\xC0-\xFF]/g,X=/($^)/,G=/[.*+?^${}()|[\]\/\\]/g,H=/\bthis\b/,Q=/['\n\r\u2028\u2029\\]/g,nt=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,tt=" \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",rt="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(" "),et="[object Arguments]",ut="[object Array]",ot="[object Boolean]",it="[object Date]",ft="[object Error]",at="[object Number]",ct="[object Object]",lt="[object RegExp]",pt="[object String]",st="[object ArrayBuffer]",ht="[object Float32Array]",gt="[object Float64Array]",vt="[object Int8Array]",yt="[object Int16Array]",dt="[object Int32Array]",mt="[object Uint8Array]",bt="[object Uint8ClampedArray]",_t="[object Uint16Array]",wt="[object Uint32Array]",jt={}; +jt[et]=jt[ut]=jt[ht]=jt[gt]=jt[vt]=jt[yt]=jt[dt]=jt[mt]=jt[bt]=jt[_t]=jt[wt]=true,jt[st]=jt[ot]=jt[it]=jt[ft]=jt["[object Function]"]=jt["[object Map]"]=jt[at]=jt[ct]=jt[lt]=jt["[object Set]"]=jt[pt]=jt["[object WeakMap]"]=false;var At={};At[et]=At[ut]=At[st]=At[ot]=At[it]=At[ht]=At[gt]=At[vt]=At[yt]=At[dt]=At[at]=At[ct]=At[lt]=At[pt]=At[mt]=At[bt]=At[_t]=At[wt]=true,At[ft]=At["[object Function]"]=At["[object Map]"]=At["[object Set]"]=At["[object WeakMap]"]=false;var xt={leading:false,maxWait:0,trailing:false},Et={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ot={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},It={"\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":" "},Rt={"function":true,object:true},kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},St=Rt[typeof window]&&window||this,Ct=Rt[typeof exports]&&exports&&!exports.nodeType&&exports,Rt=Rt[typeof module]&&module&&!module.nodeType&&module,Ft=Ct&&Rt&&typeof global=="object"&&global; +!Ft||Ft.global!==Ft&&Ft.window!==Ft&&Ft.self!==Ft||(St=Ft);var Ft=Rt&&Rt.exports===Ct&&Ct,Tt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(St._=Tt, define(function(){return Tt})):Ct&&Rt?Ft?(Rt.exports=Tt)._=Tt:Ct._=Tt:St._=Tt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 1aed620b0..9b4a725aa 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -15,6 +15,9 @@ /** Used as the semantic version number */ var VERSION = '3.0.0-pre'; + /** Used by methods to exit iteration */ + var BREAK_INDICATOR = '__lodash_breaker__'; + /** Used to compose bitmasks for wrapper metadata */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, @@ -23,12 +26,6 @@ CURRY_BOUND_FLAG = 16, PARTIAL_FLAG = 32; - /** Used as the property name for wrapper metadata */ - var EXPANDO = '__lodash_' + VERSION.replace(/[-.]/g, '_') + '__'; - - /** Used by methods to exit iteration */ - var breakIndicator = EXPANDO + 'breaker__'; - /** Used as the TypeError message for "Functions" methods */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -333,7 +330,7 @@ nativeNow = isNative(nativeNow = Date.now) && nativeNow, nativeRandom = Math.random; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps the given value to enable intuitive @@ -495,7 +492,7 @@ 'variable': '' }; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * A specialized version of `_.forEach` for arrays without support for @@ -511,7 +508,7 @@ length = array.length; while (++index < length) { - if (iteratee(array[index], index, array) === breakIndicator) { + if (iteratee(array[index], index, array) === BREAK_INDICATOR) { break; } } @@ -812,7 +809,7 @@ iterable = toIterable(collection); while (++index < length) { - if (iteratee(iterable[index], index, iterable) === breakIndicator) { + if (iteratee(iterable[index], index, iterable) === BREAK_INDICATOR) { break; } } @@ -835,7 +832,7 @@ } var iterable = toIterable(collection); while (length--) { - if (iteratee(iterable[length], length, iterable) === breakIndicator) { + if (iteratee(iterable[length], length, iterable) === BREAK_INDICATOR) { break; } } @@ -857,7 +854,7 @@ baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); - return result || breakIndicator; + return result || BREAK_INDICATOR; }); return result; } @@ -901,7 +898,7 @@ eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = retKey ? key : value; - return breakIndicator; + return BREAK_INDICATOR; } }); return result; @@ -966,7 +963,7 @@ while (++index < length) { var key = props[index]; - if (iteratee(object[key], key, object) === breakIndicator) { + if (iteratee(object[key], key, object) === BREAK_INDICATOR) { break; } } @@ -989,7 +986,7 @@ while (length--) { var key = props[length]; - if (iteratee(object[key], key, object) === breakIndicator) { + if (iteratee(object[key], key, object) === BREAK_INDICATOR) { break; } } @@ -1297,7 +1294,7 @@ baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); - return result && breakIndicator; + return result && BREAK_INDICATOR; }); return !!result; } @@ -1782,7 +1779,7 @@ return isObject(value) ? value : Object(value); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates an array with all falsey values removed. The values `false`, `null`, @@ -2508,7 +2505,7 @@ return result; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object that wraps `value` with explicit method @@ -2613,7 +2610,7 @@ return this.__wrapped__; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Checks if `value` is present in `collection` using `SameValueZero` for @@ -3651,7 +3648,7 @@ return filter(collection, matches(source)); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes @@ -3678,7 +3675,13 @@ */ function after(n, func) { if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); + if (isFunction(n)) { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } } n = nativeIsFinite(n = +n) ? n : 0; return function() { @@ -3706,7 +3709,13 @@ function before(n, func) { var result; if (!isFunction(func)) { - throw new TypeError(FUNC_ERROR_TEXT); + if (isFunction(n)) { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } } return function() { if (--n > 0) { @@ -4263,7 +4272,531 @@ return basePartial(wrapper, PARTIAL_FLAG, [value], []); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + + /** + * 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 + * 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). + * + * **Note:** This method is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See the [HTML5 specification](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {*} Returns the cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var shallow = _.clone(characters); + * shallow[0] === characters[0]; + * // => true + * + * var deep = _.clone(characters, true); + * deep[0] === characters[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value) { + return isObject(value) + ? (isArray(value) ? baseSlice(value) : assign({}, value)) + : value; + } + + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + 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 + if (!isArguments(arguments)) { + isArguments = function(value) { + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; + }; + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * (function() { return _.isArray(arguments); })(); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass) || false; + }; + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return (value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass) || false; + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return (value && value.nodeType === 1) || false; + } + + /** + * Checks if a collection is empty. A value is considered empty unless it is + * an array-like value with a length greater than `0` or an object with own + * enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + var length = value.length; + if ((typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER) && + (isArray(value) || isString(value) || isArguments(value))) { + return !length; + } + return !keys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * 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). + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. Provide a customizer function to extend support + * for comparing other values. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare to `other`. + * @param {*} other The value to compare to `value`. + * @param {Function} [customizer] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var other = { 'name': 'fred' }; + * + * object == other; + * // => false + * + * _.isEqual(object, other); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function() { + * return _.every(arguments, _.bind(RegExp.prototype.test, /^h(?:i|ello)$/)) || undefined; + * }); + * // => true + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on ES6 `Number.isFinite`. See the + * [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(10); + * // => true + * + * _.isFinite('10'); + * // => false + * + * _.isFinite(true); + * // => false + * + * _.isFinite(Object(10)); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + value = parseFloat(nativeIsFinite(value) && value); + return value == value; + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // avoid a Chakra bug in IE 11 + // https://github.com/jashkenas/underscore/issues/1621 + return typeof value == 'function' || false; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value == 'function' && toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // avoid a V8 bug in Chrome 19-20 + // https://code.google.com/p/v8/issues/detail?id=2291 + var type = typeof value; + return type == 'function' || (value && type == 'object') || false; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is not the same as native `isNaN` which returns `true` + * for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4) + * for more details. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the `[[Class]]` check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isFunction(value)) { + return reNative.test(fnToString.call(value)); + } + return (value && typeof value == 'object' && reHostCtor.test(value)) || false; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(8.4); + * // => true + * + * _.isNumber(NaN); + * // => true + * + * _.isNumber('8.4'); + * // => false + */ + function isNumber(value) { + var type = typeof value; + return type == 'number' || + (value && type == 'object' && toString.call(value) == numberClass) || false; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return (isObject(value) && toString.call(value) == regexpClass) || false; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (value && typeof value == 'object' && toString.call(value) == stringClass) || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /*------------------------------------------------------------------------*/ /** * Assigns own enumerable properties of source object(s) to the destination @@ -4311,58 +4844,6 @@ return object; } - /** - * 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 - * 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). - * - * **Note:** This method is loosely based on the structured clone algorithm. Functions - * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and - * objects created by constructors other than `Object` are cloned to plain `Object` objects. - * See the [HTML5 specification](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to clone. - * @param {boolean} [isDeep=false] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the cloned value. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * var shallow = _.clone(characters); - * shallow[0] === characters[0]; - * // => true - * - * var deep = _.clone(characters, true); - * deep[0] === characters[0]; - * // => false - * - * _.mixin({ - * 'clone': _.partialRight(_.clone, function(value) { - * return _.isElement(value) ? value.cloneNode(false) : undefined; - * }) - * }); - * - * var clone = _.clone(document.body); - * clone.childNodes.length; - * // => 0 - */ - function clone(value) { - return isObject(value) - ? (isArray(value) ? baseSlice(value) : assign({}, value)) - : value; - } - /** * Assigns own enumerable properties of source object(s) to the destination * object for all destination properties that resolve to `undefined`. Once a @@ -4481,469 +4962,6 @@ return result; } - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - 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 - if (!isArguments(arguments)) { - isArguments = function(value) { - var length = (value && typeof value == 'object') ? value.length : undefined; - return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; - }; - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * (function() { return _.isArray(arguments); })(); - * // => false - */ - var isArray = nativeIsArray || function(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass) || false; - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return (value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass) || false; - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return (value && value.nodeType === 1) || false; - } - - /** - * Checks if a collection is empty. A value is considered empty unless it is - * an array-like value with a length greater than `0` or an object with own - * enumerable properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - var length = value.length; - if ((typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER) && - (isArray(value) || isString(value) || isArguments(value))) { - return !length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * 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). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to compare to `other`. - * @param {*} other The value to compare to `value`. - * @param {Function} [customizer] The function to customize comparing values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'name': 'fred' }; - * var other = { 'name': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * var words = ['hello', 'goodbye']; - * var otherWords = ['hi', 'goodbye']; - * - * _.isEqual(words, otherWords, function() { - * return _.every(arguments, _.bind(RegExp.prototype.test, /^h(?:i|ello)$/)) || undefined; - * }); - * // => true - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on ES6 `Number.isFinite`. See the - * [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - value = parseFloat(nativeIsFinite(value) && value); - return value == value; - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // avoid a Chakra bug in IE 11 - // https://github.com/jashkenas/underscore/issues/1621 - return typeof value == 'function' || false; - } - // fallback for older versions of Chrome and Safari - if (isFunction(/x/)) { - isFunction = function(value) { - return typeof value == 'function' && toString.call(value) == funcClass; - }; - } - - /** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // avoid a V8 bug in Chrome 19-20 - // https://code.google.com/p/v8/issues/detail?id=2291 - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as native `isNaN` which returns `true` - * for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // `NaN` as a primitive is the only value that is not equal to itself - // (perform the `[[Class]]` check first to avoid errors with some host objects in IE) - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - */ - function isNative(value) { - if (isFunction(value)) { - return reNative.test(fnToString.call(value)); - } - return (value && typeof value == 'object' && reHostCtor.test(value)) || false; - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - var type = typeof value; - return type == 'number' || - (value && type == 'object' && toString.call(value) == numberClass) || false; - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return (isObject(value) && toString.call(value) == regexpClass) || false; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (value && typeof value == 'object' && toString.call(value) == stringClass) || false; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Object - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return typeof value == 'undefined'; - } - /** * Creates an array of the own enumerable property names of `object`. * @@ -5129,7 +5147,7 @@ return baseValues(object, keys); } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to @@ -5355,7 +5373,7 @@ : string; } - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught @@ -5849,13 +5867,7 @@ return prefix ? prefix + id : id; } - /*--------------------------------------------------------------------------*/ - - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - // assign default placeholders - bind.placeholder = partial.placeholder = lodash; + /*------------------------------------------------------------------------*/ // add functions that return wrapped values when chaining lodash.after = after; @@ -5926,7 +5938,7 @@ lodash.tail = rest; lodash.unique = uniq; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions that return unwrapped values when chaining lodash.clone = clone; @@ -5983,12 +5995,12 @@ lodash.include = contains; lodash.inject = reduce; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions capable of returning wrapped and unwrapped values when chaining lodash.sample = sample; - /*--------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ // add functions to `lodash.prototype` mixin(assign({}, lodash)); @@ -6002,10 +6014,16 @@ */ lodash.VERSION = VERSION; + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; lodash.prototype.value = wrapperValueOf; + // assign default placeholders + partial.placeholder = lodash; + // add `Array` mutator functions to the wrapper arrayEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayProto[methodName]; diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 4664e881d..89ddbc85a 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,43 +3,43 @@ * Lo-Dash 3.0.0-pre (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE * Build: `lodash underscore -o ./dist/lodash.underscore.js` */ -;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(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>Ur)return x(n,r,Dt);for(var e=-1,u=V(n);++e=t||t>Ur){for(var t=Dt(n),e=t.length;e--;){var u=t[e];if(r(n[u],u,n)===$r)break}return n}for(e=V(n);t--&&r(e[t],t,e)!==$r;);return n}function d(n,r){var t=true;return b(n,function(n,e,u){return(t=!!r(n,e,u))||$r -}),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,$r):void 0}),e}function A(n,r,t,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++ee(i,a)&&(r&&i.push(a),o.push(f))}return o}function B(n,r){return function(t,e,u){var o=r?r():{};if(e=v(e,u,3),Wt(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?Ot(u+e,0):e||0;else if(e)return e=L(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function J(n,r,t){return K(n,null==r||t?1:0>r?0:r)}function K(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,f=t(n[i]),a=fu&&(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 ur(n,r){return tr(n,Ir(r))}function or(n,r,t,e){return(Wt(n)?s:F)(n,v(r,e,4),t,3>arguments.length,b)}function ir(n,r,t,e){return(Wt(n)?g:F)(n,v(r,e,4),t,3>arguments.length,_)}function fr(n){n=V(n);for(var r=-1,t=n.length,e=Array(t);++rarguments.length?W(n,Mr,r):S(n,Mr|Br,K(arguments,2),[],r)}function pr(n,r,t){function e(){var t=r-(zt()-c);0>=t||t>r?(f&&clearTimeout(f),t=s,f=p=s=Fr,t&&(g=zt(),a=n.apply(l,i),p||f||(i=l=null))):p=setTimeout(e,t)}function u(){p&&clearTimeout(p),f=p=s=Fr,(v||h!==r)&&(g=zt(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=zt(),l=this,s=v&&(p||!y),false===h)var t=y&&!p; -else{f||y||(g=c);var o=h-(c-g),m=0>=o||o>h;m?(f&&(f=clearTimeout(f)),g=c,a=n.apply(l,i)):f||(f=setTimeout(u,o))}return m&&p?p=clearTimeout(p):p||r===h||(p=setTimeout(e,r)),t&&(m=true,a=n.apply(l,i)),!m||p||f||(i=l=null),a}var i,f,a,c,l,p,s,g=0,h=false,v=true;if(!br(n))throw new TypeError(Nr);if(r=0>r?0:r,true===t)var y=true,v=false;else _r(t)&&(y=t.leading,h="maxWait"in t&&Ot(+t.maxWait||0,r),v="trailing"in t?t.trailing:v);return o.cancel=function(){p&&clearTimeout(p),f&&clearTimeout(f),f=p=s=Fr},o}function sr(n){for(var r=K(arguments,1),t=r,e=sr.placeholder,u=-1,o=t.length,i=-1,f=[];++u"'`]/g,Pr=/^\[object .+?Constructor\]$/,Vr=/($^)/,Gr=/[.*+?^${}()|[\]\/\\]/g,Hr=/['\n\r\u2028\u2029\\]/g,Jr="[object Arguments]",Kr="[object Boolean]",Lr="[object Date]",Qr="[object Error]",Xr="[object Number]",Yr="[object Object]",Zr="[object RegExp]",nt="[object String]",rt={}; -rt[Jr]=rt["[object Array]"]=rt["[object Float32Array]"]=rt["[object Float64Array]"]=rt["[object Int8Array]"]=rt["[object Int16Array]"]=rt["[object Int32Array]"]=rt["[object Uint8Array]"]=rt["[object Uint8ClampedArray]"]=rt["[object Uint16Array]"]=rt["[object Uint32Array]"]=true,rt["[object ArrayBuffer]"]=rt[Kr]=rt[Lr]=rt[Qr]=rt["[object Function]"]=rt["[object Map]"]=rt[Xr]=rt[Yr]=rt[Zr]=rt["[object Set]"]=rt[nt]=rt["[object WeakMap]"]=false;var tt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},et={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},ut={"function":true,object:true},ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},it=ut[typeof window]&&window||this,ft=ut[typeof exports]&&exports&&!exports.nodeType&&exports,at=ut[typeof module]&&module&&!module.nodeType&&module,ct=ft&&at&&typeof global=="object"&&global; -!ct||ct.global!==ct&&ct.window!==ct&&ct.self!==ct||(it=ct);var lt=at&&at.exports===ft&&ft,pt=Array.prototype,st=Object.prototype,gt=Function.prototype.toString,ht=st.hasOwnProperty,vt=it._,yt=st.toString,mt=RegExp("^"+function(n){return n=null==n?"":n+"",Gr.lastIndex=0,Gr.test(n)?n.replace(Gr,"\\$&"):n}(yt).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bt=Math.ceil,_t=Math.floor,dt=pt.push,jt=st.propertyIsEnumerable,wt=pt.splice,At=dr(At=Object.create)&&At,xt=dr(xt=Array.isArray)&&xt,Tt=it.isFinite,Et=dr(Et=Object.keys)&&Et,Ot=Math.max,kt=Math.min,St=dr(St=Date.now)&&St,It=Math.random,Ft={}; -!function(){var n={0:1,length:1};Ft.spliceObjects=(wt.call(n,0,1),!n[0])}(0,0),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},At||(y=function(){function n(){}return function(r){if(_r(r)){n.prototype=r;var t=new n;n.prototype=null}return t||it.Object()}}());var Mt=J,qt=G,Bt=B(function(n,r,t){ht.call(n,t)?++n[t]:n[t]=1}),$t=B(function(n,r,t){ht.call(n,t)?n[t].push(r):n[t]=[r]}),Nt=B(function(n,r,t){n[t]=r}),Rt=B(function(n,r,t){n[t?0:1].push(r) -},function(){return[[],[]]}),Ut=sr(cr,2);yr(arguments)||(yr=function(n){var r=n&&typeof n=="object"?n.length:Fr;return typeof r=="number"&&-1--n?r.apply(this,arguments):void 0}},i.before=cr,i.bind=lr,i.bindAll=function(n){for(var r=n,t=1r?0:r)},i.intersection=function(){for(var n=[],r=-1,t=arguments.length;++ri(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},i.invert=function(n){for(var r=-1,t=Dt(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=qt,i.tap=function(n,r){return r(n),n},i.throttle=function(n,r,t){var e=true,u=true;if(!br(n))throw new TypeError(funcErrorText);return false===t?e=false:_r(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),pr(n,r,{leading:e,maxWait:r,trailing:u})},i.times=function(n,r,t){n=Tt(n=+n)&&-1r)return function(){};if(!c(n,br))throw new TypeError(Nr);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},i.each=rr,i.extend=gr,i.iteratee=function(n,r){return v(n,r)},i.methods=vr,i.object=function(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||Wt(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?Ot(e+t,0):kt(t||0,e-1))+1);e--;)if(n[e]===r)return e;return-1},i.max=er,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=V(n),o=n.length;++tr?0:+r||0,n.length),n) -},Sr(gr({},i)),i.VERSION="3.0.0-pre",i.prototype.chain=function(){return this.__chain__=true,this},i.prototype.value=function(){return this.__wrapped__},a("pop push reverse shift sort splice unshift".split(" "),function(n){var r=pt[n];i.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Ft.spliceObjects||0!==n.length||delete n[0],this}}),a(["concat","join","slice"],function(n){var r=pt[n];i.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new f(n),n.__chain__=true),n -}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(it._=i, define("underscore",function(){return i})):ft&&at?lt?(at.exports=i)._=i:ft._=i:it._=i}).call(this); \ No newline at end of file +;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(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>Rr)return x(n,r,Wt);for(var e=-1,u=V(n);++e=t||t>Rr){for(var t=Wt(n),e=t.length;e--;){var u=t[e];if(r(n[u],u,n)===Fr)break}return n}for(e=V(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,a)&&(r&&i.push(a),o.push(f))}return o}function B(n,r){return function(t,e,u){var o=r?r():{};if(e=v(e,u,3),Ut(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?Et(u+e,0):e||0;else if(e)return e=L(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function J(n,r,t){return K(n,null==r||t?1:0>r?0:r)}function K(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,f=t(n[i]),a=fu&&(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 ur(n,r){return tr(n,Sr(r))}function or(n,r,t,e){return(Ut(n)?s:F)(n,v(r,e,4),t,3>arguments.length,b)}function ir(n,r,t,e){return(Ut(n)?g:F)(n,v(r,e,4),t,3>arguments.length,_)}function fr(n){n=V(n);for(var r=-1,t=n.length,e=Array(t);++r=t||t>r?(f&&clearTimeout(f),t=s,f=p=s=Ir,t&&(g=Dt(),a=n.apply(l,i),p||f||(i=l=null))):p=setTimeout(e,t)}function u(){p&&clearTimeout(p),f=p=s=Ir,(v||h!==r)&&(g=Dt(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=Dt(),l=this,s=v&&(p||!y),false===h)var t=y&&!p;else{f||y||(g=c);var o=h-(c-g),m=0>=o||o>h; +m?(f&&(f=clearTimeout(f)),g=c,a=n.apply(l,i)):f||(f=setTimeout(u,o))}return m&&p?p=clearTimeout(p):p||r===h||(p=setTimeout(e,r)),t&&(m=true,a=n.apply(l,i)),!m||p||f||(i=l=null),a}var i,f,a,c,l,p,s,g=0,h=false,v=true;if(!hr(n))throw new TypeError($r);if(r=0>r?0:r,true===t)var y=true,v=false;else vr(t)&&(y=t.leading,h="maxWait"in t&&Et(+t.maxWait||0,r),v="trailing"in t?t.trailing:v);return o.cancel=function(){p&&clearTimeout(p),f&&clearTimeout(f),f=p=s=Ir},o}function pr(n){for(var r=K(arguments,1),t=r,e=pr.placeholder,u=-1,o=t.length,i=-1,f=[];++u"'`]/g,Cr=/^\[object .+?Constructor\]$/,Pr=/($^)/,Vr=/[.*+?^${}()|[\]\/\\]/g,Gr=/['\n\r\u2028\u2029\\]/g,Hr="[object Arguments]",Jr="[object Boolean]",Kr="[object Date]",Lr="[object Error]",Qr="[object Number]",Xr="[object Object]",Yr="[object RegExp]",Zr="[object String]",nt={}; +nt[Hr]=nt["[object Array]"]=nt["[object Float32Array]"]=nt["[object Float64Array]"]=nt["[object Int8Array]"]=nt["[object Int16Array]"]=nt["[object Int32Array]"]=nt["[object Uint8Array]"]=nt["[object Uint8ClampedArray]"]=nt["[object Uint16Array]"]=nt["[object Uint32Array]"]=true,nt["[object ArrayBuffer]"]=nt[Jr]=nt[Kr]=nt[Lr]=nt["[object Function]"]=nt["[object Map]"]=nt[Qr]=nt[Xr]=nt[Yr]=nt["[object Set]"]=nt[Zr]=nt["[object WeakMap]"]=false;var rt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},tt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},et={"function":true,object:true},ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=et[typeof window]&&window||this,it=et[typeof exports]&&exports&&!exports.nodeType&&exports,ft=et[typeof module]&&module&&!module.nodeType&&module,at=it&&ft&&typeof global=="object"&&global; +!at||at.global!==at&&at.window!==at&&at.self!==at||(ot=at);var ct=ft&&ft.exports===it&&it,lt=Array.prototype,pt=Object.prototype,st=Function.prototype.toString,gt=pt.hasOwnProperty,ht=ot._,vt=pt.toString,yt=RegExp("^"+function(n){return n=null==n?"":n+"",Vr.lastIndex=0,Vr.test(n)?n.replace(Vr,"\\$&"):n}(vt).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=Math.ceil,bt=Math.floor,_t=lt.push,dt=pt.propertyIsEnumerable,jt=lt.splice,wt=yr(wt=Object.create)&&wt,At=yr(At=Array.isArray)&&At,xt=ot.isFinite,Tt=yr(Tt=Object.keys)&&Tt,Et=Math.max,Ot=Math.min,kt=yr(kt=Date.now)&&kt,St=Math.random,It={}; +!function(){var n={0:1,length:1};It.spliceObjects=(jt.call(n,0,1),!n[0])}(0,0),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},wt||(y=function(){function n(){}return function(r){if(vr(r)){n.prototype=r;var t=new n;n.prototype=null}return t||ot.Object()}}());var Ft=J,Mt=G,qt=B(function(n,r,t){gt.call(n,t)?++n[t]:n[t]=1}),Bt=B(function(n,r,t){gt.call(n,t)?n[t].push(r):n[t]=[r]}),$t=B(function(n,r,t){n[t]=r}),Nt=B(function(n,r,t){n[t?0:1].push(r) +},function(){return[[],[]]}),Rt=pr(cr,2);sr(arguments)||(sr=function(n){var r=n&&typeof n=="object"?n.length:Ir;return typeof r=="number"&&-1--n?r.apply(this,arguments):void 0}},i.before=cr,i.bind=function(n,r){return 3>arguments.length?W(n,Mr,r):S(n,Mr|Br,K(arguments,2),[],r)},i.bindAll=function(n){for(var r=n,t=1r?0:r)},i.intersection=function(){for(var n=[],r=-1,t=arguments.length;++ri(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},i.invert=function(n){for(var r=-1,t=Wt(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=Mt,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),lr(n,r,{leading:e,maxWait:r,trailing:u}) +},i.times=function(n,r,t){n=xt(n=+n)&&-1r)return function(){};if(!c(n,hr))throw new TypeError($r);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},i.each=rr,i.extend=_r,i.iteratee=function(n,r){return v(n,r)},i.methods=jr,i.object=function(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||Ut(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?Et(e+t,0):Ot(t||0,e-1))+1);e--;)if(n[e]===r)return e;return-1},i.max=er,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=V(n),o=n.length;++tr?0:+r||0,n.length),n) +},kr(_r({},i)),i.VERSION="3.0.0-pre",f.prototype=i.prototype,i.prototype.chain=function(){return this.__chain__=true,this},i.prototype.value=function(){return this.__wrapped__},pr.placeholder=i,a("pop push reverse shift sort splice unshift".split(" "),function(n){var r=lt[n];i.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),It.spliceObjects||0!==n.length||delete n[0],this}}),a(["concat","join","slice"],function(n){var r=lt[n];i.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments); +return this.__chain__&&(n=new f(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ot._=i, define("underscore",function(){return i})):it&&ft?ct?(ft.exports=i)._=i:it._=i:ot._=i}).call(this); \ No newline at end of file