diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index d7f7788b3..af7e211d2 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -19,11 +19,19 @@ /** Used to generate unique IDs */ var idCounter = 0; + /** Used to compose bitmasks for `__bindData__` */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_FLAG = 4, + CURRY_BOUND_FLAG = 8, + PARTIAL_FLAG = 16, + PARTIAL_RIGHT_FLAG = 32; + /** Used as the size when optimizations are enabled for large arrays */ - var largeArraySize = 75; + var LARGE_ARRAY_SIZE = 75; /** Used as the max size of the `arrayPool` and `objectPool` */ - var maxPoolSize = 40; + var MAX_POOL_SIZE = 40; /** Used to detect and test whitespace */ var whitespace = ( @@ -490,7 +498,7 @@ */ function releaseArray(array) { array.length = 0; - if (arrayPool.length < maxPoolSize) { + if (arrayPool.length < MAX_POOL_SIZE) { arrayPool.push(array); } } @@ -507,7 +515,7 @@ releaseObject(cache); } object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; - if (objectPool.length < maxPoolSize) { + if (objectPool.length < MAX_POOL_SIZE) { objectPool.push(object); } } @@ -1350,10 +1358,10 @@ thisArg = bindData[4], arity = bindData[5]; - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, key = func; function bound() { @@ -1368,8 +1376,9 @@ push.apply(args, partialRightArgs); } if (isCurry && args.length < arity) { - bitmask |= 16 & ~32; - return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~(BIND_FLAG | BIND_KEY_FLAG)), args, null, thisArg, arity]); } } args || (args = arguments); @@ -1400,7 +1409,7 @@ var index = -1, indexOf = getIndexOf(), length = array ? array.length : 0, - isLarge = length >= largeArraySize && indexOf === baseIndexOf, + isLarge = length >= LARGE_ARRAY_SIZE && indexOf === baseIndexOf, result = []; if (isLarge) { @@ -1768,7 +1777,7 @@ length = array ? array.length : 0, result = []; - var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + var isLarge = !isSorted && length >= LARGE_ARRAY_SIZE && indexOf === baseIndexOf, seen = (callback || isLarge) ? getArray() : result; if (isLarge) { @@ -1837,7 +1846,7 @@ * * @private * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of method flags to compose. + * @param {number} bitmask The bitmask of flags to compose. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -1854,12 +1863,12 @@ * @returns {Function} Returns the new function. */ function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, - isPartial = bitmask & 16, - isPartialRight = bitmask & 32; + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, + isPartial = bitmask & PARTIAL_FLAG, + isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isBindKey && !isFunction(func)) { throw new TypeError; @@ -1883,15 +1892,15 @@ bindData[3] = slice(bindData[3]); } // set `thisBinding` is not previously bound - if (isBind && !(bindData[1] & 1)) { + if (isBind && !(bindData[1] & BIND_FLAG)) { bindData[4] = thisArg; } // set if previously bound but not currently (subsequent curried functions) - if (!isBind && bindData[1] & 1) { + if (!isBind && bindData[1] & BIND_FLAG) { bitmask |= 8; } // set curried arity if not yet set - if (isCurry && !(bindData[1] & 4)) { + if (isCurry && !(bindData[1] & CURRY_FLAG)) { bindData[5] = arity; } // append partial left arguments @@ -1907,7 +1916,7 @@ return createWrapper.apply(null, bindData); } // fast path for `_.bind` - var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + var creater = (bitmask == BIND_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) ? baseBind : baseCreateWrapper; return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); } @@ -2488,7 +2497,7 @@ var value = arguments[argsIndex]; if (isArray(value) || isArguments(value)) { args.push(value); - caches.push(trustIndexOf && value.length >= largeArraySize && + caches.push(trustIndexOf && value.length >= LARGE_ARRAY_SIZE && createCache(argsIndex ? args[argsIndex] : seen)); } } @@ -4553,8 +4562,8 @@ */ function bind(func, thisArg) { return arguments.length > 2 - ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) - : createWrapper(func, 1, null, null, thisArg); + ? createWrapper(func, BIND_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, thisArg) + : createWrapper(func, BIND_FLAG, null, null, thisArg); } /** @@ -4590,7 +4599,7 @@ while (++index < length) { var key = funcs[index]; - object[key] = createWrapper(object[key], 1, null, null, object); + object[key] = createWrapper(object[key], BIND_FLAG, null, null, object); } return object; } @@ -4632,8 +4641,8 @@ */ function bindKey(object, key) { return arguments.length > 2 - ? createWrapper(key, 19, slice(arguments, 2), null, object) - : createWrapper(key, 3, null, null, object); + ? createWrapper(key, BIND_FLAG | BIND_KEY_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, object) + : createWrapper(key, BIND_FLAG | BIND_KEY_FLAG, null, null, object); } /** @@ -4718,7 +4727,7 @@ */ function curry(func, arity) { arity = typeof arity == 'number' ? arity : (+arity || func.length); - return createWrapper(func, 4, null, null, null, arity); + return createWrapper(func, CURRY_FLAG, null, null, null, arity); } /** @@ -5020,7 +5029,7 @@ * // => 'hi fred' */ function partial(func) { - return createWrapper(func, 16, slice(arguments, 1)); + return createWrapper(func, PARTIAL_FLAG, slice(arguments, 1)); } /** @@ -5054,7 +5063,7 @@ * // => { '_': _, 'jq': $ } */ function partialRight(func) { - return createWrapper(func, 32, null, slice(arguments, 1)); + return createWrapper(func, PARTIAL_RIGHT_FLAG, null, slice(arguments, 1)); } /** @@ -5130,7 +5139,7 @@ * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { - return createWrapper(wrapper, 16, [value]); + return createWrapper(wrapper, PARTIAL_FLAG, [value]); } /*--------------------------------------------------------------------------*/ diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index d8056aef4..3a542922e 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -5,60 +5,60 @@ */ ;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=q&&o===t,l=[];if(i){var c=f(e);c?(o=r,e=c):i=false}for(;++uo(e,c)&&l.push(c);return i&&y(e),l}function it(n,t,r){var e=-1,u=n,o=n?n.length:0;if(t=t&&typeof r=="undefined"?t:k(t,r,3),typeof o=="number")for(Yr.unindexedChars&&nr(u)&&(u=u.split(""));++e=q&&a===t,s=u||c?p():l;for(c&&(s=f(s),a=r);++oa(s,h))&&((u||c)&&s.push(h),l.push(g)) -}return c?(v(s.g),y(s)):u&&v(s),l}function vt(n){return function(t,r,u){var o={};if(r=e.createCallback(r,u,3),ae(t)){u=-1;for(var a=t.length;++uu;u++)e+="m='"+n.d[u]+"';if((!(l&&o[m])&&h.call(q,m))",n.f||(e+="||(!o[m]&&q[m]!==r[m])"),e+="){"+n.c+"}"; -e+="}"}return t("a,f,g,h,j,k,r,p,v,w,y",r+(e+"return s;")+"}")(k,Y,dr,Ar,wt,Yt,br,Qr,et,_r,xr)}function dt(){var n=(n=e.indexOf)===xt?t:n;return n}function bt(n){return typeof n=="function"&&Cr.test(qr.call(n))}function _t(n){var t,r;return!n||xr.call(n)!=tt||!Ar.call(n,"constructor")&&(t=n.constructor,Qt(t)&&!(t instanceof t))||!Yr.argsClass&&wt(n)||!Yr.nodeClass&&h(n)?false:Yr.ownLast?(oe(n,function(n,t,e){return r=Ar.call(e,t),false}),false!==r):(oe(n,function(n,t){r=t}),typeof r=="undefined"||Ar.call(n,r)) -}function wt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&xr.call(n)==G||false}function jt(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=e.createCallback(t,r,3);++ae?Kr(0,u+e):e||0;else if(e)return e=Ot(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Ct(n,t,r){if(typeof t!="number"&&null!=t){var u=0,o=-1,a=n?n.length:0; -for(t=e.createCallback(t,r,3);++ot?t=Kr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Kr(u+r,0):r>u&&(r=u),u=r-t||0,r=ir(u);++e>>1,r(n[u])r?0:r);++t=e)return false;if(typeof n=="string"||!ae(n)&&nr(n))return Fr?Fr.call(n,t,r):-1r?Kr(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&nr(n)?u:e.createCallback(t,r,3),it(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Lt(n,t,r,u){var o=3>arguments.length; -if(t=e.createCallback(t,u,4),ae(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=e.createCallback(t,u,4),Dt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Wt(n){var t=-1,r=n?n.length:0,e=ir(typeof r=="number"?r:0);return Pt(n,function(n){var r=pt(0,++t);e[t]=e[r],e[r]=n}),e}function zt(n,t,r){var u;if(t=e.createCallback(t,r,3),ae(n)){r=-1;for(var o=n.length;++r=y;m?(a&&(a=Or(a)),p=l,i=n.apply(f,o)):a||(a=Rr(e,y))}return m&&c?c=Or(c):c||t===g||(c=Rr(u,t)),r&&(m=true,i=n.apply(f,o)),!m||c||a||(o=f=null),i}}function Ut(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},e.assign=Ut,e.at=function(n,t){var r=arguments,e=-1,u=lt(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),Yr.unindexedChars&&nr(n)&&(n=n.split("")),r=ir(o);++e=q&&f(e?n[e]:l)))}var i=n[0],s=-1,g=i?i.length:0,h=[];n:for(;++s(m?r(m,c):a(l,c))){for(e=u,(m||l).push(c);--e;)if(m=o[e],0>(m?r(m,c):a(n[e],c)))continue n;h.push(c) -}}for(;u--;)(m=o[u])&&y(m);return v(o),v(l),h},e.invert=function(n,t){for(var r=-1,e=le(n),u=e.length,o={};++rr?Kr(0,e+r):Mr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=ur,e.noConflict=function(){return n._=jr,this},e.noop=or,e.now=pe,e.parseInt=ge,e.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Vr(),Mr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):pt(n,t) -},e.reduce=Lt,e.reduceRight=Bt,e.result=function(n,t){if(n){var r=n[t];return Qt(r)?n[t]():r}},e.runInContext=x,e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:le(n).length},e.some=zt,e.sortedIndex=Ot,e.template=function(n,t,r){var u=e.templateSettings;n=vr(n||""),r=Vt({},r,u);var o,a=Vt({},r.imports,u.imports),u=le(a),a=tr(a),i=0,l=r.interpolate||K,f="__p+='",l=hr((r.escape||K).source+"|"+l.source+"|"+(l===$?L:K).source+"|"+(r.evaluate||K).source+"|$","g");n.replace(l,function(t,r,e,u,a,l){return e||(e=u),f+=n.slice(i,l).replace(U,s),r&&(f+="'+__e("+r+")+'"),a&&(o=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t -}),f+="';",l=r=r.variable,l||(r="obj",f="with("+r+"){"+f+"}"),f=(o?f.replace(I,""):f).replace(N,"$1").replace(R,"$1;"),f="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=cr(u,"return "+f).apply(C,a)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},e.trim=fe,e.trimLeft=ce,e.trimRight=se,e.unescape=function(n){return null==n?"":(n=vr(n),0>n.indexOf(";")?n:n.replace(T,j)) -},e.uniqueId=function(n){var t=++E;return vr(null==n?"":n)+t},e.all=Nt,e.any=zt,e.detect=Tt,e.findWhere=Tt,e.foldl=Lt,e.foldr=Bt,e.include=It,e.inject=Lt,ur(function(){var n={};return Xt(e,function(t,r){e.prototype[r]||(n[r]=t)}),n}(),false),e.first=jt,e.last=function(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o;for(t=e.createCallback(t,r,3);a--&&t(n[a],a,n);)u++}else if(u=t,null==u||r)return n?n[o-1]:C;return u=o-u,kt(n,0"']/g,D=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,L=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,W=/^\s*function[ \n\r\t]+\w/,z=/^0[xX]/,K=/($^)/,M=/\bthis\b/,U=/['\n\r\t\u2028\u2029\\]/g,V="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),X="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",J="[object Boolean]",Q="[object Date]",Y="[object Error]",Z="[object Function]",nt="[object Number]",tt="[object Object]",rt="[object RegExp]",et="[object String]",ut={}; -ut[Z]=false,ut[G]=ut[H]=ut[J]=ut[Q]=ut[nt]=ut[tt]=ut[rt]=ut[et]=true;var ot={leading:false,maxWait:0,trailing:false},at={configurable:false,enumerable:false,value:null,writable:false},it={"&":"&","<":"<",">":">",'"':""","'":"'"},lt={"&":"&","<":"<",">":">",""":'"',"'":"'"},ft={"function":true,object:true},ct={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},st=ft[typeof window]&&window||this,pt=ft[typeof exports]&&exports&&!exports.nodeType&&exports,gt=ft[typeof global]&&global; -!gt||gt.global!==gt&>.window!==gt||(st=gt);var gt=(ft=ft[typeof module]&&module&&!module.nodeType&&module)&&ft.exports===pt&&pt,ht=x();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(st._=ht, define(function(){return ht})):pt&&ft?gt?(ft.exports=ht)._=ht:pt._=ht:st._=ht}).call(this); \ No newline at end of file +if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=g(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=g(),o.g=n,o.h=u,o.push=e;++te||13e||8202r||13r||8202=T&&o===t,l=[];if(i){var c=f(e);c?(o=r,e=c):i=false}for(;++uo(e,c)&&l.push(c);return i&&y(e),l}function gt(n,t,r){var e=-1,u=n,o=n?n.length:0;if(t=t&&typeof r=="undefined"?t:k(t,r,3),typeof o=="number")for(ue.unindexedChars&&ar(u)&&(u=u.split(""));++e=T&&a===t,s=u||c?p():l;for(c&&(s=f(s),a=r);++oa(s,h))&&((u||c)&&s.push(h),l.push(g)) +}return c?(v(s.g),y(s)):u&&v(s),l}function wt(n){return function(t,r,u){var o={};if(r=e.createCallback(r,u,3),pe(t)){u=-1;for(var a=t.length;++uu;u++)e+="m='"+n.d[u]+"';if((!(l&&o[m])&&h.call(q,m))",n.f||(e+="||(!o[m]&&q[m]!==r[m])"),e+="){"+n.c+"}"; +e+="}"}return t("a,f,g,h,j,k,r,p,v,w,y",r+(e+"return s;")+"}")(k,ut,Cr,Dr,Et,ur,kr,ee,ft,Or,Sr)}function Ct(){var n=(n=e.indexOf)===St?t:n;return n}function kt(n){return typeof n=="function"&&Ar.test(Tr.call(n))}function Ot(n){var t,r;return!n||Sr.call(n)!=it||!Dr.call(n,"constructor")&&(t=n.constructor,er(t)&&!(t instanceof t))||!ue.argsClass&&Et(n)||!ue.nodeClass&&h(n)?false:ue.ownLast?(se(n,function(n,t,e){return r=Dr.call(e,t),false}),false!==r):(se(n,function(n,t){r=t}),typeof r=="undefined"||Dr.call(n,r)) +}function Et(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n)==nt||false}function qt(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=e.createCallback(t,r,3);++ae?Hr(0,u+e):e||0;else if(e)return e=Nt(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function At(n,t,r){if(typeof t!="number"&&null!=t){var u=0,o=-1,a=n?n.length:0; +for(t=e.createCallback(t,r,3);++ot?t=Hr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Hr(u+r,0):r>u&&(r=u),u=r-t||0,r=gr(u);++e>>1,r(n[u])r?0:r);++t=e)return false;if(typeof n=="string"||!pe(n)&&ar(n))return Kr?Kr.call(n,t,r):-1r?Hr(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&ar(n)?u:e.createCallback(t,r,3),gt(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Ut(n,t,r,u){var o=3>arguments.length; +if(t=e.createCallback(t,u,4),pe(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=e.createCallback(t,u,4),zt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Xt(n){var t=-1,r=n?n.length:0,e=gr(typeof r=="number"?r:0);return Wt(n,function(n){var r=dt(0,++t);e[t]=e[r],e[r]=n}),e}function Gt(n,t,r){var u;if(t=e.createCallback(t,r,3),pe(n)){r=-1;for(var o=n.length;++r=y;m?(a&&(a=Nr(a)),p=l,i=n.apply(f,o)):a||(a=Lr(e,y))}return m&&c?c=Nr(c):c||t===g||(c=Lr(u,t)),r&&(m=true,i=n.apply(f,o)),!m||c||a||(o=f=null),i}}function Qt(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},e.assign=Qt,e.at=function(n,t){var r=arguments,e=-1,u=ht(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),ue.unindexedChars&&ar(n)&&(n=n.split("")),r=gr(o);++e=T&&f(e?n[e]:l)))}var i=n[0],s=-1,g=i?i.length:0,h=[];n:for(;++s(m?r(m,c):a(l,c))){for(e=u,(m||l).push(c);--e;)if(m=o[e],0>(m?r(m,c):a(n[e],c)))continue n;h.push(c) +}}for(;u--;)(m=o[u])&&y(m);return v(o),v(l),h},e.invert=function(n,t){for(var r=-1,e=he(n),u=e.length,o={};++rr?Hr(0,e+r):Jr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=cr,e.noConflict=function(){return n._=qr,this},e.noop=sr,e.now=de,e.parseInt=be,e.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Yr(),Jr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):dt(n,t) +},e.reduce=Ut,e.reduceRight=Vt,e.result=function(n,t){if(n){var r=n[t];return er(r)?n[t]():r}},e.runInContext=x,e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:he(n).length},e.some=Gt,e.sortedIndex=Nt,e.template=function(n,t,r){var u=e.templateSettings;n=wr(n||""),r=Yt({},r,u);var o,a=Yt({},r.imports,u.imports),u=he(a),a=ir(a),i=0,l=r.interpolate||H,f="__p+='",l=_r((r.escape||H).source+"|"+l.source+"|"+(l===M?U:H).source+"|"+(r.evaluate||H).source+"|$","g");n.replace(l,function(t,r,e,u,a,l){return e||(e=u),f+=n.slice(i,l).replace(Q,s),r&&(f+="'+__e("+r+")+'"),a&&(o=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t +}),f+="';",l=r=r.variable,l||(r="obj",f="with("+r+"){"+f+"}"),f=(o?f.replace(F,""):f).replace($,"$1").replace(L,"$1;"),f="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=yr(u,"return "+f).apply(C,a)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},e.trim=ve,e.trimLeft=ye,e.trimRight=me,e.unescape=function(n){return null==n?"":(n=wr(n),0>n.indexOf(";")?n:n.replace(B,j)) +},e.uniqueId=function(n){var t=++E;return wr(null==n?"":n)+t},e.all=$t,e.any=Gt,e.detect=Bt,e.findWhere=Bt,e.foldl=Ut,e.foldr=Vt,e.include=Ft,e.inject=Ut,cr(function(){var n={};return Zt(e,function(t,r){e.prototype[r]||(n[r]=t)}),n}(),false),e.first=qt,e.last=function(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o;for(t=e.createCallback(t,r,3);a--&&t(n[a],a,n);)u++}else if(u=t,null==u||r)return n?n[o-1]:C;return u=o-u,It(n,0"']/g,z=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,M=/<%=([\s\S]+?)%>/g,U=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,V=/\w*$/,X=/^\s*function[ \n\r\t]+\w/,G=/^0[xX]/,H=/($^)/,J=/\bthis\b/,Q=/['\n\r\t\u2028\u2029\\]/g,Y="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Z="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),nt="[object Arguments]",tt="[object Array]",rt="[object Boolean]",et="[object Date]",ut="[object Error]",ot="[object Function]",at="[object Number]",it="[object Object]",lt="[object RegExp]",ft="[object String]",ct={}; +ct[ot]=false,ct[nt]=ct[tt]=ct[rt]=ct[et]=ct[at]=ct[it]=ct[lt]=ct[ft]=true;var st={leading:false,maxWait:0,trailing:false},pt={configurable:false,enumerable:false,value:null,writable:false},gt={"&":"&","<":"<",">":">",'"':""","'":"'"},ht={"&":"&","<":"<",">":">",""":'"',"'":"'"},vt={"function":true,object:true},yt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},mt=vt[typeof window]&&window||this,dt=vt[typeof exports]&&exports&&!exports.nodeType&&exports,bt=vt[typeof global]&&global; +!bt||bt.global!==bt&&bt.window!==bt||(mt=bt);var bt=(vt=vt[typeof module]&&module&&!module.nodeType&&module)&&vt.exports===dt&&dt,_t=x();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(mt._=_t, define(function(){return _t})):dt&&vt?bt?(vt.exports=_t)._=_t:dt._=_t:mt._=_t}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 2b9d3283a..48429274a 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -19,11 +19,19 @@ /** Used to generate unique IDs */ var idCounter = 0; + /** Used to compose bitmasks for `__bindData__` */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_FLAG = 4, + CURRY_BOUND_FLAG = 8, + PARTIAL_FLAG = 16, + PARTIAL_RIGHT_FLAG = 32; + /** Used as the size when optimizations are enabled for large arrays */ - var largeArraySize = 75; + var LARGE_ARRAY_SIZE = 75; /** Used as the max size of the `arrayPool` and `objectPool` */ - var maxPoolSize = 40; + var MAX_POOL_SIZE = 40; /** Used to detect and test whitespace */ var whitespace = ( @@ -470,7 +478,7 @@ */ function releaseArray(array) { array.length = 0; - if (arrayPool.length < maxPoolSize) { + if (arrayPool.length < MAX_POOL_SIZE) { arrayPool.push(array); } } @@ -487,7 +495,7 @@ releaseObject(cache); } object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; - if (objectPool.length < maxPoolSize) { + if (objectPool.length < MAX_POOL_SIZE) { objectPool.push(object); } } @@ -1126,10 +1134,10 @@ thisArg = bindData[4], arity = bindData[5]; - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, key = func; function bound() { @@ -1144,8 +1152,9 @@ push.apply(args, partialRightArgs); } if (isCurry && args.length < arity) { - bitmask |= 16 & ~32; - return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~(BIND_FLAG | BIND_KEY_FLAG)), args, null, thisArg, arity]); } } args || (args = arguments); @@ -1176,7 +1185,7 @@ var index = -1, indexOf = getIndexOf(), length = array ? array.length : 0, - isLarge = length >= largeArraySize && indexOf === baseIndexOf, + isLarge = length >= LARGE_ARRAY_SIZE && indexOf === baseIndexOf, result = []; if (isLarge) { @@ -1510,7 +1519,7 @@ length = array ? array.length : 0, result = []; - var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + var isLarge = !isSorted && length >= LARGE_ARRAY_SIZE && indexOf === baseIndexOf, seen = (callback || isLarge) ? getArray() : result; if (isLarge) { @@ -1579,7 +1588,7 @@ * * @private * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of method flags to compose. + * @param {number} bitmask The bitmask of flags to compose. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -1596,12 +1605,12 @@ * @returns {Function} Returns the new function. */ function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, - isPartial = bitmask & 16, - isPartialRight = bitmask & 32; + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, + isPartial = bitmask & PARTIAL_FLAG, + isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isBindKey && !isFunction(func)) { throw new TypeError; @@ -1625,15 +1634,15 @@ bindData[3] = slice(bindData[3]); } // set `thisBinding` is not previously bound - if (isBind && !(bindData[1] & 1)) { + if (isBind && !(bindData[1] & BIND_FLAG)) { bindData[4] = thisArg; } // set if previously bound but not currently (subsequent curried functions) - if (!isBind && bindData[1] & 1) { + if (!isBind && bindData[1] & BIND_FLAG) { bitmask |= 8; } // set curried arity if not yet set - if (isCurry && !(bindData[1] & 4)) { + if (isCurry && !(bindData[1] & CURRY_FLAG)) { bindData[5] = arity; } // append partial left arguments @@ -1649,7 +1658,7 @@ return createWrapper.apply(null, bindData); } // fast path for `_.bind` - var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + var creater = (bitmask == BIND_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) ? baseBind : baseCreateWrapper; return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); } @@ -2187,7 +2196,7 @@ var value = arguments[argsIndex]; if (isArray(value) || isArguments(value)) { args.push(value); - caches.push(trustIndexOf && value.length >= largeArraySize && + caches.push(trustIndexOf && value.length >= LARGE_ARRAY_SIZE && createCache(argsIndex ? args[argsIndex] : seen)); } } @@ -4241,8 +4250,8 @@ */ function bind(func, thisArg) { return arguments.length > 2 - ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) - : createWrapper(func, 1, null, null, thisArg); + ? createWrapper(func, BIND_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, thisArg) + : createWrapper(func, BIND_FLAG, null, null, thisArg); } /** @@ -4278,7 +4287,7 @@ while (++index < length) { var key = funcs[index]; - object[key] = createWrapper(object[key], 1, null, null, object); + object[key] = createWrapper(object[key], BIND_FLAG, null, null, object); } return object; } @@ -4320,8 +4329,8 @@ */ function bindKey(object, key) { return arguments.length > 2 - ? createWrapper(key, 19, slice(arguments, 2), null, object) - : createWrapper(key, 3, null, null, object); + ? createWrapper(key, BIND_FLAG | BIND_KEY_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, object) + : createWrapper(key, BIND_FLAG | BIND_KEY_FLAG, null, null, object); } /** @@ -4406,7 +4415,7 @@ */ function curry(func, arity) { arity = typeof arity == 'number' ? arity : (+arity || func.length); - return createWrapper(func, 4, null, null, null, arity); + return createWrapper(func, CURRY_FLAG, null, null, null, arity); } /** @@ -4708,7 +4717,7 @@ * // => 'hi fred' */ function partial(func) { - return createWrapper(func, 16, slice(arguments, 1)); + return createWrapper(func, PARTIAL_FLAG, slice(arguments, 1)); } /** @@ -4742,7 +4751,7 @@ * // => { '_': _, 'jq': $ } */ function partialRight(func) { - return createWrapper(func, 32, null, slice(arguments, 1)); + return createWrapper(func, PARTIAL_RIGHT_FLAG, null, slice(arguments, 1)); } /** @@ -4818,7 +4827,7 @@ * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { - return createWrapper(wrapper, 16, [value]); + return createWrapper(wrapper, PARTIAL_FLAG, [value]); } /*--------------------------------------------------------------------------*/ diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 33ec7ba08..a728edcff 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -5,55 +5,55 @@ */ ;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=A&&o===t,f=[];if(a){var c=l(e);c?(o=r,e=c):a=false}for(;++uo(e,c)&&f.push(c);return a&&v(e),f}function it(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e=A&&i===t,p=u||c?s():f;for(c&&(p=l(p),i=r);++oi(p,y))&&((u||c)&&p.push(y),f.push(g))}return c?(h(p.g),v(p)):u&&h(p),f}function gt(n){return function(t,r,e){var u={};r=i.createCallback(r,e,3),e=-1;var o=t?t.length:0;if(typeof o=="number")for(;++ee?qr(0,u+e):e||0;else if(e)return e=kt(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function wt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=i.createCallback(t,r,3);++ut?t=qr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=qr(u+r,0):r>u&&(r=u),u=r-t||0,r=ur(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!Zr(n)&&Qt(n))return Sr?Sr.call(n,t,r):-1r?qr(0,e+r):r)||0,-1o&&(o=f)}else t=null==t&&Qt(n)?u:i.createCallback(t,r,3),St(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function $t(n,t,r,e){var u=3>arguments.length;t=i.createCallback(t,e,4);var o=-1,a=n?n.length:0;if(typeof a=="number")for(u&&a&&(r=n[++o]);++oarguments.length;return t=i.createCallback(t,e,4),Tt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function qt(n){var t=-1,r=n?n.length:0,e=ur(typeof r=="number"?r:0); -return St(n,function(n){var r=ct(0,++t);e[t]=e[r],e[r]=n}),e}function Wt(n,t,r){var e;t=i.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r=y;m?(i&&(i=jr(i)),s=f,a=n.apply(l,o)):i||(i=Er(e,y))}return m&&c?c=jr(c):c||t===g||(c=Er(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Pt(n,t,r){var e=arguments,u=0,o=e.length,i=typeof r; -if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},i.assign=Pt,i.at=function(n,t){var r=arguments,e=-1,u=it(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=ur(o);++e=A&&l(e?n[e]:f)))}var a=n[0],p=-1,g=a?a.length:0,y=[];n:for(;++p(m?r(m,c):i(f,c))){for(e=u,(m||f).push(c);--e;)if(m=o[e],0>(m?r(m,c):i(n[e],c)))continue n;y.push(c) -}}for(;u--;)(m=o[u])&&v(m);return h(o),h(f),y},i.invert=function(n,t){for(var r=-1,e=te(n),u=e.length,o={};++rr?qr(0,e+r):Wr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},i.mixin=tr,i.noConflict=function(){return n._=br,this},i.noop=rr,i.now=oe,i.parseInt=ie,i.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Lr(),Wr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):ct(n,t)},i.reduce=$t,i.reduceRight=Bt,i.result=function(n,t){if(n){var r=n[t]; -return Gt(r)?n[t]():r}},i.runInContext=j,i.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:te(n).length},i.some=Wt,i.sortedIndex=kt,i.template=function(n,t,r){var e=i.templateSettings;n=sr(n||""),r=Kt({},r,e);var u,o=Kt({},r.imports,e.imports),e=te(o),o=Yt(o),a=0,f=r.interpolate||P,l="__p+='",f=pr((r.escape||P).source+"|"+f.source+"|"+(f===B?q:P).source+"|"+(r.evaluate||P).source+"|$","g");n.replace(f,function(t,r,e,o,i,f){return e||(e=o),l+=n.slice(a,f).replace(M,p),r&&(l+="'+__e("+r+")+'"),i&&(u=true,l+="';"+i+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t -}),l+="';",f=r=r.variable,f||(r="obj",l="with("+r+"){"+l+"}"),l=(u?l.replace(R,""):l).replace(I,"$1").replace(S,"$1;"),l="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ar(e,"return "+l).apply(k,o)}catch(s){throw s.source=l,s}return t?c(t):(c.source=l,c)},i.trim=re,i.trimLeft=ee,i.trimRight=ue,i.unescape=function(n){return null==n?"":(n=sr(n),0>n.indexOf(";")?n:n.replace(T,w)) -},i.uniqueId=function(n){var t=++O;return sr(null==n?"":n)+t},i.all=Nt,i.any=Wt,i.detect=It,i.findWhere=It,i.foldl=$t,i.foldr=Bt,i.include=Et,i.inject=$t,tr(function(){var n={};return Mt(i,function(t,r){i.prototype[r]||(n[r]=t)}),n}(),false),i.first=dt,i.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=i.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:k;return e=u-e,jt(n,0"']/g,F=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,B=/<%=([\s\S]+?)%>/g,q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,W=/\w*$/,z=/^\s*function[ \n\r\t]+\w/,L=/^0[xX]/,P=/($^)/,K=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,U="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),V="[object Arguments]",X="[object Array]",G="[object Boolean]",H="[object Date]",J="[object Function]",Q="[object Number]",Y="[object Object]",Z="[object RegExp]",nt="[object String]",tt={}; -tt[J]=false,tt[V]=tt[X]=tt[G]=tt[H]=tt[Q]=tt[Y]=tt[Z]=tt[nt]=true;var rt={leading:false,maxWait:0,trailing:false},et={configurable:false,enumerable:false,value:null,writable:false},ut={"&":"&","<":"<",">":">",'"':""","'":"'"},ot={"&":"&","<":"<",">":">",""":'"',"'":"'"},it={"function":true,object:true},at={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ft=it[typeof window]&&window||this,lt=it[typeof exports]&&exports&&!exports.nodeType&&exports,ct=it[typeof global]&&global; -!ct||ct.global!==ct&&ct.window!==ct||(ft=ct);var ct=(it=it[typeof module]&&module&&!module.nodeType&&module)&&it.exports===lt&<,pt=j();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ft._=pt, define(function(){return pt})):lt&&it?ct?(it.exports=pt)._=pt:lt._=pt:ft._=pt}).call(this); \ No newline at end of file +if(u&&typeof u=="object"&&o&&typeof o=="object"&&i&&typeof i=="object")return false;for(u=g(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=g(),o.g=n,o.h=u,o.push=e;++te||13e||8202r||13r||8202=T&&o===t,f=[];if(a){var c=l(e);c?(o=r,e=c):a=false}for(;++uo(e,c)&&f.push(c);return a&&v(e),f}function st(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e=T&&i===t,p=u||c?s():f;for(c&&(p=l(p),i=r);++oi(p,y))&&((u||c)&&p.push(y),f.push(g))}return c?(h(p.g),v(p)):u&&h(p),f}function dt(n){return function(t,r,e){var u={};r=i.createCallback(r,e,3),e=-1;var o=t?t.length:0;if(typeof o=="number")for(;++ee?Mr(0,u+e):e||0;else if(e)return e=Nt(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function At(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=i.createCallback(t,r,3);++ut?t=Mr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Mr(u+r,0):r>u&&(r=u),u=r-t||0,r=cr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!oe(n)&&er(n))return qr?qr.call(n,t,r):-1r?Mr(0,e+r):r)||0,-1o&&(o=f)}else t=null==t&&er(n)?u:i.createCallback(t,r,3),qt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function Pt(n,t,r,e){var u=3>arguments.length;t=i.createCallback(t,e,4);var o=-1,a=n?n.length:0;if(typeof a=="number")for(u&&a&&(r=n[++o]);++oarguments.length;return t=i.createCallback(t,e,4),Wt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Mt(n){var t=-1,r=n?n.length:0,e=cr(typeof r=="number"?r:0); +return qt(n,function(n){var r=yt(0,++t);e[t]=e[r],e[r]=n}),e}function Ut(n,t,r){var e;t=i.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r=y;m?(i&&(i=Er(i)),s=f,a=n.apply(l,o)):i||(i=Dr(e,y))}return m&&c?c=Er(c):c||t===g||(c=Dr(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Gt(n,t,r){var e=arguments,u=0,o=e.length,i=typeof r; +if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},i.assign=Gt,i.at=function(n,t){var r=arguments,e=-1,u=st(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=cr(o);++e=T&&l(e?n[e]:f)))}var a=n[0],p=-1,g=a?a.length:0,y=[];n:for(;++p(m?r(m,c):i(f,c))){for(e=u,(m||f).push(c);--e;)if(m=o[e],0>(m?r(m,c):i(n[e],c)))continue n;y.push(c) +}}for(;u--;)(m=o[u])&&v(m);return h(o),h(f),y},i.invert=function(n,t){for(var r=-1,e=ae(n),u=e.length,o={};++rr?Mr(0,e+r):Ur(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},i.mixin=ar,i.noConflict=function(){return n._=xr,this},i.noop=fr,i.now=pe,i.parseInt=se,i.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Xr(),Ur(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):yt(n,t)},i.reduce=Pt,i.reduceRight=Kt,i.result=function(n,t){if(n){var r=n[t]; +return nr(r)?n[t]():r}},i.runInContext=j,i.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ae(n).length},i.some=Ut,i.sortedIndex=Nt,i.template=function(n,t,r){var e=i.templateSettings;n=br(n||""),r=Ht({},r,e);var u,o=Ht({},r.imports,e.imports),e=ae(o),o=ur(o),a=0,f=r.interpolate||G,l="__p+='",f=mr((r.escape||G).source+"|"+f.source+"|"+(f===K?M:G).source+"|"+(r.evaluate||G).source+"|$","g");n.replace(f,function(t,r,e,o,i,f){return e||(e=o),l+=n.slice(a,f).replace(J,p),r&&(l+="'+__e("+r+")+'"),i&&(u=true,l+="';"+i+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t +}),l+="';",f=r=r.variable,f||(r="obj",l="with("+r+"){"+l+"}"),l=(u?l.replace($,""):l).replace(B,"$1").replace(q,"$1;"),l="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=gr(e,"return "+l).apply(k,o)}catch(s){throw s.source=l,s}return t?c(t):(c.source=l,c)},i.trim=fe,i.trimLeft=le,i.trimRight=ce,i.unescape=function(n){return null==n?"":(n=br(n),0>n.indexOf(";")?n:n.replace(W,w)) +},i.uniqueId=function(n){var t=++O;return br(null==n?"":n)+t},i.all=Ft,i.any=Ut,i.detect=Bt,i.findWhere=Bt,i.foldl=Pt,i.foldr=Kt,i.include=Dt,i.inject=Pt,ar(function(){var n={};return Jt(i,function(t,r){i.prototype[r]||(n[r]=t)}),n}(),false),i.first=Ct,i.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=i.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:k;return e=u-e,Et(n,0"']/g,L=/<%-([\s\S]+?)%>/g,P=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,M=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,U=/\w*$/,V=/^\s*function[ \n\r\t]+\w/,X=/^0[xX]/,G=/($^)/,H=/\bthis\b/,J=/['\n\r\t\u2028\u2029\\]/g,Q="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Y="[object Arguments]",Z="[object Array]",nt="[object Boolean]",tt="[object Date]",rt="[object Function]",et="[object Number]",ut="[object Object]",ot="[object RegExp]",it="[object String]",at={}; +at[rt]=false,at[Y]=at[Z]=at[nt]=at[tt]=at[et]=at[ut]=at[ot]=at[it]=true;var ft={leading:false,maxWait:0,trailing:false},lt={configurable:false,enumerable:false,value:null,writable:false},ct={"&":"&","<":"<",">":">",'"':""","'":"'"},pt={"&":"&","<":"<",">":">",""":'"',"'":"'"},st={"function":true,object:true},gt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ht=st[typeof window]&&window||this,vt=st[typeof exports]&&exports&&!exports.nodeType&&exports,yt=st[typeof global]&&global; +!yt||yt.global!==yt&&yt.window!==yt||(ht=yt);var yt=(st=st[typeof module]&&module&&!module.nodeType&&module)&&st.exports===vt&&vt,mt=j();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ht._=mt, define(function(){return mt})):vt&&st?yt?(st.exports=mt)._=mt:vt._=mt:ht._=mt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 6a8592b91..84dd0e310 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -18,6 +18,14 @@ /** Used by methods to exit iteration */ var breakIndicator = '__lodash_break_1335248838000__'; + /** Used to compose bitmasks for `__bindData__` */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_FLAG = 4, + CURRY_BOUND_FLAG = 8, + PARTIAL_FLAG = 16, + PARTIAL_RIGHT_FLAG = 32; + /** Used to match HTML entities and HTML characters */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/g, reUnescapedHtml = /[&<>"']/g; @@ -509,10 +517,10 @@ thisArg = bindData[4], arity = bindData[5]; - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, key = func; function bound() { @@ -527,8 +535,9 @@ push.apply(args, partialRightArgs); } if (isCurry && args.length < arity) { - bitmask |= 16 & ~32; - return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~(BIND_FLAG | BIND_KEY_FLAG)), args, null, thisArg, arity]); } } args || (args = arguments); @@ -819,7 +828,7 @@ * * @private * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of method flags to compose. + * @param {number} bitmask The bitmask of flags to compose. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -836,12 +845,12 @@ * @returns {Function} Returns the new function. */ function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, - isPartial = bitmask & 16, - isPartialRight = bitmask & 32; + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, + isPartial = bitmask & PARTIAL_FLAG, + isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isBindKey && !isFunction(func)) { throw new TypeError; @@ -855,7 +864,7 @@ isPartialRight = partialRightArgs = false; } // fast path for `_.bind` - var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + var creater = (bitmask == BIND_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) ? baseBind : baseCreateWrapper; return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); } @@ -3073,8 +3082,8 @@ */ function bind(func, thisArg) { return arguments.length > 2 - ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) - : createWrapper(func, 1, null, null, thisArg); + ? createWrapper(func, BIND_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, thisArg) + : createWrapper(func, BIND_FLAG, null, null, thisArg); } /** @@ -3110,7 +3119,7 @@ while (++index < length) { var key = funcs[index]; - object[key] = createWrapper(object[key], 1, null, null, object); + object[key] = createWrapper(object[key], BIND_FLAG, null, null, object); } return object; } @@ -3458,7 +3467,7 @@ * // => 'hi fred' */ function partial(func) { - return createWrapper(func, 16, slice(arguments, 1)); + return createWrapper(func, PARTIAL_FLAG, slice(arguments, 1)); } /** @@ -3535,7 +3544,7 @@ * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { - return createWrapper(wrapper, 16, [value]); + return createWrapper(wrapper, PARTIAL_FLAG, [value]); } /*--------------------------------------------------------------------------*/ diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 7cbcf0bd9..936f36880 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,38 +3,38 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` */ -;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(te(r,i)&&o.push(i)}return o}function s(n,r,t,e){e=(e||0)-1; -for(var u=n?n.length:0,o=[];++eu(f,c))&&(t&&f.push(c),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=X(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++ee?Ur(0,u+e):e||0;else if(e)return e=T(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function j(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=X(r,t,3);++ur?r=Ur(u+r,0):r>u&&(r=u),typeof t=="undefined"?t=u:0>t?t=Ur(u+t,0):t>u&&(t=u),u=t-r||0,t=Array(u);++e>>1,t(n[e])e||typeof t=="undefined"){t=1;break n}if(te(r,i)&&o.push(i)}return o +}function s(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++eu(f,c))&&(t&&f.push(c),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=X(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++ee?Lr(0,u+e):e||0;else if(e)return e=T(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function j(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=X(r,t,3);++ur?r=Lr(u+r,0):r>u&&(r=u),typeof t=="undefined"?t=u:0>t?t=Lr(u+t,0):t>u&&(t=u),u=t-r||0,t=Array(u);++e>>1,t(n[e])u&&(u=t); -else r=X(r,t,3),N(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function R(n,r,t,e){var u=3>arguments.length;r=X(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number")for(u&&i&&(t=n[++o]);++oarguments.length;return r=X(r,e,4),q(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function I(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return N(n,function(n){var t;t=++r,t=0+Fr(Gr()*(t-0+1)),e[r]=e[t],e[t]=n -}),e}function M(n,r,t){var e;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t=y;m?(u&&(u=clearTimeout(u)),l=i,o=n.apply(f,e)):u||(u=setTimeout(h,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(v,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o -}}function C(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t;for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,fr=/($^)/,ar=/['\n\r\t\u2028\u2029\\]/g,cr="[object Arguments]",lr="[object Array]",pr="[object Boolean]",sr="[object Date]",gr="[object Number]",vr="[object Object]",hr="[object RegExp]",yr="[object String]",mr={"&":"&","<":"<",">":">",'"':""","'":"'"},_r={"&":"&","<":"<",">":">",""":'"',"'":"'"},br={"function":true,object:true},dr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},wr=br[typeof window]&&window||this,jr=br[typeof exports]&&exports&&!exports.nodeType&&exports,xr=br[typeof global]&&global; -!xr||xr.global!==xr&&xr.window!==xr||(wr=xr);var Tr=br[typeof module]&&module&&!module.nodeType&&module,Ar=Tr&&Tr.exports===jr&&jr,Er=Array.prototype,Or=Object.prototype,kr=wr._,Sr=Or.toString,Nr=RegExp("^"+(Sr+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qr=Math.ceil,Fr=Math.floor,Br=Function.prototype.toString,Rr=Or.hasOwnProperty,$r=Er.push,Ir=Or.propertyIsEnumerable,Mr=Er.splice,Dr=_(Dr=Object.create)&&Dr,Wr=_(Wr=Array.isArray)&&Wr,zr=wr.isFinite,Cr=wr.isNaN,Pr=_(Pr=Object.keys)&&Pr,Ur=Math.max,Vr=Math.min,Gr=Math.random; -i.prototype=o.prototype;var Hr={};!function(){var n={0:1,length:1};Hr.spliceObjects=(Mr.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Dr||(a=function(){function n(){}return function(r){if(J(r)){n.prototype=r;var t=new n;n.prototype=null}return t||wr.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Rr.call(n,"callee")&&!Ir.call(n,"callee")||false});var Jr=function(n){var r=[]; -if(!J(n))return r;for(var t in n)Rr.call(n,t)&&r.push(t);return r},Kr=h(function(n,r,t){Rr.call(n,t)?n[t]++:n[t]=1}),Lr=h(function(n,r,t){Rr.call(n,t)?n[t].push(r):n[t]=[r]}),Qr=h(function(n,r,t){n[t]=r}),Xr=F,Yr=function(n,r){if(!J(n))return n;for(var t in n)if(r(n[t],t,n)===ur)break;return n},Zr=Wr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n)==lr||false};H(/x/)&&(H=function(n){return typeof n=="function"&&"[object Function]"==Sr.call(n)});var nt=Pr?function(n){return J(n)?Pr(n):[] -}:Jr,rt=_(rt=Date.now)&&rt||function(){return(new Date).getTime()};o.after=function(n,r){if(!H(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=W,o.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},o.invert=function(n){for(var r=-1,t=nt(n),e=t.length,u={};++rr?0:r);++nt?Ur(0,e+t):Vr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=nr,o.noConflict=function(){return wr._=kr,this},o.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Fr(Gr()*(r-n+1))},o.reduce=R,o.reduceRight=$,o.result=function(n,r){if(n){var t=n[r]; -return H(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:nt(n).length},o.some=M,o.sortedIndex=T,o.template=function(n,r,t){var u=o,i=u.templateSettings;n=(n||"")+"",t=P({},t,i);var f=0,a="__p+='",i=t.variable;n.replace(RegExp((t.escape||fr).source+"|"+(t.interpolate||fr).source+"|"+(t.evaluate||fr).source+"|$","g"),function(r,t,u,o,i){return a+=n.slice(f,i).replace(ar,e),t&&(a+="'+_.escape("+t+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r -}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var c=Function("_","return "+a)(u)}catch(l){throw l.source=a,l}return r?c(r):(c.source=a,c)},o.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(or,u))},o.uniqueId=function(n){var r=++er+"";return n?n+r:r},o.all=O,o.any=M,o.detect=S,o.findWhere=function(n,r){return D(n,r,true)},o.foldl=R,o.foldr=$,o.include=E,o.inject=R,o.first=d,o.last=function(n,r,t){var e=0,u=n?n.length:0; -if(typeof r!="number"&&null!=r){var o=u;for(r=X(r,t,3);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[u-1]:tr;return e=u-e,x(n,0u&&(u=t); +else r=X(r,t,3),N(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function R(n,r,t,e){var u=3>arguments.length;r=X(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number")for(u&&i&&(t=n[++o]);++oarguments.length;return r=X(r,e,4),q(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function I(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return N(n,function(n){var t;t=++r,t=0+Dr(Xr()*(t-0+1)),e[r]=e[t],e[t]=n +}),e}function M(n,r,t){var e;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t=y;m?(u&&(u=clearTimeout(u)),l=i,o=n.apply(f,e)):u||(u=setTimeout(h,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(v,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o +}}function C(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t;for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,gr=/($^)/,vr=/['\n\r\t\u2028\u2029\\]/g,hr="[object Arguments]",yr="[object Array]",mr="[object Boolean]",_r="[object Date]",br="[object Number]",dr="[object Object]",wr="[object RegExp]",jr="[object String]",xr={"&":"&","<":"<",">":">",'"':""","'":"'"},Tr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ar={"function":true,object:true},Er={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Or=Ar[typeof window]&&window||this,kr=Ar[typeof exports]&&exports&&!exports.nodeType&&exports,Sr=Ar[typeof global]&&global; +!Sr||Sr.global!==Sr&&Sr.window!==Sr||(Or=Sr);var Nr=Ar[typeof module]&&module&&!module.nodeType&&module,qr=Nr&&Nr.exports===kr&&kr,Fr=Array.prototype,Br=Object.prototype,Rr=Or._,$r=Br.toString,Ir=RegExp("^"+($r+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mr=Math.ceil,Dr=Math.floor,Wr=Function.prototype.toString,zr=Br.hasOwnProperty,Cr=Fr.push,Pr=Br.propertyIsEnumerable,Ur=Fr.splice,Vr=_(Vr=Object.create)&&Vr,Gr=_(Gr=Array.isArray)&&Gr,Hr=Or.isFinite,Jr=Or.isNaN,Kr=_(Kr=Object.keys)&&Kr,Lr=Math.max,Qr=Math.min,Xr=Math.random; +i.prototype=o.prototype;var Yr={};!function(){var n={0:1,length:1};Yr.spliceObjects=(Ur.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Vr||(a=function(){function n(){}return function(r){if(J(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Or.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&zr.call(n,"callee")&&!Pr.call(n,"callee")||false});var Zr=function(n){var r=[]; +if(!J(n))return r;for(var t in n)zr.call(n,t)&&r.push(t);return r},nt=h(function(n,r,t){zr.call(n,t)?n[t]++:n[t]=1}),rt=h(function(n,r,t){zr.call(n,t)?n[t].push(r):n[t]=[r]}),tt=h(function(n,r,t){n[t]=r}),et=F,ut=function(n,r){if(!J(n))return n;for(var t in n)if(r(n[t],t,n)===ur)break;return n},ot=Gr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&$r.call(n)==yr||false};H(/x/)&&(H=function(n){return typeof n=="function"&&"[object Function]"==$r.call(n)});var it=Kr?function(n){return J(n)?Kr(n):[] +}:Zr,ft=_(ft=Date.now)&&ft||function(){return(new Date).getTime()};o.after=function(n,r){if(!H(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=W,o.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},o.invert=function(n){for(var r=-1,t=it(n),e=t.length,u={};++rr?0:r);++nt?Lr(0,e+t):Qr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=nr,o.noConflict=function(){return Or._=Rr,this},o.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Dr(Xr()*(r-n+1))},o.reduce=R,o.reduceRight=$,o.result=function(n,r){if(n){var t=n[r]; +return H(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:it(n).length},o.some=M,o.sortedIndex=T,o.template=function(n,r,t){var u=o,i=u.templateSettings;n=(n||"")+"",t=P({},t,i);var f=0,a="__p+='",i=t.variable;n.replace(RegExp((t.escape||gr).source+"|"+(t.interpolate||gr).source+"|"+(t.evaluate||gr).source+"|$","g"),function(r,t,u,o,i){return a+=n.slice(f,i).replace(vr,e),t&&(a+="'+_.escape("+t+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r +}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var c=Function("_","return "+a)(u)}catch(l){throw l.source=a,l}return r?c(r):(c.source=a,c)},o.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(pr,u))},o.uniqueId=function(n){var r=++er+"";return n?n+r:r},o.all=O,o.any=M,o.detect=S,o.findWhere=function(n,r){return D(n,r,true)},o.foldl=R,o.foldr=$,o.include=E,o.inject=R,o.first=d,o.last=function(n,r,t){var e=0,u=n?n.length:0; +if(typeof r!="number"&&null!=r){var o=u;for(r=X(r,t,3);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[u-1]:tr;return e=u-e,x(n,0 ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2114 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2109 "View in source") [Ⓣ][1] Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are all falsey. @@ -276,7 +276,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2144 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2139 "View in source") [Ⓣ][1] Creates an array excluding all values of the provided arrays using strict equality for comparisons, i.e. `===`. @@ -301,7 +301,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]); ### `_.findIndex(array, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2189 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2184 "View in source") [Ⓣ][1] This method is like `_.find` except that it returns the index of the first element that passes the callback check, instead of the element itself. @@ -347,7 +347,7 @@ _.findIndex(characters, 'blocked'); ### `_.findLastIndex(array, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2243 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2238 "View in source") [Ⓣ][1] This method is like `_.findIndex` except that it iterates over elements of a `collection` from right to left. @@ -393,7 +393,7 @@ _.findLastIndex(characters, 'blocked'); ### `_.first(array, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2307 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2302 "View in source") [Ⓣ][1] Gets the first element or first `n` elements of an array. If a callback is provided elements at the beginning of the array are returned as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -450,7 +450,7 @@ _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); ### `_.flatten(array, [isShallow=false], [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2368 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2363 "View in source") [Ⓣ][1] Flattens a nested array *(the nesting can be to any depth)*. If `isShallow` is truey, the array will only be flattened a single level. If a callback is provided each element of the array is passed through the callback before flattening. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -494,7 +494,7 @@ _.flatten(characters, 'pets'); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2407 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2410 "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 providing `true` for `fromIndex` will run a faster binary search. @@ -528,7 +528,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true); ### `_.initial(array, [callback=1], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2470 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2473 "View in source") [Ⓣ][1] Gets all but the last element or last `n` elements of an array. If a callback is provided elements at the end of the array are excluded from the result as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -582,7 +582,7 @@ _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); ### `_.intersection([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2501 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2504 "View in source") [Ⓣ][1] Creates an array of unique values present in all provided arrays using strict equality for comparisons, i.e. `===`. @@ -606,7 +606,7 @@ _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); ### `_.last(array, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2603 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2606 "View in source") [Ⓣ][1] Gets the last element or last `n` elements of an array. If a callback is provided elements at the end of the array are returned as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -660,7 +660,7 @@ _.last(characters, { 'employer': 'na' }); ### `_.lastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2651 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2654 "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. @@ -694,7 +694,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); ### `_.pull(array, [value])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2681 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2684 "View in source") [Ⓣ][1] Removes all provided values from `array` using strict equality for comparisons, i.e. `===`. @@ -721,7 +721,7 @@ console.log(array); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2732 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2735 "View in source") [Ⓣ][1] Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. If `start` is less than `stop` a zero-length range is created unless a negative `step` is specified. @@ -762,7 +762,7 @@ _.range(0); ### `_.remove(array, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2785 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2788 "View in source") [Ⓣ][1] Removes all elements from an array that the callback returns truey for and returns an array of removed elements. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -798,7 +798,7 @@ console.log(evens); ### `_.rest(array, [callback=1], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2856 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2859 "View in source") [Ⓣ][1] The opposite of `_.initial`; this method gets all but the first element or first `n` elements of an array. If a callback function is provided elements at the beginning of the array are excluded from the result as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -855,7 +855,7 @@ _.rest(characters, { 'employer': 'slate' }); ### `_.slice(array, [start=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2888 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2891 "View in source") [Ⓣ][1] Slices `array` from the `start` index up to, but not including, the `end` index. @@ -877,7 +877,7 @@ Note: This function is used instead of `Array#slice` to support node lists in IE ### `_.sortedIndex(array, value, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2965 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2968 "View in source") [Ⓣ][1] Uses a binary search to determine the smallest index at which a value should be inserted into a given sorted array in order to maintain the sort order of the array. If a callback is provided it will be executed for `value` and each element of `array` to compute their sort ranking. The callback is bound to `thisArg` and invoked with one argument; *(value)*. @@ -928,7 +928,7 @@ _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); ### `_.union([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2996 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2999 "View in source") [Ⓣ][1] Creates an array of unique values, in order, of the provided arrays using strict equality for comparisons, i.e. `===`. @@ -952,7 +952,7 @@ _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); ### `_.uniq(array, [isSorted=false], [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3047 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3050 "View in source") [Ⓣ][1] Creates a duplicate-value-free version of an array using strict equality for comparisons, i.e. `===`. If the array is sorted, providing `true` for `isSorted` will use a faster algorithm. If a callback is provided 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)*. @@ -1002,7 +1002,7 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.without(array, [value])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3075 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3086 "View in source") [Ⓣ][1] Creates an array excluding all provided values using strict equality for comparisons, i.e. `===`. @@ -1027,7 +1027,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); ### `_.xor([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3096 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3107 "View in source") [Ⓣ][1] Creates an array that is the symmetric difference of the provided arrays. See [Wikipedia](http://en.wikipedia.org/wiki/Symmetric_difference) for more details. @@ -1054,7 +1054,7 @@ _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); ### `_.zip([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3131 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3142 "View in source") [Ⓣ][1] Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on. If a zipped value is provided its corresponding unzipped value will be returned. @@ -1084,7 +1084,7 @@ _.unzip([['fred', 30, true], ['barney', 40, false]]); ### `_.zipObject(keys, [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3161 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3172 "View in source") [Ⓣ][1] Creates an object composed from arrays of `keys` and `values`. Provide either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` or two arrays, one of `keys` and one of corresponding `values`. @@ -1119,7 +1119,7 @@ _.zipObject(['fred', 'barney'], [30, 40]); ### `_(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L833 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L827 "View in source") [Ⓣ][1] Creates a `lodash` object which wraps the given value to enable intuitive method chaining. @@ -1174,7 +1174,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3206 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3217 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps `value` with explicit method chaining enabled. @@ -1208,7 +1208,7 @@ var youngest = _.chain(characters) ### `_.tap(value, interceptor, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3233 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3244 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is bound to `thisArg` and invoked with one argument; *(value)*. The purpose of this method is to "tap into" a method chain in order to perform operations on intermediate results within the chain. @@ -1237,7 +1237,7 @@ _([1, 2, 3, 4]) ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3263 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3274 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -1271,7 +1271,7 @@ _(characters).chain() ### `_.prototype.toString()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3280 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3291 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. @@ -1292,7 +1292,7 @@ _([1, 2, 3]).toString(); ### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3297 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3308 "View in source") [Ⓣ][1] Extracts the wrapped value. @@ -1323,7 +1323,7 @@ _([1, 2, 3]).valueOf(); ### `_.at(collection, [index])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3325 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3336 "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. @@ -1351,7 +1351,7 @@ _.at(['fred', 'barney', 'pebbles'], 0, 2); ### `_.contains(collection, target, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3368 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3385 "View in source") [Ⓣ][1] Checks if a given value 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. @@ -1389,7 +1389,7 @@ _.contains('pebbles', 'eb'); ### `_.countBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3431 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3448 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` through the 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)*. @@ -1425,7 +1425,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3476 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3493 "View in source") [Ⓣ][1] Checks if the callback returns truey value for **all** elements of a collection. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1471,7 +1471,7 @@ _.every(characters, { 'age': 36 }); ### `_.filter(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3537 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3554 "View in source") [Ⓣ][1] Iterates over elements of a collection, returning an array of all elements the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1517,7 +1517,7 @@ _.filter(characters, { 'age': 36 }); ### `_.find(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3604 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3621 "View in source") [Ⓣ][1] Iterates over elements of a collection, returning the first element that the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1566,7 +1566,7 @@ _.find(characters, 'blocked'); ### `_.findLast(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3649 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3666 "View in source") [Ⓣ][1] This method is like `_.find` except that it iterates over elements of a `collection` from right to left. @@ -1594,7 +1594,7 @@ _.findLast([1, 2, 3, 4], function(num) { ### `_.forEach(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3687 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3704 "View in source") [Ⓣ][1] Iterates over elements of a collection, executing the callback for each element. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -1628,7 +1628,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); ### `_.forEachRight(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3720 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3737 "View in source") [Ⓣ][1] This method is like `_.forEach` except that it iterates over elements of a `collection` from right to left. @@ -1657,7 +1657,7 @@ _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); ### `_.groupBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3781 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3798 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of a collection through the callback. The corresponding value of each key is an array of the elements responsible for generating the key. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1694,7 +1694,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.indexBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3828 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3845 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of the collection through the given callback. The corresponding value of each key is the last element responsible for generating the key. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1735,7 +1735,7 @@ _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String); ### `_.invoke(collection, methodName, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3854 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3871 "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 provided to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`. @@ -1764,7 +1764,7 @@ _.invoke([123, 456], String.prototype.split, ''); ### `_.map(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3906 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3923 "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)*. @@ -1809,7 +1809,7 @@ _.map(characters, 'name'); ### `_.max(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3964 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3981 "View in source") [Ⓣ][1] Retrieves the maximum value of a collection. If the collection is empty or falsey `-Infinity` is returned. If a callback is provided it will be executed for each value in the collection to generate the criterion by which the value is ranked. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1851,7 +1851,7 @@ _.max(characters, 'age'); ### `_.min(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4039 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4057 "View in source") [Ⓣ][1] Retrieves the minimum value of a collection. If the collection is empty or falsey `Infinity` is returned. If a callback is provided it will be executed for each value in the collection to generate the criterion by which the value is ranked. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1893,7 +1893,7 @@ _.min(characters, 'age'); ### `_.pluck(collection, prop)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4094 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4113 "View in source") [Ⓣ][1] Retrieves the value of a specified property from all elements in the collection. @@ -1923,7 +1923,7 @@ _.pluck(characters, 'name'); ### `_.reduce(collection, [callback=identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4126 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4145 "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 provided 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)*. @@ -1961,7 +1961,7 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { ### `_.reduceRight(collection, [callback=identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4169 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4188 "View in source") [Ⓣ][1] This method is like `_.reduce` except that it iterates over elements of a `collection` from right to left. @@ -1992,7 +1992,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); ### `_.reject(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4218 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4237 "View in source") [Ⓣ][1] The opposite of `_.filter`; this method returns the elements of a collection that the callback does **not** return truey for. @@ -2035,7 +2035,7 @@ _.reject(characters, { 'age': 36 }); ### `_.sample(collection, [n])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4244 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4263 "View in source") [Ⓣ][1] Retrieves a random element or `n` random elements from a collection. @@ -2063,7 +2063,7 @@ _.sample([1, 2, 3, 4], 2); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4272 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4291 "View in source") [Ⓣ][1] Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. See [Wikipedia](http://en.wikipedia.org/wiki/Fisher-Yates_shuffle) for more details. @@ -2087,7 +2087,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4306 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4325 "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. @@ -2117,7 +2117,7 @@ _.size('pebbles'); ### `_.some(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4353 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4372 "View in source") [Ⓣ][1] Checks if the callback returns a truey value for **any** element of a collection. The function returns as soon as it finds a 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)*. @@ -2163,7 +2163,7 @@ _.some(characters, { 'age': 1 }); ### `_.sortBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4423 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4442 "View in source") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in a 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)*. @@ -2213,7 +2213,7 @@ _.map(_.sortBy(characters, ['name', 'age']), _.values); ### `_.toArray(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4464 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4483 "View in source") [Ⓣ][1] Converts the `collection` to an array. @@ -2237,7 +2237,7 @@ Converts the `collection` to an array. ### `_.where(collection, props)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4498 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4517 "View in source") [Ⓣ][1] Performs a deep comparison between each element in `collection` and the `props` object, returning an array of all elements that have equivalent property values. @@ -2277,7 +2277,7 @@ _.where(characters, { 'pets': ['dino'] }); ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4526 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4545 "View in source") [Ⓣ][1] Creates a function that executes `func`, with the `this` binding and arguments of the created function, only after being called `n` times. @@ -2310,7 +2310,7 @@ _.forEach(saves, function(type) { ### `_.bind(func, [thisArg], [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4562 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4581 "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 provided to the bound function. @@ -2343,7 +2343,7 @@ func(); ### `_.bindAll(object, [methodName])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4594 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4613 "View in source") [Ⓣ][1] Binds methods of an object to the object itself, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided all the function properties of `object` will be bound. @@ -2376,7 +2376,7 @@ jQuery('#docs').on('click', view.onClick); ### `_.bindKey(object, key, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4641 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4660 "View in source") [Ⓣ][1] Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those provided to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See [Peter Michaux's article](http://michaux.ca/articles/lazy-function-definition-pattern) for more details. @@ -2417,7 +2417,7 @@ func(); ### `_.compose([func])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4677 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4696 "View in source") [Ⓣ][1] Creates a function that is the composition of the provided functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. @@ -2455,7 +2455,7 @@ welcome('pebbles'); ### `_.curry(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4727 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4746 "View in source") [Ⓣ][1] Creates a function which accepts one or more arguments of `func` that when invoked either executes `func` returning its result, if all `func` arguments have been provided, or returns a function that accepts one or more of the remaining `func` arguments, and so on. The arity of `func` can be specified if `func.length` is not sufficient. @@ -2492,7 +2492,7 @@ curried(1, 2, 3); ### `_.debounce(func, wait, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4771 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4790 "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. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. @@ -2536,7 +2536,7 @@ source.addEventListener('message', _.debounce(batchLog, 250, { ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4887 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4906 "View in source") [Ⓣ][1] Defers executing the `func` function until the current call stack has cleared. Additional arguments will be provided to `func` when it is invoked. @@ -2561,7 +2561,7 @@ _.defer(function(text) { console.log(text); }, 'deferred'); ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4911 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4930 "View in source") [Ⓣ][1] Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to `func` when it is invoked. @@ -2587,7 +2587,7 @@ _.delay(function(text) { console.log(text); }, 1000, 'later'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4956 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4975 "View in source") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is provided it will be used to determine the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. The result cache is exposed as the `cache` property on the memoized function. @@ -2630,7 +2630,7 @@ get('pebbles'); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4989 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5008 "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. @@ -2656,7 +2656,7 @@ initialize(); ### `_.partial(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5030 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5049 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those provided to the new function. This method is similar to `_.bind` except it does **not** alter the `this` binding. @@ -2685,7 +2685,7 @@ hi('fred'); ### `_.partialRight(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5064 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5083 "View in source") [Ⓣ][1] This method is like `_.partial` except that `partial` arguments are appended to those provided to the new function. @@ -2724,7 +2724,7 @@ options.imports ### `_.throttle(func, wait, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5099 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5118 "View in source") [Ⓣ][1] Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call. @@ -2760,7 +2760,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5140 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5159 "View in source") [Ⓣ][1] Creates a function that provides `value` to the wrapper function as its first argument. Additional arguments provided to the function are appended to those provided to the wrapper function. The wrapper is executed with the `this` binding of the created function. @@ -2796,7 +2796,7 @@ p('fred, barney, & pebbles'); ### `_.assign(object, [source], [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5176 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5195 "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 is provided it will be executed to produce the assigned values. The callback is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -2834,7 +2834,7 @@ defaults(object, { 'name': 'fred', 'employer': 'slate' }); ### `_.clone(value, [isDeep=false], [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5243 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5268 "View in source") [Ⓣ][1] Creates a clone of `value`. If `isDeep` is `true` nested objects will also be cloned, otherwise they will be assigned by reference. If a callback is provided it will be executed to produce the cloned values. If the callback returns `undefined` cloning will be handled by the method instead. The callback is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2881,7 +2881,7 @@ clone.childNodes.length; ### `_.cloneDeep(value, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5295 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5328 "View in source") [Ⓣ][1] Creates a deep clone of `value`. If a callback is provided it will be executed to produce the cloned values. If the callback returns `undefined` cloning will be handled by the method instead. The callback is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2927,7 +2927,7 @@ clone.node == view.node; ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5330 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5363 "View in source") [Ⓣ][1] Creates an object that inherits from the given `prototype` object. If a `properties` object is provided its own enumerable properties are assigned to the created object. @@ -2967,7 +2967,7 @@ circle instanceof Shape; ### `_.defaults(object, [source])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5354 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5387 "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. @@ -2993,7 +2993,7 @@ _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); ### `_.findKey(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5418 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5457 "View in source") [Ⓣ][1] This method is like `_.findIndex` except that it returns the key of the first element that passes the callback check, instead of the element itself. @@ -3039,7 +3039,7 @@ _.findKey(characters, 'blocked'); ### `_.findLastKey(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5471 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5510 "View in source") [Ⓣ][1] This method is like `_.findKey` except that it iterates over elements of a `collection` in the opposite order. @@ -3085,7 +3085,7 @@ _.findLastKey(characters, 'blocked'); ### `_.forIn(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5514 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5553 "View in source") [Ⓣ][1] Iterates over own and inherited enumerable properties of an object, 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`. @@ -3123,7 +3123,7 @@ _.forIn(new Shape, function(value, key) { ### `_.forInRight(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5550 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5589 "View in source") [Ⓣ][1] This method is like `_.forIn` except that it iterates over elements of a `collection` in the opposite order. @@ -3161,7 +3161,7 @@ _.forInRight(new Shape, function(value, key) { ### `_.forOwn(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5587 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5626 "View in source") [Ⓣ][1] Iterates over own enumerable properties of an object, 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`. @@ -3189,7 +3189,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { ### `_.forOwnRight(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5620 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5659 "View in source") [Ⓣ][1] This method is like `_.forOwn` except that it iterates over elements of a `collection` in the opposite order. @@ -3217,7 +3217,7 @@ _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5649 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5688 "View in source") [Ⓣ][1] Creates a sorted array of property names of all enumerable properties, own and inherited, of `object` that have function values. @@ -3244,7 +3244,7 @@ _.functions(_); ### `_.has(object, key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5674 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5713 "View in source") [Ⓣ][1] Checks if the specified property name exists as a direct property of `object`, instead of an inherited property. @@ -3269,7 +3269,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); ### `_.invert(object, [multiValue=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5703 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5742 "View in source") [Ⓣ][1] Creates an object composed of the inverted keys and values of the given object. If the given object contains duplicate values, subsequent values will overwrite property assignments of previous values unless `multiValue` is `true`. @@ -3302,7 +3302,7 @@ _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }, true); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2069 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2064 "View in source") [Ⓣ][1] Checks if `value` is an `arguments` object. @@ -3329,7 +3329,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5744 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5783 "View in source") [Ⓣ][1] Checks if `value` is an array. @@ -3356,7 +3356,7 @@ _.isArray([1, 2, 3]); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5762 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5801 "View in source") [Ⓣ][1] Checks if `value` is a boolean value. @@ -3380,7 +3380,7 @@ _.isBoolean(null); ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5780 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5819 "View in source") [Ⓣ][1] Checks if `value` is a date. @@ -3404,7 +3404,7 @@ _.isDate(new Date); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5797 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5836 "View in source") [Ⓣ][1] Checks if `value` is a DOM element. @@ -3428,7 +3428,7 @@ _.isElement(document.body); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5830 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5869 "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". @@ -3458,7 +3458,7 @@ _.isEmpty(''); ### `_.isEqual(a, b, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5887 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5926 "View in source") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent to each other. If a callback is provided it will be executed to compare values. If the callback returns `undefined` comparisons will be handled by the method instead. The callback is bound to `thisArg` and invoked with two arguments; *(a, b)*. @@ -3503,7 +3503,7 @@ _.isEqual(words, otherWords, function(a, b) { ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5920 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5959 "View in source") [Ⓣ][1] Checks if `value` is, or can be coerced to, a finite number. @@ -3541,7 +3541,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5937 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5976 "View in source") [Ⓣ][1] Checks if `value` is a function. @@ -3565,7 +3565,7 @@ _.isFunction(_); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6001 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6041 "View in source") [Ⓣ][1] Checks if `value` is `NaN`. @@ -3600,7 +3600,7 @@ _.isNaN(undefined); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6023 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6063 "View in source") [Ⓣ][1] Checks if `value` is `null`. @@ -3627,7 +3627,7 @@ _.isNull(undefined); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6043 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6083 "View in source") [Ⓣ][1] Checks if `value` is a number. @@ -3653,7 +3653,7 @@ _.isNumber(8.4 * 5); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5967 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6006 "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('')`)* @@ -3683,7 +3683,7 @@ _.isObject(1); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6072 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6113 "View in source") [Ⓣ][1] Checks if `value` is an object created by the `Object` constructor. @@ -3718,7 +3718,7 @@ _.isPlainObject({ 'x': 0, 'y': 0 }); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6097 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6138 "View in source") [Ⓣ][1] Checks if `value` is a regular expression. @@ -3742,7 +3742,7 @@ _.isRegExp(/fred/); ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6114 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6157 "View in source") [Ⓣ][1] Checks if `value` is a string. @@ -3766,7 +3766,7 @@ _.isString('fred'); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6132 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6175 "View in source") [Ⓣ][1] Checks if `value` is `undefined`. @@ -3790,7 +3790,7 @@ _.isUndefined(void 0); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6149 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6192 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property names of an object. @@ -3814,7 +3814,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.mapValues(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6196 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6239 "View in source") [Ⓣ][1] Creates an object with the same keys as `object` and values generated by running each own enumerable property of `object` through the callback. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3853,7 +3853,7 @@ _.mapValues(characters, 'age'); ### `_.merge(object, [source], [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6257 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6300 "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 is provided it will be executed to produce the merged values of the destination and source properties. If the callback returns `undefined` merging will be handled by the method instead. The callback is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -3909,7 +3909,7 @@ _.merge(food, otherFood, function(a, b) { ### `_.omit(object, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6309 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6358 "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 is provided it will be executed for each property of `object` omitting the properties the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3940,7 +3940,7 @@ _.omit({ 'name': 'fred', 'age': 40 }, function(value) { ### `_.pairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6350 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6399 "View in source") [Ⓣ][1] Creates a two dimensional array of an object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. @@ -3964,7 +3964,7 @@ _.pairs({ 'barney': 36, 'fred': 40 }); ### `_.pick(object, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6390 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6439 "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 a callback is provided it will be executed for each property of `object` picking the properties the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3995,7 +3995,7 @@ _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { ### `_.transform(object, [callback=identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6445 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6494 "View in source") [Ⓣ][1] An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own enumerable properties through a 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`. @@ -4032,7 +4032,7 @@ var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6479 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6528 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property values of `object`. @@ -4063,7 +4063,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.capitalize(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6506 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6555 "View in source") [Ⓣ][1] Converts the first character of `string` to upper case. @@ -4087,7 +4087,7 @@ _.capitalize('fred'); ### `_.escape(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6531 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6580 "View in source") [Ⓣ][1] Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. @@ -4113,7 +4113,7 @@ _.escape('fred, barney, & pebbles'); ### `_.template(text, [data], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6621 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6670 "View in source") [Ⓣ][1] A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. @@ -4205,7 +4205,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.trim(string, [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6738 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6787 "View in source") [Ⓣ][1] Removes leading and trailing whitespace or specified characters from `string`. @@ -4233,7 +4233,7 @@ _.trim('-_-fred-_-', '_-'); ### `_.trimLeft(string, [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6762 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6811 "View in source") [Ⓣ][1] Removes leading whitespace or specified characters from `string`. @@ -4261,7 +4261,7 @@ _.trimLeft('-_-fred-_-', '_-'); ### `_.trimRight(string, [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6786 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6835 "View in source") [Ⓣ][1] Removes trailing whitespace or specified characters from `string`. @@ -4289,7 +4289,7 @@ _.trimRight('-_-fred-_-', '_-'); ### `_.unescape(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6811 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6860 "View in source") [Ⓣ][1] The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. @@ -4322,7 +4322,7 @@ _.unescape('fred, barney & pebbles'); ### `_.now` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7077 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7126 "View in source") [Ⓣ][1] *(unknown)*: Gets the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. @@ -4341,7 +4341,7 @@ _.defer(function() { console.log(_.now() - stamp); }); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6836 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6885 "View in source") [Ⓣ][1] Creates a function that returns `value`. @@ -4367,7 +4367,7 @@ getter() === object; ### `_.createCallback([func=identity], [thisArg], [argCount])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6873 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6922 "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`. @@ -4406,7 +4406,7 @@ _.filter(characters, 'age__gt38'); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6896 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6945 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -4431,7 +4431,7 @@ _.identity(object) === object; ### `_.match(props)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6925 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6974 "View in source") [Ⓣ][1] Creates a "_.where" style function, which performs a deep comparison between a given object and the `props` object, returning `true` if the given object has equivalent property values, else `false`. @@ -4465,7 +4465,7 @@ _.find(characters, matchAge); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6983 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7032 "View in source") [Ⓣ][1] Adds function properties of a source object to the destination object. If `object` is a function methods will be added to its prototype as well. @@ -4503,7 +4503,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7043 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7092 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -4523,7 +4523,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7060 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7109 "View in source") [Ⓣ][1] A no-operation function. @@ -4542,7 +4542,7 @@ _.noop(object) === undefined; ### `_.parseInt(value, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7101 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7150 "View in source") [Ⓣ][1] Converts `value` to 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. @@ -4569,7 +4569,7 @@ _.parseInt('08'); ### `_.property(key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7132 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7181 "View in source") [Ⓣ][1] Creates a "_.pluck" style function, which returns the `key` value of a given object. @@ -4603,7 +4603,7 @@ _.sortBy(characters, getName); ### `_.random([min=0], [max=1], [floating=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7165 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7214 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided a number between `0` and the given number will be returned. If `floating` is truey or either `min` or `max` are floats a floating-point number will be returned instead of an integer. @@ -4638,7 +4638,7 @@ _.random(1.2, 5.2); ### `_.result(object, key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7224 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7273 "View in source") [Ⓣ][1] Resolves the value of property `key` on `object`. If `key` 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. @@ -4673,7 +4673,7 @@ _.result(object, 'stuff'); ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L653 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L647 "View in source") [Ⓣ][1] Create a new `lodash` function using the given context object. @@ -4691,7 +4691,7 @@ Create a new `lodash` function using the given context object. ### `_.times(n, callback, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7254 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7303 "View in source") [Ⓣ][1] Executes the callback `n` times, returning an array of the results of each callback execution. The callback is bound to `thisArg` and invoked with one argument; *(index)*. @@ -4723,7 +4723,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7282 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7331 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID will be appended to it. @@ -4757,7 +4757,7 @@ _.uniqueId(); ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1065 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1059 "View in source") [Ⓣ][1] A reference to the `lodash` function. @@ -4776,7 +4776,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7489 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7538 "View in source") [Ⓣ][1] *(string)*: The semantic version number. @@ -4788,7 +4788,7 @@ A reference to the `lodash` function. ### `_.support` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L862 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L856 "View in source") [Ⓣ][1] *(Object)*: An object used to flag environments features. @@ -4800,7 +4800,7 @@ A reference to the `lodash` function. ### `_.support.argsClass` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L879 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L873 "View in source") [Ⓣ][1] *(boolean)*: Detect if an `arguments` object's [[Class]] is resolvable *(all but Firefox < `4`, IE < `9`)*. @@ -4812,7 +4812,7 @@ A reference to the `lodash` function. ### `_.support.argsObject` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L887 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L881 "View in source") [Ⓣ][1] *(boolean)*: Detect if `arguments` objects are `Object` objects *(all but Narwhal and Opera < `10.5`)*. @@ -4824,7 +4824,7 @@ A reference to the `lodash` function. ### `_.support.enumErrorProps` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L896 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L890 "View in source") [Ⓣ][1] *(boolean)*: Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. *(IE < `9`, Safari < `5.1`)* @@ -4836,7 +4836,7 @@ A reference to the `lodash` function. ### `_.support.enumPrototypes` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L909 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L903 "View in source") [Ⓣ][1] *(boolean)*: Detect if `prototype` properties are enumerable by default. @@ -4850,7 +4850,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.funcDecomp` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L918 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L912 "View in source") [Ⓣ][1] *(boolean)*: Detect if functions can be decompiled by `Function#toString` *(all but PS3 and older Opera mobile browsers & avoided in Windows `8` apps)*. @@ -4862,7 +4862,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.funcNames` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L926 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L920 "View in source") [Ⓣ][1] *(boolean)*: Detect if `Function#name` is supported *(all but IE)*. @@ -4874,7 +4874,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.nonEnumArgs` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L935 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L929 "View in source") [Ⓣ][1] *(boolean)*: Detect if `arguments` object indexes are non-enumerable *(Firefox < `4`, IE < `9`, PhantomJS, Safari < `5.1`)*. @@ -4886,7 +4886,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.nonEnumShadows` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L946 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L940 "View in source") [Ⓣ][1] *(boolean)*: Detect if properties shadowing those on `Object.prototype` are non-enumerable. @@ -4900,7 +4900,7 @@ In IE < `9` an objects own properties, shadowing non-enumerable ones, are made n ### `_.support.ownLast` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L954 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L948 "View in source") [Ⓣ][1] *(boolean)*: Detect if own properties are iterated after inherited properties *(all but IE < `9`)*. @@ -4912,7 +4912,7 @@ In IE < `9` an objects own properties, shadowing non-enumerable ones, are made n ### `_.support.spliceObjects` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L968 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L962 "View in source") [Ⓣ][1] *(boolean)*: Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. @@ -4926,7 +4926,7 @@ Firefox < `10`, IE compatibility mode, and IE < `9` have buggy Array `shift()` a ### `_.support.unindexedChars` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L979 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L973 "View in source") [Ⓣ][1] *(boolean)*: Detect lack of support for accessing string characters by index. @@ -4940,7 +4940,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1017 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1011 "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. @@ -4952,7 +4952,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1025 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1019 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect `data` property values to be HTML-escaped. @@ -4964,7 +4964,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1033 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1027 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect code to be evaluated. @@ -4976,7 +4976,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1041 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1035 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect `data` property values to inject. @@ -4988,7 +4988,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1049 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1043 "View in source") [Ⓣ][1] *(string)*: Used to reference the data object in the template text. @@ -5000,7 +5000,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1057 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L1051 "View in source") [Ⓣ][1] *(Object)*: Used to import variables into the compiled template. diff --git a/lodash.js b/lodash.js index 72bacfd99..8f2db2d87 100644 --- a/lodash.js +++ b/lodash.js @@ -18,11 +18,19 @@ /** Used to generate unique IDs */ var idCounter = 0; + /** Used to compose bitmasks for `__bindData__` */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_FLAG = 4, + CURRY_BOUND_FLAG = 8, + PARTIAL_FLAG = 16, + PARTIAL_RIGHT_FLAG = 32; + /** Used as the size when optimizations are enabled for large arrays */ - var largeArraySize = 75; + var LARGE_ARRAY_SIZE = 75; /** Used as the max size of the `arrayPool` and `objectPool` */ - var maxPoolSize = 40; + var MAX_POOL_SIZE = 40; /** Used to detect and test whitespace */ var whitespace = ( @@ -489,7 +497,7 @@ */ function releaseArray(array) { array.length = 0; - if (arrayPool.length < maxPoolSize) { + if (arrayPool.length < MAX_POOL_SIZE) { arrayPool.push(array); } } @@ -506,7 +514,7 @@ releaseObject(cache); } object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; - if (objectPool.length < maxPoolSize) { + if (objectPool.length < MAX_POOL_SIZE) { objectPool.push(object); } } @@ -1365,10 +1373,10 @@ thisArg = bindData[4], arity = bindData[5]; - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, key = func; function bound() { @@ -1383,8 +1391,9 @@ push.apply(args, partialRightArgs); } if (isCurry && args.length < arity) { - bitmask |= 16 & ~32; - return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~(BIND_FLAG | BIND_KEY_FLAG)), args, null, thisArg, arity]); } } args || (args = arguments); @@ -1415,7 +1424,7 @@ var index = -1, indexOf = getIndexOf(), length = array ? array.length : 0, - isLarge = length >= largeArraySize && indexOf === baseIndexOf, + isLarge = length >= LARGE_ARRAY_SIZE && indexOf === baseIndexOf, result = []; if (isLarge) { @@ -1784,7 +1793,7 @@ length = array ? array.length : 0, result = []; - var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + var isLarge = !isSorted && length >= LARGE_ARRAY_SIZE && indexOf === baseIndexOf, seen = (callback || isLarge) ? getArray() : result; if (isLarge) { @@ -1853,7 +1862,7 @@ * * @private * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of method flags to compose. + * @param {number} bitmask The bitmask of flags to compose. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -1870,12 +1879,12 @@ * @returns {Function} Returns the new function. */ function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, - isPartial = bitmask & 16, - isPartialRight = bitmask & 32; + var isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, + isPartial = bitmask & PARTIAL_FLAG, + isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isBindKey && !isFunction(func)) { throw new TypeError; @@ -1899,15 +1908,15 @@ bindData[3] = slice(bindData[3]); } // set `thisBinding` is not previously bound - if (isBind && !(bindData[1] & 1)) { + if (isBind && !(bindData[1] & BIND_FLAG)) { bindData[4] = thisArg; } // set if previously bound but not currently (subsequent curried functions) - if (!isBind && bindData[1] & 1) { + if (!isBind && bindData[1] & BIND_FLAG) { bitmask |= 8; } // set curried arity if not yet set - if (isCurry && !(bindData[1] & 4)) { + if (isCurry && !(bindData[1] & CURRY_FLAG)) { bindData[5] = arity; } // append partial left arguments @@ -1923,7 +1932,7 @@ return createWrapper.apply(null, bindData); } // fast path for `_.bind` - var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + var creater = (bitmask == BIND_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) ? baseBind : baseCreateWrapper; return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); } @@ -2505,7 +2514,7 @@ var value = arguments[argsIndex]; if (isArray(value) || isArguments(value)) { args.push(value); - caches.push(trustIndexOf && value.length >= largeArraySize && + caches.push(trustIndexOf && value.length >= LARGE_ARRAY_SIZE && createCache(argsIndex ? args[argsIndex] : seen)); } } @@ -4571,8 +4580,8 @@ */ function bind(func, thisArg) { return arguments.length > 2 - ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) - : createWrapper(func, 1, null, null, thisArg); + ? createWrapper(func, BIND_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, thisArg) + : createWrapper(func, BIND_FLAG, null, null, thisArg); } /** @@ -4608,7 +4617,7 @@ while (++index < length) { var key = funcs[index]; - object[key] = createWrapper(object[key], 1, null, null, object); + object[key] = createWrapper(object[key], BIND_FLAG, null, null, object); } return object; } @@ -4650,8 +4659,8 @@ */ function bindKey(object, key) { return arguments.length > 2 - ? createWrapper(key, 19, slice(arguments, 2), null, object) - : createWrapper(key, 3, null, null, object); + ? createWrapper(key, BIND_FLAG | BIND_KEY_FLAG | PARTIAL_FLAG, slice(arguments, 2), null, object) + : createWrapper(key, BIND_FLAG | BIND_KEY_FLAG, null, null, object); } /** @@ -4736,7 +4745,7 @@ */ function curry(func, arity) { arity = typeof arity == 'number' ? arity : (+arity || func.length); - return createWrapper(func, 4, null, null, null, arity); + return createWrapper(func, CURRY_FLAG, null, null, null, arity); } /** @@ -5038,7 +5047,7 @@ * // => 'hi fred' */ function partial(func) { - return createWrapper(func, 16, slice(arguments, 1)); + return createWrapper(func, PARTIAL_FLAG, slice(arguments, 1)); } /** @@ -5072,7 +5081,7 @@ * // => { '_': _, 'jq': $ } */ function partialRight(func) { - return createWrapper(func, 32, null, slice(arguments, 1)); + return createWrapper(func, PARTIAL_RIGHT_FLAG, null, slice(arguments, 1)); } /** @@ -5148,7 +5157,7 @@ * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { - return createWrapper(wrapper, 16, [value]); + return createWrapper(wrapper, PARTIAL_FLAG, [value]); } /*--------------------------------------------------------------------------*/