From d77e4ed581191eb512512ecece5b4d649a6b31af Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 7 Jun 2013 08:39:08 -0700 Subject: [PATCH] Rebuild files and docs. Former-commit-id: 1e3b1e236e15e4248247a4b20288ab2e153ce753 --- dist/lodash.compat.js | 572 +++++++++++++++++----------------- dist/lodash.compat.min.js | 89 +++--- dist/lodash.js | 531 ++++++++++++++++--------------- dist/lodash.min.js | 80 ++--- dist/lodash.underscore.js | 174 ++++++----- dist/lodash.underscore.min.js | 52 ++-- doc/README.md | 254 +++++++-------- 7 files changed, 894 insertions(+), 858 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 3f39222de..5dbb115d7 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -147,6 +147,166 @@ '\u2029': 'u2029' }; + /*--------------------------------------------------------------------------*/ + + /** + * A basic implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + */ + function basicIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * An implementation of `_.contains` for cache objects that mimics the return + * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache object to inspect. + * @param {Mixed} value The value to search for. + * @returns {Number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var type = typeof value; + cache = cache.cache; + + if (type == 'boolean' || value == null) { + return cache[value]; + } + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value; + cache = cache[type] || (cache[type] = {}); + + return type == 'object' + ? (cache[key] && basicIndexOf(cache[key], value) > -1 ? 0 : -1) + : (cache[key] ? 0 : -1); + } + + /** + * Adds a given `value` to the corresponding cache object. + * + * @private + * @param {Mixed} value The value to add to the cache. + */ + function cachePush(value) { + var cache = this.cache, + type = typeof value; + + if (type == 'boolean' || value == null) { + cache[value] = true; + } else { + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value, + typeCache = cache[type] || (cache[type] = {}); + + if (type == 'object') { + if ((typeCache[key] || (typeCache[key] = [])).push(value) == this.array.length) { + cache[type] = false; + } + } else { + typeCache[key] = true; + } + } + } + + /** + * Used by `_.max` and `_.min` as the default `callback` when a given + * `collection` is a string value. + * + * @private + * @param {String} value The character to inspect. + * @returns {Number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || typeof a == 'undefined') { + return 1; + } + if (a < b || typeof b == 'undefined') { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Creates a cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [array=[]] The array to search. + * @returns {Null|Object} Returns the cache object or `null` if caching should not be used. + */ + function createCache(array) { + var index = -1, + length = array.length; + + var cache = getObject(); + cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; + + var result = getObject(); + result.array = array; + result.cache = cache; + result.push = cachePush; + + while (++index < length) { + result.push(array[index]); + } + return cache.object === false + ? (releaseObject(result), null) + : result; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + /** * Gets an array from the array pool or creates a new one if the pool is empty. * @@ -167,23 +327,17 @@ return objectPool.pop() || { 'args': null, 'array': null, - 'arrays': null, 'bottom': null, - 'contains': null, 'criteria': null, 'false': null, 'firstArg': null, - 'function': null, 'index': null, - 'indexOf': null, 'init': null, - 'initedArray': null, 'loop': null, 'null': null, 'number': null, 'object': null, 'push': null, - 'release': null, 'shadowedProps': null, 'string': null, 'top': null, @@ -195,6 +349,28 @@ }; } + /** + * Checks if `value` is a DOM node in IE < 9. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a DOM node, else `false`. + */ + function isNode(value) { + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + /** * Releases the given `array` back to the array pool. * @@ -216,6 +392,10 @@ * @param {Object} [object] The object to release. */ function releaseObject(object) { + var cache = object.cache; + if (cache) { + releaseObject(cache); + } if (objectPool.length == maxPoolSize) { objectPool.length = maxPoolSize - 1; } @@ -223,6 +403,34 @@ objectPool.push(object); } + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used, instead of `Array#slice`, to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|String} collection The collection to slice. + * @param {Number} start The start index. + * @param {Number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + /*--------------------------------------------------------------------------*/ /** @@ -401,6 +609,19 @@ : new lodashWrapper(value); } + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value) { + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + /** * An object used to flag environments features. * @@ -612,9 +833,9 @@ ';\nif (!iterable) return result;\n' + (obj.top) + ';'; - if (obj.arrays) { + if (obj.array) { __p += '\nvar length = iterable.length; index = -1;\nif (' + - (obj.arrays) + + (obj.array) + ') { '; if (support.unindexedChars) { __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; @@ -684,7 +905,7 @@ } - if (obj.arrays || support.nonEnumArgs) { + if (obj.array || support.nonEnumArgs) { __p += '\n}'; } __p += @@ -712,81 +933,18 @@ var eachIteratorOptions = { 'args': 'collection, callback, thisArg', 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg)", - 'arrays': "typeof length == 'number'", + 'array': "typeof length == 'number'", 'loop': 'if (callback(iterable[index], index, collection) === false) return result' }; /** Reusable iterator options for `forIn` and `forOwn` */ var forOwnIteratorOptions = { 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, - 'arrays': false + 'array': false }; /*--------------------------------------------------------------------------*/ - /** - * A basic version of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. - * - * @private - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to search from. - * @returns {Number} Returns the index of the matched value or `-1`. - */ - function basicIndexOf(array, value, fromIndex) { - var index = (fromIndex || 0) - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Used by `_.max` and `_.min` as the default `callback` when a given - * `collection` is a string value. - * - * @private - * @param {String} value The character to inspect. - * @returns {Number} Returns the code unit of given character. - */ - function charAtCallback(value) { - return value.charCodeAt(0); - } - - /** - * Used by `sortBy` to compare transformed `collection` values, stable sorting - * them in ascending order. - * - * @private - * @param {Object} a The object to compare to `b`. - * @param {Object} b The object to compare to `a`. - * @returns {Number} Returns the sort order indicator of `1` or `-1`. - */ - function compareAscending(a, b) { - var ai = a.index, - bi = b.index; - - a = a.criteria; - b = b.criteria; - - // ensure a stable sort in V8 and other engines - // http://code.google.com/p/v8/issues/detail?id=90 - if (a !== b) { - if (a > b || typeof a == 'undefined') { - return 1; - } - if (a < b || typeof b == 'undefined') { - return -1; - } - } - return ai < bi ? -1 : 1; - } - /** * Creates a function that, when called, invokes `func` with the `this` binding * of `thisArg` and prepends any `partialArgs` to the arguments passed to the @@ -845,115 +1003,12 @@ return bound; } - /** - * Creates a function optimized to search large arrays for a given `value`, - * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. - * - * @private - * @param {Array} [array=[]] The array to search. - * @param {Mixed} value The value to search for. - * @returns {Boolean} Returns `true`, if `value` is found, else `false`. - */ - var createCache = (function() { - - function basicContains(value) { - return this.indexOf(this.array, value) > -1; - } - - function basicPush(value) { - this.array.push(value); - } - - function cacheContains(value) { - var cache = this.cache, - type = typeof value; - - if (type == 'boolean' || value == null) { - return cache[value]; - } - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value; - cache = cache[type] || (cache[type] = {}); - - return type == 'object' - ? (cache[key] ? basicIndexOf(cache[key], value) > -1 : false) - : !!cache[key]; - } - - function cachePush(value) { - var cache = this.cache, - type = typeof value; - - if (type == 'boolean' || value == null) { - cache[value] = true; - } else { - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value; - cache = cache[type] || (cache[type] = {}); - - if (type == 'object') { - bailout = (cache[key] || (cache[key] = [])).push(value) == length; - } else { - cache[key] = true; - } - } - } - - function release() { - var cache = this.cache; - if (cache.initedArray) { - releaseArray(this.array); - } - releaseObject(cache); - } - - return function(array) { - var bailout, - index = -1, - indexOf = getIndexOf(), - initedArray = !array && (array = getArray()), - length = array.length, - isLarge = length >= largeArraySize && lodash.indexOf !== indexOf; - - var cache = getObject(); - cache.initedArray = initedArray; - cache['false'] = cache['function'] = cache['null'] = cache['true'] = cache['undefined'] = false; - - var result = getObject(); - result.array = array; - result.cache = cache; - result.contains = cacheContains; - result.indexOf = indexOf; - result.push = cachePush; - result.release = release; - - if (isLarge) { - while (++index < length) { - result.push(array[index]); - } - if (bailout) { - isLarge = false; - result.release(); - } - } - if (!isLarge) { - result.contains = basicContains; - result.push = basicPush; - } - return result; - }; - }()); - /** * Creates compiled iteration functions. * * @private * @param {Object} [options1, options2, ...] The compile options object(s). - * arrays - A string of code to determine if the iterable is an array or array-like. + * array - A string of code to determine if the iterable is an array or array-like. * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. * useKeys - A boolean to specify using `_.keys` for own property iteration. * args - A string of comma separated arguments the iteration function will accept. @@ -968,7 +1023,7 @@ // data properties data.shadowedProps = shadowedProps; // iterator options - data.arrays = data.bottom = data.loop = data.top = ''; + data.array = data.bottom = data.loop = data.top = ''; data.init = 'iterable'; data.useHas = true; data.useKeys = !!keys; @@ -1033,18 +1088,6 @@ return htmlEscapes[match]; } - /** - * Used by `template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeStringChar(match) { - return '\\' + stringEscapes[match]; - } - /** * Gets the appropriate "indexOf" function. If the `_.indexOf` method is * customized, this method returns the custom method, otherwise it returns @@ -1058,41 +1101,6 @@ return result; } - /** - * Checks if `value` is a DOM node in IE < 9. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a DOM node, else `false`. - */ - function isNode(value) { - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings - return typeof value.toString != 'function' && typeof (value + '') == 'string'; - } - - /** - * A fast path for creating `lodash` wrapper objects. - * - * @private - * @param {Mixed} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - */ - function lodashWrapper(value) { - this.__wrapped__ = value; - } - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - /** * Creates a function that juggles arguments, allowing argument overloading * for `_.flatten` and `_.uniq`, before passing them to the given `func`. @@ -1156,34 +1164,6 @@ return result === undefined || hasOwnProperty.call(value, result); } - /** - * Slices the `collection` from the `start` index up to, but not including, - * the `end` index. - * - * Note: This function is used, instead of `Array#slice`, to support node lists - * in IE < 9 and to ensure dense arrays are returned. - * - * @private - * @param {Array|Object|String} collection The collection to slice. - * @param {Number} start The start index. - * @param {Number} end The end index. - * @returns {Array} Returns the new array. - */ - function slice(array, start, end) { - start || (start = 0); - if (typeof end == 'undefined') { - end = array ? array.length : 0; - } - var index = -1, - length = end - start || 0, - result = Array(length < 0 ? 0 : length); - - while (++index < length) { - result[index] = array[start + index]; - } - return result; - } - /** * Used by `unescape` to convert HTML entities to characters. * @@ -1500,7 +1480,7 @@ * `undefined`, cloning will be handled by the method instead. The `callback` * is bound to `thisArg` and invoked with one argument; (value). * - * Note: This function is loosely based on the structured clone algorithm. Functions + * 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 http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. @@ -3657,18 +3637,31 @@ */ function difference(array) { var index = -1, + indexOf = getIndexOf(), length = array ? array.length : 0, - flattened = concat.apply(arrayProto, nativeSlice.call(arguments, 1)), - cache = createCache(flattened), + seen = concat.apply(arrayProto, nativeSlice.call(arguments, 1)), result = []; + var isLarge = length >= largeArraySize && indexOf === basicIndexOf; + + if (isLarge) { + var cache = createCache(seen); + if (cache) { + indexOf = cacheIndexOf; + seen = cache; + } else { + isLarge = false; + } + } while (++index < length) { var value = array[index]; - if (!cache.contains(value)) { + if (indexOf(seen, value) < 0) { result.push(value); } } - cache.release(); + if (isLarge) { + releaseObject(seen); + } return result; } @@ -3972,24 +3965,31 @@ function intersection(array) { var args = arguments, argsLength = args.length, + argsIndex = -1, + caches = getArray(), index = -1, + indexOf = getIndexOf(), length = array ? array.length : 0, - result = []; - - var caches = getArray(); - caches[0] = createCache(); + result = [], + seen = getArray(); + while (++argsIndex < argsLength) { + var value = args[argsIndex]; + caches[argsIndex] = indexOf === basicIndexOf && + (value ? value.length : 0) >= largeArraySize && + createCache(argsIndex ? args[argsIndex] : seen); + } outer: while (++index < length) { - var cache = caches[0], - value = array[index]; + var cache = caches[0]; + value = array[index]; - if (!cache.contains(value)) { - var argsIndex = argsLength; - cache.push(value); + if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { + argsIndex = argsLength; + (cache || seen).push(value); while (--argsIndex) { - cache = caches[argsIndex] || (caches[argsIndex] = createCache(args[argsIndex])); - if (!cache.contains(value)) { + cache = caches[argsIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { continue outer; } } @@ -3997,9 +3997,13 @@ } } while (argsLength--) { - caches[argsLength].release(); + cache = caches[argsLength]; + if (cache) { + releaseObject(cache); + } } releaseArray(caches); + releaseArray(seen); return result; } @@ -4371,17 +4375,28 @@ var index = -1, indexOf = getIndexOf(), length = array ? array.length : 0, - isLarge = !isSorted && length >= largeArraySize && lodash.indexOf !== indexOf, - result = [], - seen = isLarge ? createCache() : (callback ? getArray() : result); + result = []; + var isLarge = !isSorted && length >= largeArraySize && indexOf === basicIndexOf, + seen = (callback || isLarge) ? getArray() : result; + + if (isLarge) { + var cache = createCache(seen); + if (cache) { + indexOf = cacheIndexOf; + seen = cache; + } else { + isLarge = false; + seen = callback ? seen : (releaseArray(seen), result); + } + } while (++index < length) { var value = array[index], computed = callback ? callback(value, index, array) : value; if (isSorted ? !index || seen[seen.length - 1] !== computed - : (isLarge ? !seen.contains(computed) : indexOf(seen, computed) < 0) + : indexOf(seen, computed) < 0 ) { if (callback || isLarge) { seen.push(computed); @@ -4390,7 +4405,8 @@ } } if (isLarge) { - seen.release(); + releaseArray(seen.array); + releaseObject(seen); } else if (callback) { releaseArray(seen); } @@ -5114,7 +5130,7 @@ } /** - * This function returns the first argument passed to it. + * This method returns the first argument passed to it. * * @static * @memberOf _ @@ -5163,7 +5179,7 @@ push.apply(args, arguments); var result = func.apply(lodash, args); - return (value && typeof value == 'object' && value == result) + return (value && typeof value == 'object' && value === result) ? this : new lodashWrapper(result); }; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index c6a7d5f26..895eb593f 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,47 +4,48 @@ * Build: `lodash -o ./dist/lodash.compat.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;!function(n){function t(){return g.pop()||[]}function r(){return h.pop()||{a:l,k:l,b:l,c:l,m:l,n:l,"false":l,d:l,"function":l,o:l,p:l,e:l,q:l,f:l,"null":l,number:l,object:l,push:l,r:l,g:l,string:l,h:l,"true":l,undefined:l,i:l,j:l,s:l}}function e(n){g.length==b&&(g.length=b-1),n.length=0,g.push(n)}function u(n){h.length==b&&(h.length=b-1),n.k=n.l=n.n=n.object=n.t=n.u=n.s=l,h.push(n)}function o(f){function s(n){return n&&typeof n=="object"&&!Fr(n)&&fr.call(n,"__wrapped__")?n:new et(n)}function g(n,t,r){r=(r||0)-1; -for(var e=n.length;++rt||typeof n=="undefined")return 1;if(nk;k++)o+="m='"+n.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",n.i||(o+="||(!v[m]&&r[m]!==y[m])"),o+="){"+n.f+"}"; -o+="}"}return(n.b||Br.nonEnumArgs)&&(o+="}"),o+=n.c+";return C",t=t("i,j,l,n,o,q,t,u,y,z,w,G,H,J",e+o+"}"),u(n),t(T,Zt,fr,ct,Fr,yt,Dr,s,nr,U,Ir,K,tr,vr)}function Y(n){return vt(n)?yr(n):{}}function Z(n){return Tr[n]}function nt(n){return"\\"+V[n]}function tt(){var n=(n=s.indexOf)===Nt?g:n;return n}function rt(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function et(n){this.__wrapped__=n}function ut(){}function ot(n){return function(t,r,e,u){return typeof r!="boolean"&&r!=l&&(u=e,e=u&&u[r]===t?a:r,r=c),e!=l&&(e=s.createCallback(e,u)),n(t,r,e,u) -}}function at(n){var t,r;return!n||vr.call(n)!=H||(t=n.constructor,ht(t)&&!(t instanceof t))||!Br.argsClass&&ct(n)||!Br.nodeClass&&rt(n)?c:Br.ownLast?(Jr(n,function(n,t,e){return r=fr.call(e,t),c}),r!==false):(Jr(n,function(n,t){r=t}),r===a||fr.call(n,r))}function it(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Gt(0>r?0:r);++er?jr(0,o+r):r)||0,o&&typeof o=="number"?a=-1<(yt(n)?n.indexOf(t,r):u(n,t,r)):Rr(n,function(n){return++eu&&(u=a)}}else t=!t&&yt(n)?h:s.createCallback(t,r),Rr(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function Et(n,t,r,e){var u=3>arguments.length;if(t=s.createCallback(t,e,4),Fr(n)){var o=-1,a=n.length;for(u&&(r=n[++o]);++oarguments.length;if(typeof o!="number")var i=Dr(n),o=i.length;else Br.unindexedChars&&yt(n)&&(u=n.split(""));return t=s.createCallback(t,e,4),wt(n,function(n,e,l){e=i?i[--o]:--o,r=a?(a=c,u[e]):t(r,u[e],e,l)}),r}function At(n,t,r){var e;if(t=s.createCallback(t,r),Fr(n)){r=-1;for(var u=n.length;++rr?jr(0,e+r):r||0}else if(r)return r=qt(n,t),n[r]===t?r:-1;return n?g(n,t,r):-1}function Pt(n,t,r){if(typeof t!="number"&&t!=l){var e=0,u=-1,o=n?n.length:0;for(t=s.createCallback(t,r);++u>>1,r(n[e])r?0:r);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:E,variable:"",imports:{_:s}}; -var Nr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b=d&&s.p!==i,v=r();if(v.q=l,v["false"]=v["function"]=v["null"]=v["true"]=v.undefined=c,l=r(),l.k=e,l.l=v,l.m=a,l.p=i,l.push=f,l.r=p,h)for(;++u":">",'"':""","'":"'"},Lr=st(Tr),Gr=X(Nr,{h:Nr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Hr=X(Nr),Jr=X(Pr,qr,{i:c}),Kr=X(Pr,qr); -ht(/x/)&&(ht=function(n){return typeof n=="function"&&vr.call(n)==L});var Mr=cr?function(n){if(!n||vr.call(n)!=H||!Br.argsClass&&ct(n))return c;var t=n.valueOf,r=typeof t=="function"&&(r=cr(t))&&cr(r);return r?n==r||cr(n)==r:at(n)}:at,Ur=xt,Vr=ot(function Xr(n,t,r){for(var e=-1,u=n?n.length:0,o=[];++e=d&&s.p!==a,c=[],f=l?zr():u?t():c;++on?t():function(){return 1>--n?t.apply(this,arguments):void 0}},s.assign=Gr,s.at=function(n){var t=-1,r=ar.apply(Yt,Or.call(arguments,1)),e=r.length,u=Gt(e);for(Br.unindexedChars&&yt(n)&&(n=n.split(""));++t++f&&(o=n.apply(a,u)),p=hr(e,t),o}},s.defaults=Hr,s.defer=Dt,s.delay=function(n,t){var r=Or.call(arguments,2);return hr(function(){n.apply(a,r)},t)},s.difference=It,s.filter=jt,s.flatten=Vr,s.forEach=wt,s.forIn=Jr,s.forOwn=Kr,s.functions=pt,s.groupBy=function(n,t,r){var e={};return t=s.createCallback(t,r),wt(n,function(n,r,u){r=Qt(t(n,r,u)),(fr.call(e,r)?e[r]:e[r]=[]).push(n)}),e},s.initial=function(n,t,r){if(!n)return[]; -var e=0,u=n.length;if(typeof t!="number"&&t!=l){var o=u;for(t=s.createCallback(t,r);o--&&t(n[o],o,n);)e++}else e=t==l||r?1:t||e;return it(n,0,kr(jr(0,u-e),u))},s.intersection=function(n){var r=arguments,u=r.length,o=-1,a=n?n.length:0,i=[],l=t();l[0]=zr();n:for(;++oe(a,r))&&(o[r]=n)}),o},s.once=function(n){var t,r;return function(){return t?r:(t=i,r=n.apply(this,arguments),n=l,r)}},s.pairs=function(n){for(var t=-1,r=Dr(n),e=r.length,u=Gt(e);++tr?jr(0,e+r):kr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},s.mixin=Tt,s.noConflict=function(){return f._=rr,this},s.parseInt=Qr,s.random=function(n,t){n==l&&t==l&&(t=1),n=+n||0,t==l?(t=n,n=0):t=+t||0;var r=xr();return n%1||t%1?n+kr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+ir(r*(t-n+1))},s.reduce=Et,s.reduceRight=St,s.result=function(n,t){var r=n?n[t]:a;return ht(r)?n[t]():r},s.runInContext=o,s.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Dr(n).length -},s.some=At,s.sortedIndex=qt,s.template=function(n,t,r){var e=s.templateSettings;n||(n=""),r=Hr({},r,e);var u,o=Hr({},r.imports,e.imports),e=Dr(o),o=bt(o),l=0,c=r.interpolate||B,f="__p+='",c=Wt((r.escape||B).source+"|"+c.source+"|"+(c===E?x:B).source+"|"+(r.evaluate||B).source+"|$","g");n.replace(c,function(t,r,e,o,a,c){return e||(e=o),f+=n.slice(l,c).replace(P,nt),r&&(f+="'+__e("+r+")+'"),a&&(u=i,f+="';"+a+";__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),l=c+t.length,t}),f+="';\n",c=r=r.variable,c||(r="obj",f="with("+r+"){"+f+"}"),f=(u?f.replace(_,""):f).replace(C,"$1").replace(j,"$1;"),f="function("+r+"){"+(c?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}"; -try{var p=Kt(e,"return "+f).apply(a,o)}catch(g){throw g.source=f,g}return t?p(t):(p.source=f,p)},s.unescape=function(n){return n==l?"":Qt(n).replace(w,lt)},s.uniqueId=function(n){var t=++v;return Qt(n==l?"":n)+t},s.all=Ct,s.any=At,s.detect=kt,s.findWhere=kt,s.foldl=Et,s.foldr=St,s.include=_t,s.inject=Et,Kr(s,function(n,t){s.prototype[t]||(s.prototype[t]=function(){var t=[this.__wrapped__];return pr.apply(t,arguments),n.apply(s,t)})}),s.first=Bt,s.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=l){var o=u; -for(t=s.createCallback(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==l||r)return n[u-1];return it(n,jr(0,u-e))}},s.take=Bt,s.head=Bt,Kr(s,function(n,t){s.prototype[t]||(s.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r);return t==l||r&&typeof t!="function"?e:new et(e)})}),s.VERSION="1.2.1",s.prototype.toString=function(){return Qt(this.__wrapped__)},s.prototype.value=Lt,s.prototype.valueOf=Lt,Rr(["join","pop","shift"],function(n){var t=Yt[n];s.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) -}}),Rr(["push","reverse","sort","unshift"],function(n){var t=Yt[n];s.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Rr(["concat","slice","splice"],function(n){var t=Yt[n];s.prototype[n]=function(){return new et(t.apply(this.__wrapped__,arguments))}}),Br.spliceObjects||Rr(["pop","shift","splice"],function(n){var t=Yt[n],r="splice"==n;s.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new et(e):e}}),s}var a,i=!0,l=null,c=!1,f=typeof exports=="object"&&exports,p=typeof module=="object"&&module&&module.exports==f&&module,s=typeof global=="object"&&global; -(s.global===s||s.window===s)&&(n=s);var g=[],h=[],v=0,m={},y=+new Date+"",d=75,b=10,_=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,j=/(__e\(.*?\)|\b__t\))\+'';/g,w=/&(?:amp|lt|gt|quot|#39);/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,E=/<%=([\s\S]+?)%>/g,S=(S=/\bthis\b/)&&S.test(o)&&S,A=" \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",I=RegExp("^["+A+"]*0+(?=.$)"),B=/($^)/,N=/[&<>"']/g,P=/['\n\r\t\u2028\u2029\\]/g,q="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),z="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),F="[object Arguments]",$="[object Array]",D="[object Boolean]",R="[object Date]",T="[object Error]",L="[object Function]",G="[object Number]",H="[object Object]",J="[object RegExp]",K="[object String]",M={}; -M[L]=c,M[F]=M[$]=M[D]=M[R]=M[G]=M[H]=M[J]=M[K]=i;var U={"boolean":c,"function":i,object:i,number:c,string:c,undefined:c},V={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},W=o();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=W, define(function(){return W})):f&&!f.nodeType?p?(p.exports=W)._=W:f._=W:n._=W}(this); \ No newline at end of file +;!function(n){function t(n,t,r){r=(r||0)-1;for(var e=n.length;++rt||typeof n=="undefined")return 1;if(nr?0:r);++ek;k++)e+="m='"+n.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",n.i||(e+="||(!v[m]&&r[m]!==y[m])"),e+="){"+n.f+"}"; +e+="}"}return(n.b||Nr.nonEnumArgs)&&(e+="}"),e+=n.c+";return C",t=t("i,j,l,n,o,q,t,u,y,z,w,G,H,J",r+e+"}"),g(n),t(Q,nr,pr,ft,$r,dt,Dr,_,tr,et,Br,tt,rr,yr)}function I(n){return yt(n)?dr(n):{}}function ut(n){return Tr[n]}function ot(){var n=(n=_.indexOf)===Pt?t:n;return n}function it(n){return function(t,r,e,u){return typeof r!="boolean"&&r!=d&&(u=e,e=u&&u[r]===t?y:r,r=b),e!=d&&(e=_.createCallback(e,u)),n(t,r,e,u)}}function lt(n){var t,r;return!n||yr.call(n)!=Z||(t=n.constructor,ht(t)&&!(t instanceof t))||!Nr.argsClass&&ft(n)||!Nr.nodeClass&&f(n)?b:Nr.ownLast?(Jr(n,function(n,t,e){return r=pr.call(e,t),b +}),r!==false):(Jr(n,function(n,t){r=t}),r===y||pr.call(n,r))}function ct(n){return Lr[n]}function ft(n){return yr.call(n)==M}function pt(n,t,r,e,u,a){var o=n;if(typeof t!="boolean"&&t!=d&&(e=r,r=t,t=b),typeof r=="function"){if(r=typeof e=="undefined"?r:_.createCallback(r,e,1),o=r(o),typeof o!="undefined")return o;o=n}if(e=yt(o)){var i=yr.call(o);if(!rt[i]||!Nr.nodeClass&&f(o))return o;var c=$r(o)}if(!e||!t)return e?c?v(o):Gr({},o):o;switch(e=Ir[i],i){case V:case W:return new e(+o);case Y:case tt:return new e(o); +case nt:return e(o.source,$.exec(o))}i=!u,u||(u=l()),a||(a=l());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=c?e(o.length):{},c&&(pr.call(n,"index")&&(o.index=n.index),pr.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(c?Rr:Kr)(n,function(n,e){o[e]=pt(n,t,r,y,u,a)}),i&&(s(u),s(a)),o}function st(n){var t=[];return Jr(n,function(n,r){ht(n)&&t.push(r)}),t.sort()}function gt(n){for(var t=-1,r=Dr(n),e=r.length,u={};++tr?wr(0,a+r):r)||0,a&&typeof a=="number"?o=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):Rr(n,function(n){return++ea&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Rr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,a=n)});return a}function St(n,t,r,e){var u=3>arguments.length;if(t=_.createCallback(t,e,4),$r(n)){var a=-1,o=n.length;for(u&&(r=n[++a]);++aarguments.length;if(typeof a!="number")var i=Dr(n),a=i.length;else Nr.unindexedChars&&dt(n)&&(u=n.split(""));return t=_.createCallback(t,e,4),xt(n,function(n,e,l){e=i?i[--a]:--a,r=o?(o=b,u[e]):t(r,u[e],e,l) +}),r}function It(n,t,r){var e;if(t=_.createCallback(t,r),$r(n)){r=-1;for(var u=n.length;++r=A&&u===t;if(c){var f=o(i);f?(u=r,i=f):c=b}for(;++eu(i,f)&&l.push(f);return c&&g(i),l}function Nt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,r);++ae?wr(0,u+e):e||0}else if(e)return e=Ft(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function zt(n,t,r){if(typeof t!="number"&&t!=d){var e=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,r);++u>>1,r(n[e])r?0:r);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:q,variable:"",imports:{_:_}};var Pr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b":">",'"':""","'":"'"},Lr=gt(Tr),Gr=x(Pr,{h:Pr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Hr=x(Pr),Jr=x(zr,Fr,{i:b}),Kr=x(zr,Fr); +ht(/x/)&&(ht=function(n){return typeof n=="function"&&yr.call(n)==X});var Mr=fr?function(n){if(!n||yr.call(n)!=Z||!Nr.argsClass&&ft(n))return b;var t=n.valueOf,r=typeof t=="function"&&(r=fr(t))&&fr(r);return r?n==r||fr(n)==r:lt(n)}:lt,Ur=Ot,Vr=it(function Xr(n,t,r){for(var e=-1,u=n?n.length:0,a=[];++e=A&&i===t,v=u||p?l():f;if(p){var h=o(v);h?(i=r,v=h):(p=b,v=u?v:(s(v),f)) +}for(;++ai(v,y))&&((u||p)&&v.push(y),f.push(h))}return p?(s(v.o),g(v)):u&&s(v),f});Ar&&C&&typeof vr=="function"&&(Rt=Dt(vr,e));var Qr=8==xr(R+"08")?xr:function(n,t){return xr(dt(n)?n.replace(T,""):n,t||0)};return _.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Gr,_.at=function(n){var t=-1,r=ir.apply(Zt,Er.call(arguments,1)),e=r.length,u=Ht(e);for(Nr.unindexedChars&&dt(n)&&(n=n.split(""));++t++i&&(a=n.apply(o,u)),l=hr(e,t),a}},_.defaults=Hr,_.defer=Rt,_.delay=function(n,t){var r=Er.call(arguments,2);return hr(function(){n.apply(y,r)},t)},_.difference=Bt,_.filter=wt,_.flatten=Vr,_.forEach=xt,_.forIn=Jr,_.forOwn=Kr,_.functions=st,_.groupBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Xt(t(n,r,u)),(pr.call(e,r)?e[r]:e[r]=[]).push(n) +}),e},_.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++}else e=t==d||r?1:t||e;return v(n,0,kr(wr(0,u-e),u))},_.intersection=function(n){for(var e=arguments,u=e.length,a=-1,i=l(),c=-1,f=ot(),p=n?n.length:0,v=[],h=l();++a=A&&o(a?e[a]:h)}n:for(;++c(m?r(m,y):f(h,y))){for(a=u,(m||h).push(y);--a;)if(m=i[a],0>(m?r(m,y):f(e[a],y)))continue n; +v.push(y)}}for(;u--;)(m=i[u])&&g(m);return s(i),s(h),v},_.invert=gt,_.invoke=function(n,t){var r=Er.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=Ht(typeof a=="number"?a:0);return xt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},_.keys=Dr,_.map=Ot,_.max=Et,_.memoize=function(n,t){function r(){var e=r.cache,u=S+(t?t.apply(this,arguments):arguments[0]);return pr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},_.merge=bt,_.min=function(n,t,r){var e=1/0,a=e;if(!t&&$r(n)){r=-1; +for(var o=n.length;++re(o,r))&&(a[r]=n)}),a},_.once=function(n){var t,r;return function(){return t?r:(t=m,r=n.apply(this,arguments),n=d,r)}},_.pairs=function(n){for(var t=-1,r=Dr(n),e=r.length,u=Ht(e);++tr?wr(0,e+r):kr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},_.mixin=Lt,_.noConflict=function(){return e._=er,this},_.parseInt=Qr,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0; +var r=Or();return n%1||t%1?n+kr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+lr(r*(t-n+1))},_.reduce=St,_.reduceRight=At,_.result=function(n,t){var r=n?n[t]:y;return ht(r)?n[t]():r},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Dr(n).length},_.some=It,_.sortedIndex=Ft,_.template=function(n,t,r){var e=_.templateSettings;n||(n=""),r=Hr({},r,e);var u,a=Hr({},r.imports,e.imports),e=Dr(a),a=_t(a),o=0,l=r.interpolate||L,c="__p+='",l=Qt((r.escape||L).source+"|"+l.source+"|"+(l===q?F:L).source+"|"+(r.evaluate||L).source+"|$","g"); +n.replace(l,function(t,r,e,a,l,f){return e||(e=a),c+=n.slice(o,f).replace(H,i),r&&(c+="'+__e("+r+")+'"),l&&(u=m,c+="';"+l+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),c+="';\n",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(B,""):c).replace(N,"$1").replace(P,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var f=Mt(e,"return "+c).apply(y,a) +}catch(p){throw p.source=c,p}return t?f(t):(f.source=c,f)},_.unescape=function(n){return n==d?"":Xt(n).replace(z,ct)},_.uniqueId=function(n){var t=++O;return Xt(n==d?"":n)+t},_.all=jt,_.any=It,_.detect=kt,_.findWhere=kt,_.foldl=St,_.foldr=At,_.include=Ct,_.inject=St,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return sr.apply(t,arguments),n.apply(_,t)})}),_.first=Nt,_.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++ +}else if(e=t,e==d||r)return n[u-1];return v(n,wr(0,u-e))}},_.take=Nt,_.head=Nt,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r);return t==d||r&&typeof t!="function"?e:new j(e)})}),_.VERSION="1.2.1",_.prototype.toString=function(){return Xt(this.__wrapped__)},_.prototype.value=Gt,_.prototype.valueOf=Gt,Rr(["join","pop","shift"],function(n){var t=Zt[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Rr(["push","reverse","sort","unshift"],function(n){var t=Zt[n]; +_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Rr(["concat","slice","splice"],function(n){var t=Zt[n];_.prototype[n]=function(){return new j(t.apply(this.__wrapped__,arguments))}}),Nr.spliceObjects||Rr(["pop","shift","splice"],function(n){var t=Zt[n],r="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new j(e):e}}),_}var y,m=!0,d=null,b=!1,_=typeof exports=="object"&&exports,C=typeof module=="object"&&module&&module.exports==_&&module,j=typeof global=="object"&&global; +(j.global===j||j.window===j)&&(n=j);var w=[],x=[],O=0,E={},S=+new Date+"",A=75,I=10,B=/\b__p\+='';/g,N=/\b(__p\+=)''\+/g,P=/(__e\(.*?\)|\b__t\))\+'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,F=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$=/\w*$/,q=/<%=([\s\S]+?)%>/g,D=(D=/\bthis\b/)&&D.test(h)&&D,R=" \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",T=RegExp("^["+R+"]*0+(?=.$)"),L=/($^)/,G=/[&<>"']/g,H=/['\n\r\t\u2028\u2029\\]/g,J="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),K="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),M="[object Arguments]",U="[object Array]",V="[object Boolean]",W="[object Date]",Q="[object Error]",X="[object Function]",Y="[object Number]",Z="[object Object]",nt="[object RegExp]",tt="[object String]",rt={}; +rt[X]=b,rt[M]=rt[U]=rt[V]=rt[W]=rt[Y]=rt[Z]=rt[nt]=rt[tt]=m;var et={"boolean":b,"function":m,object:m,number:b,string:b,undefined:b},ut={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},at=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=at, define(function(){return at})):_&&!_.nodeType?C?(C.exports=at)._=at:_._=at:n._=at}(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index aa2670aae..756aeb8be 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -141,6 +141,166 @@ '\u2029': 'u2029' }; + /*--------------------------------------------------------------------------*/ + + /** + * A basic implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + */ + function basicIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * An implementation of `_.contains` for cache objects that mimics the return + * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache object to inspect. + * @param {Mixed} value The value to search for. + * @returns {Number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var type = typeof value; + cache = cache.cache; + + if (type == 'boolean' || value == null) { + return cache[value]; + } + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value; + cache = cache[type] || (cache[type] = {}); + + return type == 'object' + ? (cache[key] && basicIndexOf(cache[key], value) > -1 ? 0 : -1) + : (cache[key] ? 0 : -1); + } + + /** + * Adds a given `value` to the corresponding cache object. + * + * @private + * @param {Mixed} value The value to add to the cache. + */ + function cachePush(value) { + var cache = this.cache, + type = typeof value; + + if (type == 'boolean' || value == null) { + cache[value] = true; + } else { + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value, + typeCache = cache[type] || (cache[type] = {}); + + if (type == 'object') { + if ((typeCache[key] || (typeCache[key] = [])).push(value) == this.array.length) { + cache[type] = false; + } + } else { + typeCache[key] = true; + } + } + } + + /** + * Used by `_.max` and `_.min` as the default `callback` when a given + * `collection` is a string value. + * + * @private + * @param {String} value The character to inspect. + * @returns {Number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || typeof a == 'undefined') { + return 1; + } + if (a < b || typeof b == 'undefined') { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Creates a cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [array=[]] The array to search. + * @returns {Null|Object} Returns the cache object or `null` if caching should not be used. + */ + function createCache(array) { + var index = -1, + length = array.length; + + var cache = getObject(); + cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; + + var result = getObject(); + result.array = array; + result.cache = cache; + result.push = cachePush; + + while (++index < length) { + result.push(array[index]); + } + return cache.object === false + ? (releaseObject(result), null) + : result; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + /** * Gets an array from the array pool or creates a new one if the pool is empty. * @@ -160,18 +320,13 @@ function getObject() { return objectPool.pop() || { 'array': null, - 'contains': null, 'criteria': null, 'false': null, - 'function': null, 'index': null, - 'indexOf': null, - 'initedArray': null, 'null': null, 'number': null, 'object': null, 'push': null, - 'release': null, 'string': null, 'true': null, 'undefined': null, @@ -179,6 +334,15 @@ }; } + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + /** * Releases the given `array` back to the array pool. * @@ -200,6 +364,10 @@ * @param {Object} [object] The object to release. */ function releaseObject(object) { + var cache = object.cache; + if (cache) { + releaseObject(cache); + } if (objectPool.length == maxPoolSize) { objectPool.length = maxPoolSize - 1; } @@ -207,6 +375,34 @@ objectPool.push(object); } + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used, instead of `Array#slice`, to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|String} collection The collection to slice. + * @param {Number} start The start index. + * @param {Number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + /*--------------------------------------------------------------------------*/ /** @@ -364,6 +560,19 @@ : new lodashWrapper(value); } + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value) { + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + /** * An object used to flag environments features. * @@ -444,69 +653,6 @@ /*--------------------------------------------------------------------------*/ - /** - * A basic version of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. - * - * @private - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to search from. - * @returns {Number} Returns the index of the matched value or `-1`. - */ - function basicIndexOf(array, value, fromIndex) { - var index = (fromIndex || 0) - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Used by `_.max` and `_.min` as the default `callback` when a given - * `collection` is a string value. - * - * @private - * @param {String} value The character to inspect. - * @returns {Number} Returns the code unit of given character. - */ - function charAtCallback(value) { - return value.charCodeAt(0); - } - - /** - * Used by `sortBy` to compare transformed `collection` values, stable sorting - * them in ascending order. - * - * @private - * @param {Object} a The object to compare to `b`. - * @param {Object} b The object to compare to `a`. - * @returns {Number} Returns the sort order indicator of `1` or `-1`. - */ - function compareAscending(a, b) { - var ai = a.index, - bi = b.index; - - a = a.criteria; - b = b.criteria; - - // ensure a stable sort in V8 and other engines - // http://code.google.com/p/v8/issues/detail?id=90 - if (a !== b) { - if (a > b || typeof a == 'undefined') { - return 1; - } - if (a < b || typeof b == 'undefined') { - return -1; - } - } - return ai < bi ? -1 : 1; - } - /** * Creates a function that, when called, invokes `func` with the `this` binding * of `thisArg` and prepends any `partialArgs` to the arguments passed to the @@ -565,109 +711,6 @@ return bound; } - /** - * Creates a function optimized to search large arrays for a given `value`, - * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. - * - * @private - * @param {Array} [array=[]] The array to search. - * @param {Mixed} value The value to search for. - * @returns {Boolean} Returns `true`, if `value` is found, else `false`. - */ - var createCache = (function() { - - function basicContains(value) { - return this.indexOf(this.array, value) > -1; - } - - function basicPush(value) { - this.array.push(value); - } - - function cacheContains(value) { - var cache = this.cache, - type = typeof value; - - if (type == 'boolean' || value == null) { - return cache[value]; - } - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value; - cache = cache[type] || (cache[type] = {}); - - return type == 'object' - ? (cache[key] ? basicIndexOf(cache[key], value) > -1 : false) - : !!cache[key]; - } - - function cachePush(value) { - var cache = this.cache, - type = typeof value; - - if (type == 'boolean' || value == null) { - cache[value] = true; - } else { - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value; - cache = cache[type] || (cache[type] = {}); - - if (type == 'object') { - bailout = (cache[key] || (cache[key] = [])).push(value) == length; - } else { - cache[key] = true; - } - } - } - - function release() { - var cache = this.cache; - if (cache.initedArray) { - releaseArray(this.array); - } - releaseObject(cache); - } - - return function(array) { - var bailout, - index = -1, - indexOf = getIndexOf(), - initedArray = !array && (array = getArray()), - length = array.length, - isLarge = length >= largeArraySize && lodash.indexOf !== indexOf; - - var cache = getObject(); - cache.initedArray = initedArray; - cache['false'] = cache['function'] = cache['null'] = cache['true'] = cache['undefined'] = false; - - var result = getObject(); - result.array = array; - result.cache = cache; - result.contains = cacheContains; - result.indexOf = indexOf; - result.push = cachePush; - result.release = release; - - if (isLarge) { - while (++index < length) { - result.push(array[index]); - } - if (bailout) { - isLarge = false; - result.release(); - } - } - if (!isLarge) { - result.contains = basicContains; - result.push = basicPush; - } - return result; - }; - }()); - /** * Creates a new object with the specified `prototype`. * @@ -690,18 +733,6 @@ return htmlEscapes[match]; } - /** - * Used by `template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeStringChar(match) { - return '\\' + stringEscapes[match]; - } - /** * Gets the appropriate "indexOf" function. If the `_.indexOf` method is * customized, this method returns the custom method, otherwise it returns @@ -715,28 +746,6 @@ return result; } - /** - * A fast path for creating `lodash` wrapper objects. - * - * @private - * @param {Mixed} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - */ - function lodashWrapper(value) { - this.__wrapped__ = value; - } - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - /** * Creates a function that juggles arguments, allowing argument overloading * for `_.flatten` and `_.uniq`, before passing them to the given `func`. @@ -788,34 +797,6 @@ return result === undefined || hasOwnProperty.call(value, result); } - /** - * Slices the `collection` from the `start` index up to, but not including, - * the `end` index. - * - * Note: This function is used, instead of `Array#slice`, to support node lists - * in IE < 9 and to ensure dense arrays are returned. - * - * @private - * @param {Array|Object|String} collection The collection to slice. - * @param {Number} start The start index. - * @param {Number} end The end index. - * @returns {Array} Returns the new array. - */ - function slice(array, start, end) { - start || (start = 0); - if (typeof end == 'undefined') { - end = array ? array.length : 0; - } - var index = -1, - length = end - start || 0, - result = Array(length < 0 ? 0 : length); - - while (++index < length) { - result[index] = array[start + index]; - } - return result; - } - /** * Used by `unescape` to convert HTML entities to characters. * @@ -1123,7 +1104,7 @@ * `undefined`, cloning will be handled by the method instead. The `callback` * is bound to `thisArg` and invoked with one argument; (value). * - * Note: This function is loosely based on the structured clone algorithm. Functions + * 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 http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. @@ -3321,18 +3302,31 @@ */ function difference(array) { var index = -1, + indexOf = getIndexOf(), length = array ? array.length : 0, - flattened = concat.apply(arrayProto, nativeSlice.call(arguments, 1)), - cache = createCache(flattened), + seen = concat.apply(arrayProto, nativeSlice.call(arguments, 1)), result = []; + var isLarge = length >= largeArraySize && indexOf === basicIndexOf; + + if (isLarge) { + var cache = createCache(seen); + if (cache) { + indexOf = cacheIndexOf; + seen = cache; + } else { + isLarge = false; + } + } while (++index < length) { var value = array[index]; - if (!cache.contains(value)) { + if (indexOf(seen, value) < 0) { result.push(value); } } - cache.release(); + if (isLarge) { + releaseObject(seen); + } return result; } @@ -3636,24 +3630,31 @@ function intersection(array) { var args = arguments, argsLength = args.length, + argsIndex = -1, + caches = getArray(), index = -1, + indexOf = getIndexOf(), length = array ? array.length : 0, - result = []; - - var caches = getArray(); - caches[0] = createCache(); + result = [], + seen = getArray(); + while (++argsIndex < argsLength) { + var value = args[argsIndex]; + caches[argsIndex] = indexOf === basicIndexOf && + (value ? value.length : 0) >= largeArraySize && + createCache(argsIndex ? args[argsIndex] : seen); + } outer: while (++index < length) { - var cache = caches[0], - value = array[index]; + var cache = caches[0]; + value = array[index]; - if (!cache.contains(value)) { - var argsIndex = argsLength; - cache.push(value); + if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { + argsIndex = argsLength; + (cache || seen).push(value); while (--argsIndex) { - cache = caches[argsIndex] || (caches[argsIndex] = createCache(args[argsIndex])); - if (!cache.contains(value)) { + cache = caches[argsIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { continue outer; } } @@ -3661,9 +3662,13 @@ } } while (argsLength--) { - caches[argsLength].release(); + cache = caches[argsLength]; + if (cache) { + releaseObject(cache); + } } releaseArray(caches); + releaseArray(seen); return result; } @@ -4035,17 +4040,28 @@ var index = -1, indexOf = getIndexOf(), length = array ? array.length : 0, - isLarge = !isSorted && length >= largeArraySize && lodash.indexOf !== indexOf, - result = [], - seen = isLarge ? createCache() : (callback ? getArray() : result); + result = []; + var isLarge = !isSorted && length >= largeArraySize && indexOf === basicIndexOf, + seen = (callback || isLarge) ? getArray() : result; + + if (isLarge) { + var cache = createCache(seen); + if (cache) { + indexOf = cacheIndexOf; + seen = cache; + } else { + isLarge = false; + seen = callback ? seen : (releaseArray(seen), result); + } + } while (++index < length) { var value = array[index], computed = callback ? callback(value, index, array) : value; if (isSorted ? !index || seen[seen.length - 1] !== computed - : (isLarge ? !seen.contains(computed) : indexOf(seen, computed) < 0) + : indexOf(seen, computed) < 0 ) { if (callback || isLarge) { seen.push(computed); @@ -4054,7 +4070,8 @@ } } if (isLarge) { - seen.release(); + releaseArray(seen.array); + releaseObject(seen); } else if (callback) { releaseArray(seen); } @@ -4778,7 +4795,7 @@ } /** - * This function returns the first argument passed to it. + * This method returns the first argument passed to it. * * @static * @memberOf _ @@ -4827,7 +4844,7 @@ push.apply(args, arguments); var result = func.apply(lodash, args); - return (value && typeof value == 'object' && value == result) + return (value && typeof value == 'object' && value === result) ? this : new lodashWrapper(result); }; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 6938cdfdf..7c7184378 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,43 +4,43 @@ * Build: `lodash modern -o ./dist/lodash.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;!function(n){function t(){return v.pop()||[]}function e(){return g.pop()||{k:f,m:f,n:f,"false":f,"function":f,o:f,p:f,q:f,"null":f,number:f,object:f,push:f,r:f,string:f,"true":f,undefined:f,s:f}}function r(n){v.length==d&&(v.length=d-1),n.length=0,v.push(n)}function u(n){g.length==d&&(g.length=d-1),n.k=n.l=n.n=n.object=n.a=n.b=n.s=f,g.push(n)}function a(c){function s(n){if(!n||pe.call(n)!=P)return l;var t=n.valueOf,e=typeof t=="function"&&(e=oe(t))&&oe(e);return e?n==e||oe(n)==e:at(n)}function v(n,t,e){if(!n||!V[typeof n])return n; -t=t&&typeof e=="undefined"?t:L.createCallback(t,e);for(var r=-1,u=V[typeof n]&&Ie(n),a=u?u.length:0;++rt||typeof n=="undefined")return 1;if(ne?0:e);++re?be(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(ht(n)?n.indexOf(t,e):u(n,t,e)):v(n,function(n){return++ru&&(u=o) -}}else t=!t&&ht(n)?X:L.createCallback(t,e),jt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function xt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Kt(r);++earguments.length;t=L.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++aarguments.length; -if(typeof u!="number")var o=Ie(n),u=o.length;return t=L.createCallback(t,r,4),jt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=l,n[i]):t(e,n[i],i,f)}),e}function St(n,t,e){var r;t=L.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++ee?be(0,r+e):e||0}else if(e)return e=qt(n,t),n[e]===t?e:-1;return n?Q(n,t,e):-1}function $t(n,t,e){if(typeof t!="number"&&t!=f){var r=0,u=-1,a=n?n.length:0;for(t=L.createCallback(t,e);++u>>1,e(n[r])e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:O,variable:"",imports:{_:L}};var Ee=function(){function n(n){return-1=b&&L.p!==i,g=e();if(g.q=f,g["false"]=g["function"]=g["null"]=g["true"]=g.undefined=l,f=e(),f.k=r,f.l=g,f.m=o,f.p=i,f.push=c,f.r=p,v)for(;++u":">",'"':""","'":"'"},Ae=ct(Ne),$e=ut(function Fe(n,t,e){for(var r=-1,u=n?n.length:0,a=[];++r=b&&L.p!==o,l=[],c=f?Ee():u?t():l;++an?t():function(){return 1>--n?t.apply(this,arguments):void 0}},L.assign=H,L.at=function(n){for(var t=-1,e=re.apply(Xt,je.call(arguments,1)),r=e.length,u=Kt(r);++t++c&&(a=n.apply(o,u)),p=ce(r,t),a}},L.defaults=d,L.defer=Tt,L.delay=function(n,t){var e=je.call(arguments,2);return ce(function(){n.apply(o,e)},t)},L.difference=It,L.filter=_t,L.flatten=$e,L.forEach=jt,L.forIn=g,L.forOwn=v,L.functions=lt,L.groupBy=function(n,t,e){var r={};return t=L.createCallback(t,e),jt(n,function(n,e,u){e=Lt(t(n,e,u)),(ie.call(r,e)?r[e]:r[e]=[]).push(n)}),r},L.initial=function(n,t,e){if(!n)return[]; -var r=0,u=n.length;if(typeof t!="number"&&t!=f){var a=u;for(t=L.createCallback(t,e);a--&&t(n[a],a,n);)r++}else r=t==f||e?1:t||r;return ot(n,0,de(be(0,u-r),u))},L.intersection=function(n){var e=arguments,u=e.length,a=-1,o=n?n.length:0,i=[],f=t();f[0]=Ee();n:for(;++ar(o,e))&&(a[e]=n)}),a},L.once=function(n){var t,e;return function(){return t?e:(t=i,e=n.apply(this,arguments),n=f,e)}},L.pairs=function(n){for(var t=-1,e=Ie(n),r=e.length,u=Kt(r);++te?be(0,r+e):de(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},L.mixin=zt,L.noConflict=function(){return c._=Zt,this},L.parseInt=Be,L.random=function(n,t){n==f&&t==f&&(t=1),n=+n||0,t==f?(t=n,n=0):t=+t||0;var e=ke();return n%1||t%1?n+de(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+ue(e*(t-n+1))},L.reduce=Ot,L.reduceRight=Et,L.result=function(n,t){var e=n?n[t]:o;return st(e)?n[t]():e},L.runInContext=a,L.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Ie(n).length -},L.some=St,L.sortedIndex=qt,L.template=function(n,t,e){var r=L.templateSettings;n||(n=""),e=d({},e,r);var u,a=d({},e.imports,r.imports),r=Ie(a),a=mt(a),f=0,l=e.interpolate||N,c="__p+='",l=Jt((e.escape||N).source+"|"+l.source+"|"+(l===O?C:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,a,o,l){return r||(r=a),c+=n.slice(f,l).replace($,tt),e&&(c+="'+__e("+e+")+'"),o&&(u=i,c+="';"+o+";__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),f=l+t.length,t}),c+="';\n",l=e=e.variable,l||(e="obj",c="with("+e+"){"+c+"}"),c=(u?c.replace(_,""):c).replace(k,"$1").replace(j,"$1;"),c="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}"; -try{var p=Vt(r,"return "+c).apply(o,a)}catch(s){throw s.source=c,s}return t?p(t):(p.source=c,p)},L.unescape=function(n){return n==f?"":Lt(n).replace(w,it)},L.uniqueId=function(n){var t=++h;return Lt(n==f?"":n)+t},L.all=dt,L.any=St,L.detect=kt,L.findWhere=kt,L.foldl=Ot,L.foldr=Et,L.include=bt,L.inject=Ot,v(L,function(n,t){L.prototype[t]||(L.prototype[t]=function(){var t=[this.__wrapped__];return fe.apply(t,arguments),n.apply(L,t)})}),L.first=Nt,L.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=f){var a=u; -for(t=L.createCallback(t,e);a--&&t(n[a],a,n);)r++}else if(r=t,r==f||e)return n[u-1];return ot(n,be(0,u-r))}},L.take=Nt,L.head=Nt,v(L,function(n,t){L.prototype[t]||(L.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==f||e&&typeof t!="function"?r:new rt(r)})}),L.VERSION="1.2.1",L.prototype.toString=function(){return Lt(this.__wrapped__)},L.prototype.value=Pt,L.prototype.valueOf=Pt,jt(["join","pop","shift"],function(n){var t=Xt[n];L.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) -}}),jt(["push","reverse","sort","unshift"],function(n){var t=Xt[n];L.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),jt(["concat","slice","splice"],function(n){var t=Xt[n];L.prototype[n]=function(){return new rt(t.apply(this.__wrapped__,arguments))}}),L}var o,i=!0,f=null,l=!1,c=typeof exports=="object"&&exports,p=typeof module=="object"&&module&&module.exports==c&&module,s=typeof global=="object"&&global;(s.global===s||s.window===s)&&(n=s);var v=[],g=[],h=0,y={},m=+new Date+"",b=75,d=10,_=/\b__p\+='';/g,k=/\b(__p\+=)''\+/g,j=/(__e\(.*?\)|\b__t\))\+'';/g,w=/&(?:amp|lt|gt|quot|#39);/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,x=/\w*$/,O=/<%=([\s\S]+?)%>/g,E=(E=/\bthis\b/)&&E.test(a)&&E,S=" \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",I=RegExp("^["+S+"]*0+(?=.$)"),N=/($^)/,A=/[&<>"']/g,$=/['\n\r\t\u2028\u2029\\]/g,q="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),B="[object Arguments]",F="[object Array]",R="[object Boolean]",T="[object Date]",D="[object Function]",z="[object Number]",P="[object Object]",K="[object RegExp]",M="[object String]",U={}; -U[D]=l,U[B]=U[F]=U[R]=U[T]=U[z]=U[P]=U[K]=U[M]=i;var V={"boolean":l,"function":i,object:i,number:l,string:l,undefined:l},W={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=a();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=G, define(function(){return G})):c&&!c.nodeType?p?(p.exports=G)._=G:c._=G:n._=G}(this); \ No newline at end of file +;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n.length;++et||typeof n=="undefined")return 1;if(ne?0:e);++re?de(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(yt(n)?n.indexOf(t,e):u(n,t,e)):_(n,function(n){return++ra&&(a=i) +}}else t=!t&&yt(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Mt(r);++earguments.length;t=tt.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++aarguments.length; +if(typeof u!="number")var o=Ee(n),u=o.length;return t=tt.createCallback(t,r,4),wt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=b,n[i]):t(e,n[i],i,f)}),e}function It(n,t,e){var r;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e=O&&u===t;if(c){var l=o(i);l?(u=e,i=l):c=b}for(;++ru(i,l)&&f.push(l); +return c&&p(i),f}function Nt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=-1;for(t=tt.createCallback(t,e);++ar?de(0,u+r):r||0}else if(r)return r=Ft(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Bt(n,t,e){if(typeof t!="number"&&t!=y){var r=0,u=-1,a=n?n.length:0;for(t=tt.createCallback(t,e);++u>>1,e(n[r])e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:tt}};var Oe=he,Ee=me?function(n){return gt(n)?me(n):[]}:Z,Se={"&":"&","<":"<",">":">",'"':""","'":"'"},Ie=pt(Se),Ut=ot(function Ne(n,t,e){for(var r=-1,u=n?n.length:0,a=[];++r=O&&i===t,g=u||v?f():s;if(v){var h=o(g);h?(i=e,g=h):(v=b,g=u?g:(l(g),s))}for(;++ai(g,y))&&((u||v)&&g.push(y),s.push(h))}return v?(l(g.a),p(g)):u&&l(g),s});return Gt&&d&&typeof le=="function"&&(Dt=qt(le,r)),le=8==ke(T+"08")?ke:function(n,t){return ke(yt(n)?n.replace(q,""):n,t||0)},tt.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0 +}},tt.assign=E,tt.at=function(n){for(var t=-1,e=ue.apply(Yt,we.call(arguments,1)),r=e.length,u=Mt(r);++t++i&&(a=n.apply(o,u)),f=pe(r,t),a}},tt.defaults=j,tt.defer=Dt,tt.delay=function(n,t){var e=we.call(arguments,2);return pe(function(){n.apply(g,e)},t)},tt.difference=At,tt.filter=kt,tt.flatten=Ut,tt.forEach=wt,tt.forIn=k,tt.forOwn=_,tt.functions=lt,tt.groupBy=function(n,t,e){var r={}; +return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Qt(t(n,e,u)),(fe.call(r,e)?r[e]:r[e]=[]).push(n)}),r},tt.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=u;for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else r=t==y||e?1:t||r;return s(n,0,_e(de(0,u-r),u))},tt.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),c=-1,s=at(),v=n?n.length:0,g=[],h=f();++a=O&&o(a?r[a]:h)}n:for(;++c(b?e(b,y):s(h,y))){for(a=u,(b||h).push(y);--a;)if(b=i[a],0>(b?e(b,y):s(r[a],y)))continue n;g.push(y)}}for(;u--;)(b=i[u])&&p(b);return l(i),l(h),g},tt.invert=pt,tt.invoke=function(n,t){var e=we.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Mt(typeof a=="number"?a:0);return wt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},tt.keys=Ee,tt.map=Ct,tt.max=xt,tt.memoize=function(n,t){function e(){var r=e.cache,u=x+(t?t.apply(this,arguments):arguments[0]);return fe.call(r,u)?r[u]:r[u]=n.apply(this,arguments) +}return e.cache={},e},tt.merge=bt,tt.min=function(n,t,e){var r=1/0,a=r;if(!t&&Oe(n)){e=-1;for(var o=n.length;++er(o,e))&&(a[e]=n)}),a},tt.once=function(n){var t,e;return function(){return t?e:(t=h,e=n.apply(this,arguments),n=y,e) +}},tt.pairs=function(n){for(var t=-1,e=Ee(n),r=e.length,u=Mt(r);++te?de(0,r+e):_e(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},tt.mixin=Pt,tt.noConflict=function(){return r._=ne,this},tt.parseInt=le,tt.random=function(n,t){n==y&&t==y&&(t=1),n=+n||0,t==y?(t=n,n=0):t=+t||0;var e=je();return n%1||t%1?n+_e(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+ae(e*(t-n+1))},tt.reduce=Et,tt.reduceRight=St,tt.result=function(n,t){var e=n?n[t]:g;return vt(e)?n[t]():e},tt.runInContext=v,tt.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Ee(n).length +},tt.some=It,tt.sortedIndex=Ft,tt.template=function(n,t,e){var r=tt.templateSettings;n||(n=""),e=j({},e,r);var u,a=j({},e.imports,r.imports),r=Ee(a),a=mt(a),o=0,f=e.interpolate||D,c="__p+='",f=Lt((e.escape||D).source+"|"+f.source+"|"+(f===F?$:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(f,function(t,e,r,a,f,l){return r||(r=a),c+=n.slice(o,l).replace(P,i),e&&(c+="'+__e("+e+")+'"),f&&(u=h,c+="';"+f+";__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),o=l+t.length,t}),c+="';\n",f=e=e.variable,f||(e="obj",c="with("+e+"){"+c+"}"),c=(u?c.replace(S,""):c).replace(I,"$1").replace(A,"$1;"),c="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}"; +try{var l=Wt(r,"return "+c).apply(g,a)}catch(p){throw p.source=c,p}return t?l(t):(l.source=c,l)},tt.unescape=function(n){return n==y?"":Qt(n).replace(N,ft)},tt.uniqueId=function(n){var t=++w;return Qt(n==y?"":n)+t},tt.all=_t,tt.any=It,tt.detect=jt,tt.findWhere=jt,tt.foldl=Et,tt.foldr=St,tt.include=dt,tt.inject=Et,_(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(){var t=[this.__wrapped__];return ce.apply(t,arguments),n.apply(tt,t)})}),tt.first=Nt,tt.last=function(n,t,e){if(n){var r=0,u=n.length; +if(typeof t!="number"&&t!=y){var a=u;for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else if(r=t,r==y||e)return n[u-1];return s(n,de(0,u-r))}},tt.take=Nt,tt.head=Nt,_(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==y||e&&typeof t!="function"?r:new et(r)})}),tt.VERSION="1.2.1",tt.prototype.toString=function(){return Qt(this.__wrapped__)},tt.prototype.value=Kt,tt.prototype.valueOf=Kt,wt(["join","pop","shift"],function(n){var t=Yt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) +}}),wt(["push","reverse","sort","unshift"],function(n){var t=Yt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var t=Yt[n];tt.prototype[n]=function(){return new et(t.apply(this.__wrapped__,arguments))}}),tt}var g,h=!0,y=null,b=!1,m=typeof exports=="object"&&exports,d=typeof module=="object"&&module&&module.exports==m&&module,_=typeof global=="object"&&global;(_.global===_||_.window===_)&&(n=_);var k=[],j=[],w=0,C={},x=+new Date+"",O=75,E=10,S=/\b__p\+='';/g,I=/\b(__p\+=)''\+/g,A=/(__e\(.*?\)|\b__t\))\+'';/g,N=/&(?:amp|lt|gt|quot|#39);/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,F=/<%=([\s\S]+?)%>/g,R=(R=/\bthis\b/)&&R.test(v)&&R,T=" \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",q=RegExp("^["+T+"]*0+(?=.$)"),D=/($^)/,z=/[&<>"']/g,P=/['\n\r\t\u2028\u2029\\]/g,K="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),M="[object Arguments]",U="[object Array]",V="[object Boolean]",W="[object Date]",G="[object Function]",H="[object Number]",J="[object Object]",L="[object RegExp]",Q="[object String]",X={}; +X[G]=b,X[M]=X[U]=X[V]=X[W]=X[H]=X[J]=X[L]=X[Q]=h;var Y={"boolean":b,"function":h,object:h,number:b,string:b,undefined:b},Z={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},nt=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=nt, define(function(){return nt})):m&&!m.nodeType?d?(d.exports=nt)._=nt:m._=nt:n._=nt}(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 73d81c582..2f19b8265 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -103,6 +103,80 @@ /*--------------------------------------------------------------------------*/ + /** + * A basic implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + */ + function basicIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || typeof a == 'undefined') { + return 1; + } + if (a < b || typeof b == 'undefined') { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + + /*--------------------------------------------------------------------------*/ + /** Used for `Array` and `Object` method references */ var arrayProto = Array.prototype, objectProto = Object.prototype, @@ -214,6 +288,19 @@ : new lodashWrapper(value); } + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value) { + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + /** * An object used to flag environments features. * @@ -295,57 +382,6 @@ /*--------------------------------------------------------------------------*/ - /** - * A basic version of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. - * - * @private - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to search from. - * @returns {Number} Returns the index of the matched value or `-1`. - */ - function basicIndexOf(array, value, fromIndex) { - var index = (fromIndex || 0) - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Used by `sortBy` to compare transformed `collection` values, stable sorting - * them in ascending order. - * - * @private - * @param {Object} a The object to compare to `b`. - * @param {Object} b The object to compare to `a`. - * @returns {Number} Returns the sort order indicator of `1` or `-1`. - */ - function compareAscending(a, b) { - var ai = a.index, - bi = b.index; - - a = a.criteria; - b = b.criteria; - - // ensure a stable sort in V8 and other engines - // http://code.google.com/p/v8/issues/detail?id=90 - if (a !== b) { - if (a > b || typeof a == 'undefined') { - return 1; - } - if (a < b || typeof b == 'undefined') { - return -1; - } - } - return ai < bi ? -1 : 1; - } - /** * Creates a function that, when called, invokes `func` with the `this` binding * of `thisArg` and prepends any `partialArgs` to the arguments passed to the @@ -437,18 +473,6 @@ return htmlEscapes[match]; } - /** - * Used by `template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeStringChar(match) { - return '\\' + stringEscapes[match]; - } - /** * Gets the appropriate "indexOf" function. If the `_.indexOf` method is * customized, this method returns the custom method, otherwise it returns @@ -462,28 +486,6 @@ return result; } - /** - * A fast path for creating `lodash` wrapper objects. - * - * @private - * @param {Mixed} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - */ - function lodashWrapper(value) { - this.__wrapped__ = value; - } - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - /** * Used by `unescape` to convert HTML entities to characters. * @@ -3817,7 +3819,7 @@ } /** - * This function returns the first argument passed to it. + * This method returns the first argument passed to it. * * @static * @memberOf _ diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 670470310..3482f9b92 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -4,32 +4,32 @@ * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;!function(n){function t(n){return n instanceof t?n:new l(n)}function r(n,t,r){r=(r||0)-1;for(var e=n.length;++rt||typeof n=="undefined")return 1;if(nt||typeof n=="undefined")return 1;if(ne&&(e=r,u=n)}); else for(;++ou&&(u=r);return u}function k(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++rarguments.length;t=W(t,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(r=n[++o]);++oarguments.length;if(typeof u!="number")var i=$t(n),u=i.length;return t=W(t,e,4),N(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=!1,n[a]):t(r,n[a],a,f) -}),r}function D(n,t,r){var e;t=W(t,r),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++rr(u,i)&&o.push(i)}return o}function $(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=W(t,r);++oe?Ft(0,u+e):e||0}else if(e)return e=P(n,t),n[e]===t?e:-1;return n?r(n,t,e):-1}function C(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=W(t,r);++u>>1,r(n[e])o(l,c))&&(r&&l.push(c),a.push(e))}return a}function V(n,t){return Mt.fastBind||xt&&2"']/g,rt=/['\n\r\t\u2028\u2029\\]/g,et="[object Arguments]",ut="[object Array]",ot="[object Boolean]",it="[object Date]",at="[object Number]",ft="[object Object]",lt="[object RegExp]",ct="[object String]",pt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},st={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},vt=Array.prototype,L=Object.prototype,gt=n._,ht=RegExp("^"+(L.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),yt=Math.ceil,mt=n.clearTimeout,_t=vt.concat,dt=Math.floor,bt=L.hasOwnProperty,jt=vt.push,wt=n.setTimeout,At=L.toString,xt=ht.test(xt=At.bind)&&xt,Ot=ht.test(Ot=Object.create)&&Ot,Et=ht.test(Et=Array.isArray)&&Et,St=n.isFinite,Nt=n.isNaN,Bt=ht.test(Bt=Object.keys)&&Bt,Ft=Math.max,kt=Math.min,qt=Math.random,Rt=vt.slice,L=ht.test(n.attachEvent),Dt=xt&&!/\n|true/.test(xt+L),Mt={}; -!function(){var n={0:1,length:1};Mt.fastBind=xt&&!Dt,Mt.spliceObjects=(vt.splice.call(n,0,1),!n[0])}(1),t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ot||(o=function(n){if(b(n)){c.prototype=n;var t=new c;c.prototype=null}return t||{}}),l.prototype=t.prototype,s(arguments)||(s=function(n){return n?bt.call(n,"callee"):!1});var Tt=Et||function(n){return n?typeof n=="object"&&At.call(n)==ut:!1},Et=function(n){var t,r=[];if(!n||!pt[typeof n])return r; -for(t in n)bt.call(n,t)&&r.push(t);return r},$t=Bt?function(n){return b(n)?Bt(n):[]}:Et,It={"&":"&","<":"<",">":">",'"':""","'":"'"},zt=y(It),Ct=function(n,t){var r;if(!n||!pt[typeof n])return n;for(r in n)if(t(n[r],r,n)===X)break;return n},Pt=function(n,t){var r;if(!n||!pt[typeof n])return n;for(r in n)if(bt.call(n,r)&&t(n[r],r,n)===X)break;return n};d(/x/)&&(d=function(n){return typeof n=="function"&&"[object Function]"==At.call(n)}),t.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0 -}},t.bind=V,t.bindAll=function(n){for(var t=1u(i,a)){for(var l=r;--l;)if(0>u(t[l],a))continue n;i.push(a)}}return i},t.invert=y,t.invoke=function(n,t){var r=Rt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0); -return N(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},t.keys=$t,t.map=B,t.max=F,t.memoize=function(n,t){var r={};return function(){var e=Y+(t?t.apply(this,arguments):arguments[0]);return bt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},t.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=W(t,r),N(n,function(n,r,o){r=t(n,r,o),rt(r,u)&&(e[u]=n) -}),e},t.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},t.pairs=function(n){for(var t=-1,r=$t(n),e=r.length,u=Array(e);++tr?0:r);++tr?Ft(0,e+r):kt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},t.mixin=H,t.noConflict=function(){return n._=gt,this},t.random=function(n,t){null==n&&null==t&&(t=1),n=+n||0,null==t?(t=n,n=0):t=+t||0;var r=qt();return n%1||t%1?n+kt(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+dt(r*(t-n+1))},t.reduce=q,t.reduceRight=R,t.result=function(n,t){var r=n?n[t]:null; -return d(r)?n[t]():r},t.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:$t(n).length},t.some=D,t.sortedIndex=P,t.template=function(n,r,e){var u=t.templateSettings;n||(n=""),e=g({},e,u);var o=0,i="__p+='",u=e.variable;n.replace(RegExp((e.escape||nt).source+"|"+(e.interpolate||nt).source+"|"+(e.evaluate||nt).source+"|$","g"),function(t,r,e,u,f){return i+=n.slice(o,f).replace(rt,a),r&&(i+="'+_['escape']("+r+")+'"),u&&(i+="';"+u+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t -}),i+="';\n",u||(u="obj",i="with("+u+"||{}){"+i+"}"),i="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var f=Function("_","return "+i)(t)}catch(l){throw l.source=i,l}return r?f(r):(f.source=i,f)},t.unescape=function(n){return null==n?"":(n+"").replace(Z,p)},t.uniqueId=function(n){var t=++Q+"";return n?n+t:t},t.all=O,t.any=D,t.detect=S,t.findWhere=function(n,t){return M(n,t,!0)},t.foldl=q,t.foldr=R,t.include=x,t.inject=q,t.first=$,t.last=function(n,t,r){if(n){var e=0,u=n.length; -if(typeof t!="number"&&null!=t){var o=u;for(t=W(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return Rt.call(n,Ft(0,u-e))}},t.take=$,t.head=$,t.VERSION="1.2.1",H(t),t.prototype.chain=function(){return this.__chain__=!0,this},t.prototype.value=function(){return this.__wrapped__},N("pop push reverse shift sort splice unshift".split(" "),function(n){var r=vt[n];t.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!Mt.spliceObjects&&0===n.length&&delete n[0],this -}}),N(["concat","join","slice"],function(n){var r=vt[n];t.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new l(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=t, define(function(){return t})):J&&!J.nodeType?K?(K.exports=t)._=t:J._=t:n._=t}(this); \ No newline at end of file +}),r}function D(n,t,r){var e;t=W(t,r),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++rr(u,i)&&o.push(i)}return o}function $(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=W(t,r);++oe?Ft(0,u+e):e||0}else if(e)return e=P(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function C(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=W(t,r);++u>>1,r(n[e])o(f,l))&&(r&&f.push(l),a.push(e))}return a}function V(n,t){return Mt.fastBind||xt&&2"']/g,rt=/['\n\r\t\u2028\u2029\\]/g,et="[object Arguments]",ut="[object Array]",ot="[object Boolean]",it="[object Date]",at="[object Number]",ft="[object Object]",lt="[object RegExp]",ct="[object String]",pt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},st={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},vt=Array.prototype,L=Object.prototype,gt=n._,ht=RegExp("^"+(L.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),yt=Math.ceil,mt=n.clearTimeout,_t=vt.concat,dt=Math.floor,bt=L.hasOwnProperty,jt=vt.push,wt=n.setTimeout,At=L.toString,xt=ht.test(xt=At.bind)&&xt,Ot=ht.test(Ot=Object.create)&&Ot,Et=ht.test(Et=Array.isArray)&&Et,St=n.isFinite,Nt=n.isNaN,Bt=ht.test(Bt=Object.keys)&&Bt,Ft=Math.max,kt=Math.min,qt=Math.random,Rt=vt.slice,L=ht.test(n.attachEvent),Dt=xt&&!/\n|true/.test(xt+L); +i.prototype=o.prototype;var Mt={};!function(){var n={0:1,length:1};Mt.fastBind=xt&&!Dt,Mt.spliceObjects=(vt.splice.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ot||(f=function(n){if(b(n)){u.prototype=n;var t=new u;u.prototype=null}return t||{}}),s(arguments)||(s=function(n){return n?bt.call(n,"callee"):!1});var Tt=Et||function(n){return n?typeof n=="object"&&At.call(n)==ut:!1},Et=function(n){var t,r=[]; +if(!n||!pt[typeof n])return r;for(t in n)bt.call(n,t)&&r.push(t);return r},$t=Bt?function(n){return b(n)?Bt(n):[]}:Et,It={"&":"&","<":"<",">":">",'"':""","'":"'"},zt=y(It),Ct=function(n,t){var r;if(!n||!pt[typeof n])return n;for(r in n)if(t(n[r],r,n)===X)break;return n},Pt=function(n,t){var r;if(!n||!pt[typeof n])return n;for(r in n)if(bt.call(n,r)&&t(n[r],r,n)===X)break;return n};d(/x/)&&(d=function(n){return typeof n=="function"&&"[object Function]"==At.call(n)}),o.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0 +}},o.bind=V,o.bindAll=function(n){for(var t=1u(i,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;i.push(a)}}return i},o.invert=y,o.invoke=function(n,t){var r=Rt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0); +return N(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},o.keys=$t,o.map=B,o.max=F,o.memoize=function(n,t){var r={};return function(){var e=Y+(t?t.apply(this,arguments):arguments[0]);return bt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},o.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=W(t,r),N(n,function(n,r,o){r=t(n,r,o),rt(r,u)&&(e[u]=n) +}),e},o.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},o.pairs=function(n){for(var t=-1,r=$t(n),e=r.length,u=Array(e);++tr?0:r);++tr?Ft(0,e+r):kt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},o.mixin=H,o.noConflict=function(){return n._=gt,this},o.random=function(n,t){null==n&&null==t&&(t=1),n=+n||0,null==t?(t=n,n=0):t=+t||0;var r=qt();return n%1||t%1?n+kt(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+dt(r*(t-n+1))},o.reduce=q,o.reduceRight=R,o.result=function(n,t){var r=n?n[t]:null; +return d(r)?n[t]():r},o.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:$t(n).length},o.some=D,o.sortedIndex=P,o.template=function(n,t,r){var u=o.templateSettings;n||(n=""),r=g({},r,u);var i=0,a="__p+='",u=r.variable;n.replace(RegExp((r.escape||nt).source+"|"+(r.interpolate||nt).source+"|"+(r.evaluate||nt).source+"|$","g"),function(t,r,u,o,f){return a+=n.slice(i,f).replace(rt,e),r&&(a+="'+_['escape']("+r+")+'"),o&&(a+="';"+o+";__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),i=f+t.length,t +}),a+="';\n",u||(u="obj",a="with("+u+"||{}){"+a+"}"),a="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var f=Function("_","return "+a)(o)}catch(l){throw l.source=a,l}return t?f(t):(f.source=a,f)},o.unescape=function(n){return null==n?"":(n+"").replace(Z,p)},o.uniqueId=function(n){var t=++Q+"";return n?n+t:t},o.all=O,o.any=D,o.detect=S,o.findWhere=function(n,t){return M(n,t,!0)},o.foldl=q,o.foldr=R,o.include=x,o.inject=q,o.first=$,o.last=function(n,t,r){if(n){var e=0,u=n.length; +if(typeof t!="number"&&null!=t){var o=u;for(t=W(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return Rt.call(n,Ft(0,u-e))}},o.take=$,o.head=$,o.VERSION="1.2.1",H(o),o.prototype.chain=function(){return this.__chain__=!0,this},o.prototype.value=function(){return this.__wrapped__},N("pop push reverse shift sort splice unshift".split(" "),function(n){var t=vt[n];o.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Mt.spliceObjects&&0===n.length&&delete n[0],this +}}),N(["concat","join","slice"],function(n){var t=vt[n];o.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=o, define(function(){return o})):J&&!J.nodeType?K?(K.exports=o)._=o:J._=o:n._=o}(this); \ No newline at end of file diff --git a/doc/README.md b/doc/README.md index 2ebf26646..209fcc365 100644 --- a/doc/README.md +++ b/doc/README.md @@ -218,7 +218,7 @@ ### `_.compact(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3647 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3627 "View in source") [Ⓣ][1] Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. @@ -242,7 +242,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.difference(array [, array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3677 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3657 "View in source") [Ⓣ][1] Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`. @@ -267,7 +267,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]); ### `_.findIndex(array [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3714 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3707 "View in source") [Ⓣ][1] This method is similar to `_.find`, except that it returns the index of the element that passes the callback check, instead of the element itself. @@ -295,7 +295,7 @@ _.findIndex(['apple', 'banana', 'beet'], function(food) { ### `_.first(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3784 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3777 "View in source") [Ⓣ][1] Gets the first element of the `array`. If a number `n` is passed, the first `n` elements of the `array` are returned. If a `callback` function is passed, elements at the beginning of the array are returned as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -355,7 +355,7 @@ _.first(food, { 'type': 'fruit' }); ### `_.flatten(array [, isShallow=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3846 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3839 "View in source") [Ⓣ][1] Flattens a nested array *(the nesting can be to any depth)*. If `isShallow` is truthy, `array` will only be flattened a single level. If `callback` is passed, each element of `array` is passed through a `callback` before flattening. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -398,7 +398,7 @@ _.flatten(stooges, 'quotes'); ### `_.indexOf(array, value [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3890 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3883 "View in source") [Ⓣ][1] Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search. @@ -430,7 +430,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true); ### `_.initial(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3957 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3950 "View in source") [Ⓣ][1] Gets all but the last element of `array`. If a number `n` is passed, the last `n` elements are excluded from the result. If a `callback` function is passed, elements at the end of the array are excluded from the result as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -487,7 +487,7 @@ _.initial(food, { 'type': 'vegetable' }); ### `_.intersection([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3991 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3984 "View in source") [Ⓣ][1] Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`. @@ -511,7 +511,7 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); ### `_.last(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4082 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4086 "View in source") [Ⓣ][1] Gets the last element of the `array`. If a number `n` is passed, the last `n` elements of the `array` are returned. If a `callback` function is passed, elements at the end of the array are returned as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments;(value, index, array). @@ -568,7 +568,7 @@ _.last(food, { 'type': 'vegetable' }); ### `_.lastIndexOf(array, value [, fromIndex=array.length-1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4123 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4127 "View in source") [Ⓣ][1] Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. @@ -597,7 +597,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); ### `_.range([start=0], end [, step=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4164 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4168 "View in source") [Ⓣ][1] Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. @@ -635,7 +635,7 @@ _.range(0); ### `_.rest(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4243 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4247 "View in source") [Ⓣ][1] The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is passed, the first `n` values are excluded from the result. If a `callback` function is passed, elements at the beginning of the array are excluded from the result as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -695,7 +695,7 @@ _.rest(food, { 'type': 'fruit' }); ### `_.sortedIndex(array, value [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4307 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4311 "View in source") [Ⓣ][1] Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. @@ -744,7 +744,7 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { ### `_.union([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4339 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4343 "View in source") [Ⓣ][1] Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`. @@ -768,7 +768,7 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); ### `_.uniq(array [, isSorted=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4389 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4393 "View in source") [Ⓣ][1] Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through the `callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -815,7 +815,7 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.unzip(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4433 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4449 "View in source") [Ⓣ][1] The inverse of `_.zip`, this method splits groups of elements into arrays composed of elements from each group at their corresponding indexes. @@ -839,7 +839,7 @@ _.unzip([['moe', 30, true], ['larry', 40, false]]); ### `_.without(array [, value1, value2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4459 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4475 "View in source") [Ⓣ][1] Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`. @@ -864,7 +864,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); ### `_.zip([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4479 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4495 "View in source") [Ⓣ][1] Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion. @@ -888,7 +888,7 @@ _.zip(['moe', 'larry'], [30, 40], [true, false]); ### `_.zipObject(keys [, values=[]])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4501 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4517 "View in source") [Ⓣ][1] Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`. @@ -923,7 +923,7 @@ _.zipObject(['moe', 'larry'], [30, 40]); ### `_(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L397 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L605 "View in source") [Ⓣ][1] Creates a `lodash` object, which wraps the given `value`, to enable method chaining. @@ -979,7 +979,7 @@ _.isArray(squares.value()); ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5579 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5595 "View in source") [Ⓣ][1] Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. @@ -1009,7 +1009,7 @@ _([1, 2, 3, 4]) ### `_.prototype.toString()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5596 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5612 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. @@ -1030,7 +1030,7 @@ _([1, 2, 3]).toString(); ### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5613 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5629 "View in source") [Ⓣ][1] Extracts the wrapped value. @@ -1061,7 +1061,7 @@ _([1, 2, 3]).valueOf(); ### `_.at(collection [, index1, index2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2634 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2614 "View in source") [Ⓣ][1] Creates an array of elements from the specified indexes, or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes. @@ -1089,7 +1089,7 @@ _.at(['moe', 'larry', 'curly'], 0, 2); ### `_.contains(collection, target [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2676 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2656 "View in source") [Ⓣ][1] Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. @@ -1127,7 +1127,7 @@ _.contains('curly', 'ur'); ### `_.countBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2731 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2711 "View in source") [Ⓣ][1] Creates an object composed of keys returned from running each element of the `collection` through the given `callback`. The corresponding value of each key is the number of times the key was returned by the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1163,7 +1163,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2783 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2763 "View in source") [Ⓣ][1] Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1209,7 +1209,7 @@ _.every(stooges, { 'age': 50 }); ### `_.filter(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2844 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2824 "View in source") [Ⓣ][1] Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1255,7 +1255,7 @@ _.filter(food, { 'type': 'fruit' }); ### `_.find(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2911 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2891 "View in source") [Ⓣ][1] Examines each element in a `collection`, returning the first that the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1304,7 +1304,7 @@ _.find(food, 'organic'); ### `_.forEach(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2958 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2938 "View in source") [Ⓣ][1] Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -1336,7 +1336,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); ### `_.groupBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3008 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2988 "View in source") [Ⓣ][1] Creates an object composed of keys returned from running each element of the `collection` through the `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1373,7 +1373,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.invoke(collection, methodName [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3041 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3021 "View in source") [Ⓣ][1] Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`. @@ -1402,7 +1402,7 @@ _.invoke([123, 456], String.prototype.split, ''); ### `_.map(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3093 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3073 "View in source") [Ⓣ][1] Creates an array of values by running each element in the `collection` through the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1447,7 +1447,7 @@ _.map(stooges, 'name'); ### `_.max(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3150 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3130 "View in source") [Ⓣ][1] Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1489,7 +1489,7 @@ _.max(stooges, 'age'); ### `_.min(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3219 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3199 "View in source") [Ⓣ][1] Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1531,7 +1531,7 @@ _.min(stooges, 'age'); ### `_.pluck(collection, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3269 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3249 "View in source") [Ⓣ][1] Retrieves the value of a specified property from all elements in the `collection`. @@ -1561,7 +1561,7 @@ _.pluck(stooges, 'name'); ### `_.reduce(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3301 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3281 "View in source") [Ⓣ][1] Reduces a `collection` to a value which is the accumulated result of running each element in the `collection` through the `callback`, where each successive `callback` execution consumes the return value of the previous execution. If `accumulator` is not passed, the first element of the `collection` will be used as the initial `accumulator` value. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, index|key, collection)*. @@ -1599,7 +1599,7 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { ### `_.reduceRight(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3344 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3324 "View in source") [Ⓣ][1] This method is similar to `_.reduce`, except that it iterates over a `collection` from right to left. @@ -1630,7 +1630,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); ### `_.reject(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3404 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3384 "View in source") [Ⓣ][1] The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for. @@ -1673,7 +1673,7 @@ _.reject(food, { 'type': 'fruit' }); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3425 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3405 "View in source") [Ⓣ][1] Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. @@ -1697,7 +1697,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]); ### `_.size(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3458 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3438 "View in source") [Ⓣ][1] Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects. @@ -1727,7 +1727,7 @@ _.size('curly'); ### `_.some(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3505 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3485 "View in source") [Ⓣ][1] Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1773,7 +1773,7 @@ _.some(food, { 'type': 'meat' }); ### `_.sortBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3561 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3541 "View in source") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in the `collection` through the `callback`. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1810,7 +1810,7 @@ _.sortBy(['banana', 'strawberry', 'apple'], 'length'); ### `_.toArray(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3597 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3577 "View in source") [Ⓣ][1] Converts the `collection` to an array. @@ -1834,7 +1834,7 @@ Converts the `collection` to an array. ### `_.where(collection, properties)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3629 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3609 "View in source") [Ⓣ][1] Examines each element in a `collection`, returning an array of all elements that have the given `properties`. When checking `properties`, this method performs a deep comparison between values to determine if they are equivalent to each other. @@ -1871,7 +1871,7 @@ _.where(stooges, { 'age': 40 }); ### `_.after(n, func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4541 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4557 "View in source") [Ⓣ][1] If `n` is greater than `0`, a function is created that is restricted to executing `func`, with the `this` binding and arguments of the created function, only after it is called `n` times. If `n` is less than `1`, `func` is executed immediately, without a `this` binding or additional arguments, and its result is returned. @@ -1899,7 +1899,7 @@ _.forEach(notes, function(note) { ### `_.bind(func [, thisArg, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4574 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4590 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function. @@ -1930,7 +1930,7 @@ func(); ### `_.bindAll(object [, methodName1, methodName2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4605 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4621 "View in source") [Ⓣ][1] Binds methods on `object` to `object`, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided, all the function properties of `object` will be bound. @@ -1961,7 +1961,7 @@ jQuery('#docs').on('click', view.onClick); ### `_.bindKey(object, key [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4651 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4667 "View in source") [Ⓣ][1] Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern. @@ -2002,7 +2002,7 @@ func(); ### `_.compose([func1, func2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4674 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4690 "View in source") [Ⓣ][1] Creates a function that is the composition of the passed functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. @@ -2029,7 +2029,7 @@ welcome('moe'); ### `_.createCallback([func=identity, thisArg, argCount=3])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4733 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4749 "View in source") [Ⓣ][1] Produces a callback bound to an optional `thisArg`. If `func` is a property name, the created callback will return the property value for a given element. If `func` is an object, the created callback will return `true` for elements that contain the equivalent object properties, otherwise it will return `false`. @@ -2083,7 +2083,7 @@ _.toLookup(stooges, 'name'); ### `_.debounce(func, wait, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4809 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4825 "View in source") [Ⓣ][1] Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass an `options` object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. @@ -2116,7 +2116,7 @@ jQuery('#postbox').on('click', _.debounce(sendMail, 200, { ### `_.defer(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4862 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4878 "View in source") [Ⓣ][1] Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked. @@ -2141,7 +2141,7 @@ _.defer(function() { alert('deferred'); }); ### `_.delay(func, wait [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4888 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4904 "View in source") [Ⓣ][1] Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked. @@ -2168,7 +2168,7 @@ _.delay(log, 1000, 'logged later'); ### `_.memoize(func [, resolver])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4913 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4929 "View in source") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. The result cache is exposed as the `cache` property on the memoized function. @@ -2194,7 +2194,7 @@ var fibonacci = _.memoize(function(n) { ### `_.once(func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4943 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4959 "View in source") [Ⓣ][1] Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function. @@ -2220,7 +2220,7 @@ initialize(); ### `_.partial(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4978 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4994 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding. @@ -2247,7 +2247,7 @@ hi('moe'); ### `_.partialRight(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5009 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5025 "View in source") [Ⓣ][1] This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function. @@ -2284,7 +2284,7 @@ options.imports ### `_.throttle(func, wait, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5042 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5058 "View in source") [Ⓣ][1] Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Pass an `options` object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call. @@ -2316,7 +2316,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5107 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5123 "View in source") [Ⓣ][1] Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function. @@ -2352,7 +2352,7 @@ hello(); ### `_.assign(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1372 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1352 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources will overwrite property assignments of previous sources. If a `callback` function is passed, it will be executed to produce the assigned values. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -2390,7 +2390,7 @@ defaults(food, { 'name': 'banana', 'type': 'fruit' }); ### `_.clone(value [, deep=false, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1427 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1407 "View in source") [Ⓣ][1] Creates a clone of `value`. If `deep` is `true`, nested objects will also be cloned, otherwise they will be assigned by reference. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2437,11 +2437,11 @@ clone.childNodes.length; ### `_.cloneDeep(value [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1557 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1537 "View in source") [Ⓣ][1] Creates a deep clone of `value`. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. -Note: This function 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 http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. +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 http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. #### Arguments 1. `value` *(Mixed)*: The value to deep clone. @@ -2483,7 +2483,7 @@ clone.node == view.node; ### `_.defaults(object [, source1, source2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1581 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1561 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `undefined`. Once a property is set, additional defaults of the same property will be ignored. @@ -2509,7 +2509,7 @@ _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); ### `_.findKey(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1603 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1583 "View in source") [Ⓣ][1] This method is similar to `_.find`, except that it returns the key of the element that passes the callback check, instead of the element itself. @@ -2537,7 +2537,7 @@ _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { ### `_.forIn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1644 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1624 "View in source") [Ⓣ][1] Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -2573,7 +2573,7 @@ _.forIn(new Dog('Dagny'), function(value, key) { ### `_.forOwn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1669 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1649 "View in source") [Ⓣ][1] Iterates over an object's own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -2601,7 +2601,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1686 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1666 "View in source") [Ⓣ][1] Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values. @@ -2628,7 +2628,7 @@ _.functions(_); ### `_.has(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1711 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1691 "View in source") [Ⓣ][1] Checks if the specified object `property` exists and is a direct property, instead of an inherited property. @@ -2653,7 +2653,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); ### `_.invert(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1728 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1708 "View in source") [Ⓣ][1] Creates an object composed of the inverted keys and values of the given `object`. @@ -2677,7 +2677,7 @@ _.invert({ 'first': 'moe', 'second': 'larry' }); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1235 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1215 "View in source") [Ⓣ][1] Checks if `value` is an `arguments` object. @@ -2704,7 +2704,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1261 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1241 "View in source") [Ⓣ][1] Checks if `value` is an array. @@ -2731,7 +2731,7 @@ _.isArray([1, 2, 3]); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1754 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1734 "View in source") [Ⓣ][1] Checks if `value` is a boolean value. @@ -2755,7 +2755,7 @@ _.isBoolean(null); ### `_.isDate(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1771 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1751 "View in source") [Ⓣ][1] Checks if `value` is a date. @@ -2779,7 +2779,7 @@ _.isDate(new Date); ### `_.isElement(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1788 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1768 "View in source") [Ⓣ][1] Checks if `value` is a DOM element. @@ -2803,7 +2803,7 @@ _.isElement(document.body); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1813 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1793 "View in source") [Ⓣ][1] Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty". @@ -2833,7 +2833,7 @@ _.isEmpty(''); ### `_.isEqual(a, b [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1872 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1852 "View in source") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent to each other. If `callback` is passed, it will be executed to compare values. If `callback` returns `undefined`, comparisons will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(a, b)*. @@ -2878,7 +2878,7 @@ _.isEqual(words, otherWords, function(a, b) { ### `_.isFinite(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2058 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2038 "View in source") [Ⓣ][1] Checks if `value` is, or can be coerced to, a finite number. @@ -2916,7 +2916,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2075 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2055 "View in source") [Ⓣ][1] Checks if `value` is a function. @@ -2940,7 +2940,7 @@ _.isFunction(_); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2138 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2118 "View in source") [Ⓣ][1] Checks if `value` is `NaN`. @@ -2975,7 +2975,7 @@ _.isNaN(undefined); ### `_.isNull(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2160 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2140 "View in source") [Ⓣ][1] Checks if `value` is `null`. @@ -3002,7 +3002,7 @@ _.isNull(undefined); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2177 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2157 "View in source") [Ⓣ][1] Checks if `value` is a number. @@ -3026,7 +3026,7 @@ _.isNumber(8.4 * 5); ### `_.isObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2105 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2085 "View in source") [Ⓣ][1] Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)* @@ -3056,7 +3056,7 @@ _.isObject(1); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2205 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2185 "View in source") [Ⓣ][1] Checks if a given `value` is an object created by the `Object` constructor. @@ -3091,7 +3091,7 @@ _.isPlainObject({ 'name': 'moe', 'age': 40 }); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2230 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2210 "View in source") [Ⓣ][1] Checks if `value` is a regular expression. @@ -3115,7 +3115,7 @@ _.isRegExp(/moe/); ### `_.isString(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2247 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2227 "View in source") [Ⓣ][1] Checks if `value` is a string. @@ -3139,7 +3139,7 @@ _.isString('moe'); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2264 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2244 "View in source") [Ⓣ][1] Checks if `value` is `undefined`. @@ -3163,7 +3163,7 @@ _.isUndefined(void 0); ### `_.keys(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1294 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1274 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property names of `object`. @@ -3187,7 +3187,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.merge(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2323 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2303 "View in source") [Ⓣ][1] Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined`, into the destination object. Subsequent sources will overwrite property assignments of previous sources. If a `callback` function is passed, it will be executed to produce the merged values of the destination and source properties. If `callback` returns `undefined`, merging will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -3243,7 +3243,7 @@ _.merge(food, otherFood, function(a, b) { ### `_.omit(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2438 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2418 "View in source") [Ⓣ][1] Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a `callback` function is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3274,7 +3274,7 @@ _.omit({ 'name': 'moe', 'age': 40 }, function(value) { ### `_.pairs(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2473 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2453 "View in source") [Ⓣ][1] Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. @@ -3298,7 +3298,7 @@ _.pairs({ 'moe': 30, 'larry': 40 }); ### `_.pick(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2511 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2491 "View in source") [Ⓣ][1] Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3329,7 +3329,7 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { ### `_.transform(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2566 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2546 "View in source") [Ⓣ][1] An alternative to `_.reduce`, this method transforms an `object` to a new `accumulator` object which is the result of running each of its elements through the `callback`, with each `callback` execution potentially mutating the `accumulator` object. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -3366,7 +3366,7 @@ var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) ### `_.values(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2599 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2579 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property values of `object`. @@ -3397,7 +3397,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.escape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5131 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5147 "View in source") [Ⓣ][1] Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. @@ -3421,9 +3421,9 @@ _.escape('Moe, Larry & Curly'); ### `_.identity(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5149 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5165 "View in source") [Ⓣ][1] -This function returns the first argument passed to it. +This method returns the first argument passed to it. #### Arguments 1. `value` *(Mixed)*: Any value. @@ -3446,7 +3446,7 @@ moe === _.identity(moe); ### `_.mixin(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5175 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5191 "View in source") [Ⓣ][1] Adds functions properties of `object` to the `lodash` function and chainable wrapper. @@ -3476,7 +3476,7 @@ _('moe').capitalize(); ### `_.noConflict()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5204 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5220 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -3496,7 +3496,7 @@ var lodash = _.noConflict(); ### `_.parseInt(value [, radix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5228 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5244 "View in source") [Ⓣ][1] Converts the given `value` into an integer of the specified `radix`. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used. @@ -3523,7 +3523,7 @@ _.parseInt('08'); ### `_.random([min=0, max=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5251 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5267 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned. @@ -3551,7 +3551,7 @@ _.random(5); ### `_.result(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5295 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5311 "View in source") [Ⓣ][1] Resolves the value of `property` on `object`. If `property` is a function, it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is falsey, then `undefined` is returned. @@ -3586,7 +3586,7 @@ _.result(object, 'stuff'); ### `_.runInContext([context=window])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L237 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L445 "View in source") [Ⓣ][1] Create a new `lodash` function using the given `context` object. @@ -3604,7 +3604,7 @@ Create a new `lodash` function using the given `context` object. ### `_.template(text, data, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5379 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5395 "View in source") [Ⓣ][1] A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. @@ -3686,7 +3686,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.times(n, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5504 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5520 "View in source") [Ⓣ][1] Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*. @@ -3718,7 +3718,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.unescape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5531 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5547 "View in source") [Ⓣ][1] The inverse of `_.escape`, this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. @@ -3742,7 +3742,7 @@ _.unescape('Moe, Larry & Curly'); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5551 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5567 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is passed, the ID will be appended to it. @@ -3776,7 +3776,7 @@ _.uniqueId(); ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L593 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L814 "View in source") [Ⓣ][1] A reference to the `lodash` function. @@ -3795,7 +3795,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5794 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5810 "View in source") [Ⓣ][1] *(String)*: The semantic version number. @@ -3807,7 +3807,7 @@ A reference to the `lodash` function. ### `_.support` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L411 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L632 "View in source") [Ⓣ][1] *(Object)*: An object used to flag environments features. @@ -3819,7 +3819,7 @@ A reference to the `lodash` function. ### `_.support.argsClass` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L436 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L657 "View in source") [Ⓣ][1] *(Boolean)*: Detect if an `arguments` object's [[Class]] is resolvable *(all but Firefox < `4`, IE < `9`)*. @@ -3831,7 +3831,7 @@ A reference to the `lodash` function. ### `_.support.argsObject` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L428 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L649 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `arguments` objects are `Object` objects *(all but Narwhal and Opera < `10.5`)*. @@ -3843,7 +3843,7 @@ A reference to the `lodash` function. ### `_.support.enumErrorProps` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L445 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L666 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. *(IE < `9`, Safari < `5.1`)* @@ -3855,7 +3855,7 @@ A reference to the `lodash` function. ### `_.support.enumPrototypes` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L458 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L679 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `prototype` properties are enumerable by default. @@ -3869,7 +3869,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.fastBind` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L466 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L687 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `Function#bind` exists and is inferred to be fast *(all but V8)*. @@ -3881,7 +3881,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.nonEnumArgs` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L483 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L704 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `arguments` object indexes are non-enumerable *(Firefox < `4`, IE < `9`, PhantomJS, Safari < `5.1`)*. @@ -3893,7 +3893,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.nonEnumShadows` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L494 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L715 "View in source") [Ⓣ][1] *(Boolean)*: Detect if properties shadowing those on `Object.prototype` are non-enumerable. @@ -3907,7 +3907,7 @@ In IE < `9` an objects own properties, shadowing non-enumerable ones, are made n ### `_.support.ownLast` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L474 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L695 "View in source") [Ⓣ][1] *(Boolean)*: Detect if own properties are iterated after inherited properties *(all but IE < `9`)*. @@ -3919,7 +3919,7 @@ In IE < `9` an objects own properties, shadowing non-enumerable ones, are made n ### `_.support.spliceObjects` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L508 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L729 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. @@ -3933,7 +3933,7 @@ Firefox < `10`, IE compatibility mode, and IE < `9` have buggy Array `shift()` a ### `_.support.unindexedChars` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L519 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L740 "View in source") [Ⓣ][1] *(Boolean)*: Detect lack of support for accessing string characters by index. @@ -3947,7 +3947,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L545 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L766 "View in source") [Ⓣ][1] *(Object)*: By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby *(ERB)*. Change the following template settings to use alternative delimiters. @@ -3959,7 +3959,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L553 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L774 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect `data` property values to be HTML-escaped. @@ -3971,7 +3971,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L561 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L782 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect code to be evaluated. @@ -3983,7 +3983,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L569 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L790 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect `data` property values to inject. @@ -3995,7 +3995,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L577 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L798 "View in source") [Ⓣ][1] *(String)*: Used to reference the data object in the template text. @@ -4007,7 +4007,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L585 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L806 "View in source") [Ⓣ][1] *(Object)*: Used to import variables into the compiled template.