diff --git a/build/minify.js b/build/minify.js index a007984db..31ed8f89e 100755 --- a/build/minify.js +++ b/build/minify.js @@ -19,10 +19,10 @@ path = util.path; /** The Git object ID of `closure-compiler.tar.gz` */ - var closureId = '7815712f73ccb21f587bf3fb72a2f50be788515d'; + var closureId = '9fd5d61c1b706e7505aeb5187941c2c5497e5fd8'; /** The Git object ID of `uglifyjs.tar.gz` */ - var uglifyId = 'fb620e8672ad194b3ab501790e19c40c8ac79286'; + var uglifyId = '48cae9c0cd76acf812f90d4f98de499ac61ec105'; /** The path of the directory that is the base of the repository */ var basePath = fs.realpathSync(path.join(__dirname, '..')); diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 0b0c31e28..69093708a 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -219,7 +219,6 @@ ctorByClass[arrayClass] = Array; ctorByClass[boolClass] = Boolean; ctorByClass[dateClass] = Date; - ctorByClass[errorClass] = Error; ctorByClass[funcClass] = Function; ctorByClass[objectClass] = Object; ctorByClass[numberClass] = Number; @@ -546,7 +545,7 @@ __p += '\n var skipProto = typeof iterable == \'function\';\n '; } - if (support.enumErrorProps || support.nonEnumShadows) { + if (support.enumErrorProps) { __p += '\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n '; } @@ -807,16 +806,16 @@ // create the function factory var factory = Function( - 'ctorByClass, errorClass, errorProto, hasOwnProperty, isArguments, ' + - 'isArray, isString, keys, lodash, objectProto, objectTypes, nonEnumProps, ' + - 'stringClass, stringProto, toString', + 'errorClass, errorProto, hasOwnProperty, isArguments, isArray, isString, ' + + 'keys, lodash, objectProto, objectTypes, nonEnumProps, stringClass, ' + + 'stringProto, toString', 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' ); // return the compiled function return factory( - ctorByClass, errorClass, errorProto, hasOwnProperty, isArguments, - isArray, isString, keys, lodash, objectProto, objectTypes, nonEnumProps, - stringClass, stringProto, toString + errorClass, errorProto, hasOwnProperty, isArguments, isArray, isString, + keys, lodash, objectProto, objectTypes, nonEnumProps, stringClass, + stringProto, toString ); } @@ -2315,7 +2314,7 @@ var isArr = isArray(object); callback = lodash.createCallback(callback, thisArg, 4); - if (arguments.length < 3) { + if (accumulator == null) { if (isArr) { accumulator = []; } else { diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 0080d3f03..93f23c31a 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,45 +4,45 @@ * Build: `lodash -o ./dist/lodash.compat.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!Oe(n)&&ee.call(n,"__wrapped__")?n:new V(n)}function R(n){var t=n.length,e=t>=l;if(e)for(var r={},u=-1;++ut||typeof n=="undefined")return 1;if(nk;k++)r+="n='"+t.g[k]+"';if((!(q&&w[n])&&m.call(s,n))",t.i||(r+="||(!w[n]&&s[n]!==z[n])"),r+="){"+t.f+";}"; -r+="}"}return(t.b||je.nonEnumArgs)&&(r+="}"),r+=t.c+";return D",n("i,j,k,m,o,p,r,u,v,z,A,x,H,I,K",e+r+"}")(we,A,Gt,ee,Z,Oe,it,Ae,a,Ut,$,Ce,P,Vt,ie)}function H(n){return at(n)?le(n):{}}function M(n){return"\\"+q[n]}function G(n){return Ie[n]}function U(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function V(n){this.__wrapped__=n}function Q(){}function W(n){var t=!1;if(!n||ie.call(n)!=B||!je.argsClass&&Z(n))return t;var e=n.constructor;return(ut(e)?e instanceof e:je.nodeClass||!U(n))?je.ownLast?(Fe(n,function(n,e,r){return t=ee.call(r,e),!1 -}),!0===t):(Fe(n,function(n,e){t=e}),!1===t||ee.call(n,t)):t}function X(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Pt(0>e?0:e);++re?ge(0,u+e):e)||0,typeof u=="number"?a=-1<(it(n)?n.indexOf(t,e):jt(n,t,e)):De(n,function(n){return++ru&&(u=i)}}else t=!t&&it(n)?T:a.createCallback(t,e),De(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n) -});return u}function mt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),Oe(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++oarguments.length;if(typeof o!="number")var c=Ae(n),o=c.length;else je.unindexedChars&&it(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),gt(n,function(n,r,a){r=c?c[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function bt(n,t,e){var r; -if(t=a.createCallback(t,e),Oe(n)){e=-1;for(var u=n.length;++ee?ge(0,u+e):e||0)-1;else if(e)return r=xt(n,t),n[r]===t?r:-1;for(;++r>>1,e(n[r])=l;if(p)var v={};for(null!=r&&(s=[],r=a.createCallback(r,u));++ojt(s,g))&&((r||p)&&s.push(g),f.push(u))}return f}function Ot(n){for(var t=-1,e=n?yt(ze(n,"length")):0,r=Pt(0>e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:y,variable:"",imports:{_:a}};var ke={a:"y,G,l",h:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b":">",'"':""","'":"'"},Be=et(Ie),Ne=J(ke,{h:ke.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=v.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"D[n]=d?d(D[n],s[n]):s[n]"}),Pe=J(ke),Fe=J(xe,Ee,{i:!1}),$e=J(xe,Ee); -ut(/x/)&&(ut=function(n){return typeof n=="function"&&ie.call(n)==D});var qe=te?function(n){if(!n||ie.call(n)!=B||!je.argsClass&&Z(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=te(t))&&te(e);return e?n==e||te(n)==e:W(n)}:W,ze=ht;_e&&u&&typeof ae=="function"&&(Dt=At(ae,r));var Re=8==ye(m+"08")?ye:function(n,t){return ye(it(n)?n.replace(d,""):n,t||0)};return a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=Ne,a.at=function(n){var t=-1,e=Zt.apply(Mt,de.call(arguments,1)),r=e.length,u=Pt(r); -for(je.unindexedChars&&it(n)&&(n=n.split(""));++t++c&&(a=n.apply(o,u)),i=oe(r,t),a}},a.defaults=Pe,a.defer=Dt,a.delay=function(n,t){var r=de.call(arguments,2);return oe(function(){n.apply(e,r)},t)},a.difference=_t,a.filter=pt,a.flatten=Ct,a.forEach=gt,a.forIn=Fe,a.forOwn=$e,a.functions=tt,a.groupBy=function(n,t,e){var r={}; -return t=a.createCallback(t,e),gt(n,function(n,e,u){e=Jt(t(n,e,u)),(ee.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return X(n,0,he(ge(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=l,i=[],f=i;n:for(;++ujt(f,s)){o&&f.push(s); -for(var v=e;--v;)if(!(r[v]||(r[v]=R(t[v])))(s))continue n;i.push(s)}}return i},a.invert=et,a.invoke=function(n,t){var e=de.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Pt(typeof a=="number"?a:0);return gt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=Ae,a.map=ht,a.max=yt,a.memoize=function(n,t){function e(){var r=e.cache,u=c+(t?t.apply(this,arguments):arguments[0]);return ee.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},a.merge=ct,a.min=function(n,t,e){var r=1/0,u=r; -if(!t&&Oe(n)){e=-1;for(var o=n.length;++ejt(o,e))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=Ae(n),r=e.length,u=Pt(r);++targuments.length)if(u)e=[];else{var o=n&&n.constructor;e=H(o&&o.prototype)}return(u?De:$e)(n,function(n,r,u){return t(e,n,r,u)}),e},a.union=function(n){return Oe(n)||(arguments[0]=n?de.call(n):Mt),Et(Zt.apply(Mt,arguments))},a.uniq=Et,a.unzip=Ot,a.values=lt,a.where=pt,a.without=function(n){return _t(n,de.call(arguments,1))},a.wrap=function(n,t){return function(){var e=[n];return re.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){return n?Ot(arguments):[]},a.zipObject=St,a.collect=ht,a.drop=kt,a.each=gt,a.extend=Ne,a.methods=tt,a.object=St,a.select=pt,a.tail=kt,a.unique=Et,Bt(a),a.chain=a,a.prototype.chain=function(){return this -},a.clone=nt,a.cloneDeep=function(n,t,e){return nt(n,!0,t,e)},a.contains=ft,a.escape=function(n){return null==n?"":Jt(n).replace(_,G)},a.every=st,a.find=vt,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=a.createCallback(t,e);++re?ge(0,r+e):he(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=Bt,a.noConflict=function(){return r._=Qt,this},a.parseInt=Re,a.random=function(n,t){null==n&&null==t&&(t=1),n=+n||0,null==t?(t=n,n=0):t=+t||0;var e=me();return n%1||t%1?n+he(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+ne(e*(t-n+1))},a.reduce=mt,a.reduceRight=dt,a.result=function(n,t){var r=n?n[t]:e; -return ut(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Ae(n).length},a.some=bt,a.sortedIndex=xt,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=Pe({},r,u);var o,i=Pe({},r.imports,u.imports),u=Ae(i),i=lt(i),c=0,l=r.interpolate||b,v="__p+='",l=Lt((r.escape||b).source+"|"+l.source+"|"+(l===y?g:b).source+"|"+(r.evaluate||b).source+"|$","g");n.replace(l,function(t,e,r,u,a,i){return r||(r=u),v+=n.slice(c,i).replace(w,M),e&&(v+="'+__e("+e+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),r&&(v+="'+((__t=("+r+"))==null?'':__t)+'"),c=i+t.length,t -}),v+="';\n",l=r=r.variable,l||(r="obj",v="with("+r+"){"+v+"}"),v=(o?v.replace(f,""):v).replace(s,"$1").replace(p,"$1;"),v="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+v+"return __p}";try{var h=zt(u,"return "+v).apply(e,i)}catch(m){throw m.source=v,m}return t?h(t):(h.source=v,h)},a.unescape=function(n){return null==n?"":Jt(n).replace(v,Y)},a.uniqueId=function(n){var t=++o;return Jt(null==n?"":n)+t -},a.all=st,a.any=bt,a.detect=vt,a.foldl=mt,a.foldr=dt,a.include=ft,a.inject=mt,$e(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return re.apply(t,arguments),n.apply(a,t)})}),a.first=wt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return X(n,ge(0,u-r))}},a.take=wt,a.head=wt,$e(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e); -return null==t||e&&typeof t!="function"?r:new V(r)})}),a.VERSION="1.2.1",a.prototype.toString=function(){return Jt(this.__wrapped__)},a.prototype.value=Nt,a.prototype.valueOf=Nt,De(["join","pop","shift"],function(n){var t=Mt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),De(["push","reverse","sort","unshift"],function(n){var t=Mt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),De(["concat","slice","splice"],function(n){var t=Mt[n];a.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments)) -}}),je.spliceObjects||De(["pop","shift","splice"],function(n){var t=Mt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new V(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;(a.global===a||a.window===a)&&(n=a);var o=0,i={},c=+new Date+"",l=200,f=/\b__p\+='';/g,s=/\b(__p\+=)''\+/g,p=/(__e\(.*?\)|\b__t\))\+'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,h=/\w*$/,y=/<%=([\s\S]+?)%>/g,m=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",d=RegExp("^["+m+"]*0+(?=.$)"),b=/($^)/,_=/[&<>"']/g,w=/['\n\r\t\u2028\u2029\\]/g,C="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),x="[object Arguments]",E="[object Array]",O="[object Boolean]",S="[object Date]",A="[object Error]",D="[object Function]",I="[object Number]",B="[object Object]",N="[object RegExp]",P="[object String]",F={}; -F[D]=!1,F[x]=F[E]=F[O]=F[S]=F[I]=F[B]=F[N]=F[P]=!0;var $={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},z=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=z, define(function(){return z})):r&&!r.nodeType?u?(u.exports=z)._=z:r._=z:n._=z})(this); \ No newline at end of file +;!function(n){function t(e){function a(n){return n&&typeof n=="object"&&!Er(n)&&tr.call(n,"__wrapped__")?n:new V(n)}function R(n){var t=n.length,r=t>=l;if(r)for(var e={},u=-1;++ut||typeof n=="undefined")return 1;if(nk;k++)e+="m='"+t.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",t.i||(e+="||(!v[m]&&r[m]!==y[m])"),e+="){"+t.f+"}"; +e+="}"}return(t.b||wr.nonEnumArgs)&&(e+="}"),e+=t.c+";return C",n("i,j,l,n,o,q,t,u,y,z,w,G,H,J",r+e+"}")(A,Kt,tr,Z,Er,it,Sr,a,Mt,$,Cr,z,Ut,or)}function J(n){return at(n)?cr(n):{}}function K(n){return"\\"+q[n]}function M(n){return Ir[n]}function U(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function V(n){this.__wrapped__=n}function Q(){}function W(n){var t=!1;if(!n||or.call(n)!=N||!wr.argsClass&&Z(n))return t;var r=n.constructor;return(ut(r)?r instanceof r:wr.nodeClass||!U(n))?wr.ownLast?(zr(n,function(n,r,e){return t=tr.call(e,r),!1 +}),!0===t):(zr(n,function(n,r){t=r}),!1===t||tr.call(n,t)):t}function X(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=zt(0>r?0:r);++er?vr(0,u+r):r)||0,typeof u=="number"?a=-1<(it(n)?n.indexOf(t,r):jt(n,t,r)):Ar(n,function(n){return++eu&&(u=i)}}else t=!t&&it(n)?T:a.createCallback(t,r),Ar(n,function(n,r,a){r=t(n,r,a),r>e&&(e=r,u=n) +});return u}function mt(n,t,r,e){var u=3>arguments.length;if(t=a.createCallback(t,e,4),Er(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++oarguments.length;if(typeof o!="number")var c=Sr(n),o=c.length;else wr.unindexedChars&&it(n)&&(u=n.split(""));return t=a.createCallback(t,e,4),gt(n,function(n,e,a){e=c?c[--o]:--o,r=i?(i=!1,u[e]):t(r,u[e],e,a)}),r}function bt(n,t,r){var e; +if(t=a.createCallback(t,r),Er(n)){r=-1;for(var u=n.length;++rr?vr(0,u+r):r||0)-1;else if(r)return e=xt(n,t),n[e]===t?e:-1;for(;++e>>1,r(n[e])=l;if(s)var v={};for(null!=e&&(p=[],e=a.createCallback(e,u));++ojt(p,g))&&((e||s)&&p.push(g),f.push(u))}return f}function Ot(n){for(var t=-1,r=n?yt(qr(n,"length")):0,e=zt(0>r?0:r);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:y,variable:"",imports:{_:a}};var jr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b":">",'"':""","'":"'"},Br=rt(Ir),Nr=H(jr,{h:jr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Pr=H(jr),zr=H(kr,xr,{i:!1}),Fr=H(kr,xr); +ut(/x/)&&(ut=function(n){return typeof n=="function"&&or.call(n)==I});var $r=nr?function(n){if(!n||or.call(n)!=N||!wr.argsClass&&Z(n))return!1;var t=n.valueOf,r=typeof t=="function"&&(r=nr(t))&&nr(r);return r?n==r||nr(n)==r:W(n)}:W,qr=ht;br&&u&&typeof ur=="function"&&(It=At(ur,e));var Dr=8==hr(m+"08")?hr:function(n,t){return hr(it(n)?n.replace(d,""):n,t||0)};return a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=Nr,a.at=function(n){var t=-1,r=Yt.apply(Jt,mr.call(arguments,1)),e=r.length,u=zt(e); +for(wr.unindexedChars&&it(n)&&(n=n.split(""));++t++c&&(a=n.apply(o,u)),i=ar(e,t),a}},a.defaults=Pr,a.defer=It,a.delay=function(n,t){var e=mr.call(arguments,2);return ar(function(){n.apply(r,e)},t)},a.difference=_t,a.filter=st,a.flatten=wt,a.forEach=gt,a.forIn=zr,a.forOwn=Fr,a.functions=tt,a.groupBy=function(n,t,r){var e={}; +return t=a.createCallback(t,r),gt(n,function(n,r,u){r=Gt(t(n,r,u)),(tr.call(e,r)?e[r]:e[r]=[]).push(n)}),e},a.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,r);o--&&t(n[o],o,n);)e++}else e=null==t||r?1:t||e;return X(n,0,gr(vr(0,u-e),u))},a.intersection=function(n){var t=arguments,r=t.length,e={0:{}},u=-1,a=n?n.length:0,o=a>=l,i=[],f=i;n:for(;++ujt(f,p)){o&&f.push(p); +for(var v=r;--v;)if(!(e[v]||(e[v]=R(t[v])))(p))continue n;i.push(p)}}return i},a.invert=rt,a.invoke=function(n,t){var r=mr.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=zt(typeof a=="number"?a:0);return gt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},a.keys=Sr,a.map=ht,a.max=yt,a.memoize=function(n,t){function r(){var e=r.cache,u=c+(t?t.apply(this,arguments):arguments[0]);return tr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},a.merge=ct,a.min=function(n,t,r){var e=1/0,u=e; +if(!t&&Er(n)){r=-1;for(var o=n.length;++rjt(o,r))&&(u[r]=n)}),u},a.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},a.pairs=function(n){for(var t=-1,r=Sr(n),e=r.length,u=zt(e);++tr?vr(0,e+r):gr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},a.mixin=Nt,a.noConflict=function(){return e._=Vt,this},a.parseInt=Dr,a.random=function(n,t){null==n&&null==t&&(t=1),n=+n||0,null==t?(t=n,n=0):t=+t||0;var r=yr();return n%1||t%1?n+gr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Zt(r*(t-n+1))},a.reduce=mt,a.reduceRight=dt,a.result=function(n,t){var e=n?n[t]:r; +return ut(e)?n[t]():e},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Sr(n).length},a.some=bt,a.sortedIndex=xt,a.template=function(n,t,e){var u=a.templateSettings;n||(n=""),e=Pr({},e,u);var o,i=Pr({},e.imports,u.imports),u=Sr(i),i=lt(i),c=0,l=e.interpolate||b,v="__p+='",l=Lt((e.escape||b).source+"|"+l.source+"|"+(l===y?g:b).source+"|"+(e.evaluate||b).source+"|$","g");n.replace(l,function(t,r,e,u,a,i){return e||(e=u),v+=n.slice(c,i).replace(C,K),r&&(v+="'+__e("+r+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),e&&(v+="'+((__t=("+e+"))==null?'':__t)+'"),c=i+t.length,t +}),v+="';\n",l=e=e.variable,l||(e="obj",v="with("+e+"){"+v+"}"),v=(o?v.replace(f,""):v).replace(p,"$1").replace(s,"$1;"),v="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+v+"return __p}";try{var h=qt(u,"return "+v).apply(r,i)}catch(m){throw m.source=v,m}return t?h(t):(h.source=v,h)},a.unescape=function(n){return null==n?"":Gt(n).replace(v,Y)},a.uniqueId=function(n){var t=++o;return Gt(null==n?"":n)+t +},a.all=pt,a.any=bt,a.detect=vt,a.foldl=mt,a.foldr=dt,a.include=ft,a.inject=mt,Fr(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return rr.apply(t,arguments),n.apply(a,t)})}),a.first=Ct,a.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return X(n,vr(0,u-e))}},a.take=Ct,a.head=Ct,Fr(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r); +return null==t||r&&typeof t!="function"?e:new V(e)})}),a.VERSION="1.2.1",a.prototype.toString=function(){return Gt(this.__wrapped__)},a.prototype.value=Pt,a.prototype.valueOf=Pt,Ar(["join","pop","shift"],function(n){var t=Jt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Ar(["push","reverse","sort","unshift"],function(n){var t=Jt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ar(["concat","slice","splice"],function(n){var t=Jt[n];a.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments)) +}}),wr.spliceObjects||Ar(["pop","shift","splice"],function(n){var t=Jt[n],r="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new V(e):e}}),a}var r,e=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==e&&module,a=typeof global=="object"&&global;(a.global===a||a.window===a)&&(n=a);var o=0,i={},c=+new Date+"",l=200,f=/\b__p\+='';/g,p=/\b(__p\+=)''\+/g,s=/(__e\(.*?\)|\b__t\))\+'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,h=/\w*$/,y=/<%=([\s\S]+?)%>/g,m=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",d=RegExp("^["+m+"]*0+(?=.$)"),b=/($^)/,_=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,w="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),x="[object Arguments]",E="[object Array]",O="[object Boolean]",S="[object Date]",A="[object Error]",I="[object Function]",B="[object Number]",N="[object Object]",P="[object RegExp]",z="[object String]",F={}; +F[I]=!1,F[x]=F[E]=F[O]=F[S]=F[B]=F[N]=F[P]=F[z]=!0;var $={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},D=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=D, define(function(){return D})):e&&!e.nodeType?u?(u.exports=D)._=D:e._=D:n._=D}(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index cedd4486a..6aa1d4966 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -82,7 +82,7 @@ /** Used to assign default `context` object properties */ var contextProps = [ - 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', + 'Array', 'Boolean', 'Date', 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', 'parseInt', 'setImmediate', 'setTimeout' ]; @@ -153,7 +153,6 @@ var Array = context.Array, Boolean = context.Boolean, Date = context.Date, - Error = context.Error, Function = context.Function, Math = context.Math, Number = context.Number, @@ -164,7 +163,6 @@ /** Used for `Array` and `Object` method references */ var arrayProto = Array.prototype, - errorProto = Error.prototype, objectProto = Object.prototype, stringProto = String.prototype; @@ -213,7 +211,6 @@ ctorByClass[arrayClass] = Array; ctorByClass[boolClass] = Boolean; ctorByClass[dateClass] = Date; - ctorByClass[errorClass] = Error; ctorByClass[funcClass] = Function; ctorByClass[objectClass] = Object; ctorByClass[numberClass] = Number; @@ -1986,7 +1983,7 @@ var isArr = isArray(object); callback = lodash.createCallback(callback, thisArg, 4); - if (arguments.length < 3) { + if (accumulator == null) { if (isArr) { accumulator = []; } else { diff --git a/dist/lodash.min.js b/dist/lodash.min.js index ac344b22d..145638b6b 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,41 +4,41 @@ * Build: `lodash modern -o ./dist/lodash.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n){function t(o){function f(n){if(!n||ie.call(n)!=B)return a;var t=n.valueOf,e=typeof t=="function"&&(e=ee(t))&&ee(e);return e?n==e||ee(n)==e:Z(n)}function P(n,t,e){if(!n||!q[typeof n])return n;t=t&&typeof e=="undefined"?t:G.createCallback(t,e);for(var r=-1,u=q[typeof n]?je(n):[],o=u.length;++r=s;if(e)for(var r={},u=-1;++ut||typeof n=="undefined")return 1; -if(ne?0:e);++re?ge(0,u+e):e)||0,typeof u=="number"?o=-1<(ct(n)?n.indexOf(t,e):Ot(n,t,e)):P(n,function(n){return++ru&&(u=o) -}}else t=!t&&ct(n)?J:G.createCallback(t,e),ht(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function dt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=qt(r);++earguments.length;t=G.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length; -if(typeof u!="number")var i=je(n),u=i.length;return t=G.createCallback(t,r,4),ht(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c)}),e}function jt(n,t,e){var r;t=G.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++ee?ge(0,u+e):e||0)-1;else if(e)return r=It(n,t),n[r]===t?r:-1; -for(;++r>>1,e(n[r])=s;if(v)var g={};for(r!=u&&(l=[],r=G.createCallback(r,o));++iOt(l,y))&&((r||v)&&l.push(y),c.push(o))}return c}function St(n){for(var t=-1,e=n?mt(dt(n,"length")):0,r=qt(0>e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:G}},Y.prototype=G.prototype;var ke=le,je=ve?function(n){return it(n)?ve(n):[]}:V,we={"&":"&","<":"<",">":">",'"':""","'":"'"},Ce=ut(we);return Mt&&i&&typeof ae=="function"&&(Bt=$t(ae,o)),Dt=8==he(_+"08")?he:function(n,t){return he(ct(n)?n.replace(k,""):n,t||0) -},G.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},G.assign=U,G.at=function(n){for(var t=-1,e=ne.apply(Lt,me.call(arguments,1)),r=e.length,u=qt(r);++t++l&&(i=n.apply(f,o)),c=oe(u,t),i}},G.defaults=M,G.defer=Bt,G.delay=function(n,t){var r=me.call(arguments,2); -return oe(function(){n.apply(e,r)},t)},G.difference=wt,G.filter=gt,G.flatten=xt,G.forEach=ht,G.forIn=K,G.forOwn=P,G.functions=rt,G.groupBy=function(n,t,e){var r={};return t=G.createCallback(t,e),ht(n,function(n,e,u){e=Ht(t(n,e,u)),(re.call(r,e)?r[e]:r[e]=[]).push(n)}),r},G.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=G.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return nt(n,0,ye(ge(0,a-r),a))},G.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i; -n:for(;++uOt(f,c)){o&&f.push(c);for(var v=e;--v;)if(!(r[v]||(r[v]=H(t[v])))(c))continue n;i.push(c)}}return i},G.invert=ut,G.invoke=function(n,t){var e=me.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=qt(typeof a=="number"?a:0);return ht(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},G.keys=je,G.map=bt,G.max=mt,G.memoize=function(n,t){function e(){var r=e.cache,u=p+(t?t.apply(this,arguments):arguments[0]); -return re.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},G.merge=lt,G.min=function(n,t,e){var r=1/0,u=r;if(!t&&ke(n)){e=-1;for(var a=n.length;++eOt(a,e))&&(u[e]=n)}),u},G.once=function(n){var t,e; -return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},G.pairs=function(n){for(var t=-1,e=je(n),r=e.length,u=qt(r);++targuments.length)if(u)e=[];else{var a=n&&n.constructor;e=it(a&&a.prototype)?ce(a&&a.prototype):{}}return(u?each:P)(n,function(n,r,u){return t(e,n,r,u)}),e},G.union=function(n){return ke(n)||(arguments[0]=n?me.call(n):Lt),Nt(ne.apply(Lt,arguments))},G.uniq=Nt,G.unzip=St,G.values=pt,G.where=gt,G.without=function(n){return wt(n,me.call(arguments,1)) -},G.wrap=function(n,t){return function(){var e=[n];return ue.apply(e,arguments),t.apply(this,e)}},G.zip=function(n){return n?St(arguments):[]},G.zipObject=At,G.collect=bt,G.drop=Et,G.each=ht,G.extend=U,G.methods=rt,G.object=At,G.select=gt,G.tail=Et,G.unique=Nt,Rt(G),G.chain=G,G.prototype.chain=function(){return this},G.clone=et,G.cloneDeep=function(n,t,e){return et(n,r,t,e)},G.contains=st,G.escape=function(n){return n==u?"":Ht(n).replace(w,X)},G.every=vt,G.find=yt,G.findIndex=function(n,t,e){var r=-1,u=n?n.length:0; -for(t=G.createCallback(t,e);++re?ge(0,r+e):ye(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},G.mixin=Rt,G.noConflict=function(){return o._=Wt,this},G.parseInt=Dt,G.random=function(n,t){n==u&&t==u&&(t=1),n=+n||0,t==u?(t=n,n=0):t=+t||0;var e=be();return n%1||t%1?n+ye(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+te(e*(t-n+1))},G.reduce=_t,G.reduceRight=kt,G.result=function(n,t){var r=n?n[t]:e;return ot(r)?n[t]():r},G.runInContext=t,G.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:je(n).length -},G.some=jt,G.sortedIndex=It,G.template=function(n,t,u){var a=G.templateSettings;n||(n=""),u=M({},u,a);var o,i=M({},u.imports,a.imports),a=je(i),i=pt(i),f=0,c=u.interpolate||j,l="__p+='",c=Gt((u.escape||j).source+"|"+c.source+"|"+(c===d?b:j).source+"|"+(u.evaluate||j).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(C,W),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(v,""):l).replace(g,"$1").replace(y,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}"; -try{var p=Kt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},G.unescape=function(n){return n==u?"":Ht(n).replace(h,tt)},G.uniqueId=function(n){var t=++c;return Ht(n==u?"":n)+t},G.all=vt,G.any=jt,G.detect=yt,G.foldl=_t,G.foldr=kt,G.include=st,G.inject=_t,P(G,function(n,t){G.prototype[t]||(G.prototype[t]=function(){var t=[this.__wrapped__];return ue.apply(t,arguments),n.apply(G,t)})}),G.first=Ct,G.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a; -for(t=G.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return nt(n,ge(0,a-r))}},G.take=Ct,G.head=Ct,P(G,function(n,t){G.prototype[t]||(G.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==u||e&&typeof t!="function"?r:new Y(r)})}),G.VERSION="1.2.1",G.prototype.toString=function(){return Ht(this.__wrapped__)},G.prototype.value=Tt,G.prototype.valueOf=Tt,ht(["join","pop","shift"],function(n){var t=Lt[n];G.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) -}}),ht(["push","reverse","sort","unshift"],function(n){var t=Lt[n];G.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ht(["concat","slice","splice"],function(n){var t=Lt[n];G.prototype[n]=function(){return new Y(t.apply(this.__wrapped__,arguments))}}),G}var e,r=!0,u=null,a=!1,o=typeof exports=="object"&&exports,i=typeof module=="object"&&module&&module.exports==o&&module,f=typeof global=="object"&&global;(f.global===f||f.window===f)&&(n=f);var c=0,l={},p=+new Date+"",s=200,v=/\b__p\+='';/g,g=/\b(__p\+=)''\+/g,y=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,b=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,m=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",k=RegExp("^["+_+"]*0+(?=.$)"),j=/($^)/,w=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,x="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),O="[object Arguments]",E="[object Array]",I="[object Boolean]",N="[object Date]",S="[object Error]",A="[object Function]",$="[object Number]",B="[object Object]",F="[object RegExp]",R="[object String]",T={}; -T[A]=a,T[O]=T[E]=T[I]=T[N]=T[$]=T[B]=T[F]=T[R]=r;var q={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},D={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},z=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=z, define(function(){return z})):o&&!o.nodeType?i?(i.exports=z)._=z:o._=z:n._=z})(this); \ No newline at end of file +;!function(n){function t(o){function f(n){if(!n||ae.call(n)!=$)return a;var t=n.valueOf,e=typeof t=="function"&&(e=ne(t))&&ne(e);return e?n==e||ne(n)==e:Y(n)}function z(n,t,e){if(!n||!T[typeof n])return n;t=t&&typeof e=="undefined"?t:V.createCallback(t,e);for(var r=-1,u=T[typeof n]?_e(n):[],o=u.length;++r=s;if(e)for(var r={},u=-1;++ut||typeof n=="undefined")return 1; +if(ne?0:e);++re?se(0,u+e):e)||0,typeof u=="number"?o=-1<(ft(n)?n.indexOf(t,e):xt(n,t,e)):z(n,function(n){return++ru&&(u=o) +}}else t=!t&&ft(n)?H:V.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function mt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Tt(r);++earguments.length;t=V.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length; +if(typeof u!="number")var i=_e(n),u=i.length;return t=V.createCallback(t,r,4),yt(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c)}),e}function kt(n,t,e){var r;t=V.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++ee?se(0,u+e):e||0)-1;else if(e)return r=Et(n,t),n[r]===t?r:-1;for(;++r>>1,e(n[r])=s;if(v)var g={};for(r!=u&&(l=[],r=V.createCallback(r,o));++ixt(l,y))&&((r||v)&&l.push(y),c.push(o))}return c}function Nt(n){for(var t=-1,e=n?bt(mt(n,"length")):0,r=Tt(0>e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:V}},X.prototype=V.prototype;var de=fe,_e=pe?function(n){return ot(n)?pe(n):[]}:U,ke={"&":"&","<":"<",">":">",'"':""","'":"'"},we=rt(ke);return Pt&&i&&typeof re=="function"&&($t=At(re,o)),qt=8==ge(_+"08")?ge:function(n,t){return ge(ft(n)?n.replace(k,""):n,t||0) +},V.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},V.assign=M,V.at=function(n){for(var t=-1,e=Yt.apply(Ht,he.call(arguments,1)),r=e.length,u=Tt(r);++t++l&&(i=n.apply(f,o)),c=ue(u,t),i}},V.defaults=K,V.defer=$t,V.delay=function(n,t){var r=he.call(arguments,2); +return ue(function(){n.apply(e,r)},t)},V.difference=wt,V.filter=vt,V.flatten=jt,V.forEach=yt,V.forIn=P,V.forOwn=z,V.functions=et,V.groupBy=function(n,t,e){var r={};return t=V.createCallback(t,e),yt(n,function(n,e,u){e=Vt(t(n,e,u)),(te.call(r,e)?r[e]:r[e]=[]).push(n)}),r},V.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=V.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return Z(n,0,ve(se(0,a-r),a))},V.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i; +n:for(;++uxt(f,c)){o&&f.push(c);for(var v=e;--v;)if(!(r[v]||(r[v]=G(t[v])))(c))continue n;i.push(c)}}return i},V.invert=rt,V.invoke=function(n,t){var e=he.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Tt(typeof a=="number"?a:0);return yt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},V.keys=_e,V.map=ht,V.max=bt,V.memoize=function(n,t){function e(){var r=e.cache,u=p+(t?t.apply(this,arguments):arguments[0]); +return te.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},V.merge=ct,V.min=function(n,t,e){var r=1/0,u=r;if(!t&&de(n)){e=-1;for(var a=n.length;++ext(a,e))&&(u[e]=n)}),u},V.once=function(n){var t,e; +return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},V.pairs=function(n){for(var t=-1,e=_e(n),r=e.length,u=Tt(r);++te?se(0,r+e):ve(e,r-1))+1);r--;)if(n[r]===t)return r; +return-1},V.mixin=Ft,V.noConflict=function(){return o._=Lt,this},V.parseInt=qt,V.random=function(n,t){n==u&&t==u&&(t=1),n=+n||0,t==u?(t=n,n=0):t=+t||0;var e=ye();return n%1||t%1?n+ve(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+Zt(e*(t-n+1))},V.reduce=dt,V.reduceRight=_t,V.result=function(n,t){var r=n?n[t]:e;return at(r)?n[t]():r},V.runInContext=t,V.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:_e(n).length},V.some=kt,V.sortedIndex=Et,V.template=function(n,t,u){var a=V.templateSettings; +n||(n=""),u=K({},u,a);var o,i=K({},u.imports,a.imports),a=_e(i),i=lt(i),f=0,c=u.interpolate||w,l="__p+='",c=Ut((u.escape||w).source+"|"+c.source+"|"+(c===d?b:w).source+"|"+(u.evaluate||w).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(j,Q),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(v,""):l).replace(g,"$1").replace(y,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}"; +try{var p=zt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},V.unescape=function(n){return n==u?"":Vt(n).replace(h,nt)},V.uniqueId=function(n){var t=++c;return Vt(n==u?"":n)+t},V.all=st,V.any=kt,V.detect=gt,V.foldl=dt,V.foldr=_t,V.include=pt,V.inject=dt,z(V,function(n,t){V.prototype[t]||(V.prototype[t]=function(){var t=[this.__wrapped__];return ee.apply(t,arguments),n.apply(V,t)})}),V.first=Ct,V.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a; +for(t=V.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return Z(n,se(0,a-r))}},V.take=Ct,V.head=Ct,z(V,function(n,t){V.prototype[t]||(V.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==u||e&&typeof t!="function"?r:new X(r)})}),V.VERSION="1.2.1",V.prototype.toString=function(){return Vt(this.__wrapped__)},V.prototype.value=Rt,V.prototype.valueOf=Rt,yt(["join","pop","shift"],function(n){var t=Ht[n];V.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) +}}),yt(["push","reverse","sort","unshift"],function(n){var t=Ht[n];V.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),yt(["concat","slice","splice"],function(n){var t=Ht[n];V.prototype[n]=function(){return new X(t.apply(this.__wrapped__,arguments))}}),V}var e,r=!0,u=null,a=!1,o=typeof exports=="object"&&exports,i=typeof module=="object"&&module&&module.exports==o&&module,f=typeof global=="object"&&global;(f.global===f||f.window===f)&&(n=f);var c=0,l={},p=+new Date+"",s=200,v=/\b__p\+='';/g,g=/\b(__p\+=)''\+/g,y=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,b=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,m=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",k=RegExp("^["+_+"]*0+(?=.$)"),w=/($^)/,C=/[&<>"']/g,j=/['\n\r\t\u2028\u2029\\]/g,x="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),O="[object Arguments]",E="[object Array]",I="[object Boolean]",N="[object Date]",S="[object Function]",A="[object Number]",$="[object Object]",B="[object RegExp]",F="[object String]",R={}; +R[S]=a,R[O]=R[E]=R[I]=R[N]=R[A]=R[$]=R[B]=R[F]=r;var T={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},D=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=D, define(function(){return D})):o&&!o.nodeType?i?(i.exports=D)._=D:o._=D:n._=D}(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 26cf100de..55f792e3e 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -105,7 +105,6 @@ /** Used for `Array` and `Object` method references */ var arrayProto = Array.prototype, - errorProto = Error.prototype, objectProto = Object.prototype, stringProto = String.prototype; diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index f51d4be4b..ab0b810c9 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -4,7 +4,7 @@ * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n){function t(n){return n instanceof t?n:new a(n)}function r(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(nt||typeof n=="undefined")return 1;if(n$(a,f))&&(r&&a.push(f),i.push(e))}return i}function P(n,t){return Rt.fastBind||wt&&2"']/g,nt=/['\n\r\t\u2028\u2029\\]/g,tt="[object Arguments]",rt="[object Array]",et="[object Boolean]",ut="[object Date]",ot="[object Number]",it="[object Object]",at="[object RegExp]",ft="[object String]",ct={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},lt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},pt=Array.prototype,J=Object.prototype,st=n._,vt=RegExp("^"+(J.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),gt=Math.ceil,ht=n.clearTimeout,yt=pt.concat,mt=Math.floor,_t=J.hasOwnProperty,bt=pt.push,dt=n.setTimeout,jt=J.toString,wt=vt.test(wt=jt.bind)&&wt,At=vt.test(At=Object.create)&&At,xt=vt.test(xt=Array.isArray)&&xt,Ot=n.isFinite,Et=n.isNaN,St=vt.test(St=Object.keys)&&St,Nt=Math.max,Bt=Math.min,Ft=Math.random,kt=pt.slice,J=vt.test(n.attachEvent),qt=wt&&!/\n|true/.test(wt+J),Rt={}; -(function(){var n={0:1,length:1};Rt.fastBind=wt&&!qt,Rt.spliceObjects=(pt.splice.call(n,0,1),!n[0])})(1),t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},At||(u=function(n){if(_(n)){f.prototype=n;var t=new f;f.prototype=null}return t||{}}),a.prototype=t.prototype,l(arguments)||(l=function(n){return n?_t.call(n,"callee"):!1});var Dt=xt||function(n){return n?typeof n=="object"&&jt.call(n)==rt:!1},xt=function(n){var t,r=[];if(!n||!ct[typeof n])return r; +!function(){var n={0:1,length:1};Rt.fastBind=wt&&!qt,Rt.spliceObjects=(pt.splice.call(n,0,1),!n[0])}(1),t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},At||(u=function(n){if(_(n)){f.prototype=n;var t=new f;f.prototype=null}return t||{}}),a.prototype=t.prototype,l(arguments)||(l=function(n){return n?_t.call(n,"callee"):!1});var Dt=xt||function(n){return n?typeof n=="object"&&jt.call(n)==rt:!1},xt=function(n){var t,r=[];if(!n||!ct[typeof n])return r; for(t in n)_t.call(n,t)&&r.push(t);return r},Mt=St?function(n){return _(n)?St(n):[]}:xt,Tt={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=g(Tt),It=function(n,t){var r;if(!n||!ct[typeof n])return n;for(r in n)if(t(n[r],r,n)===L)break;return n},zt=function(n,t){var r;if(!n||!ct[typeof n])return n;for(r in n)if(_t.call(n,r)&&t(n[r],r,n)===L)break;return n};m(/x/)&&(m=function(n){return typeof n=="function"&&"[object Function]"==jt.call(n)}),t.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0 }},t.bind=P,t.bindAll=function(n){for(var t=1 ## `Arrays` -* [`chain.compact`](#_compactarray) -* [`chain.difference`](#_differencearray--array1-array2-) -* [`chain.drop`](#_restarray--callbackn1-thisarg) -* [`chain.findIndex`](#_findindexarray--callbackidentity-thisarg) -* [`chain.first`](#_firstarray--callbackn-thisarg) -* [`chain.flatten`](#_flattenarray--isshallowfalse-callbackidentity-thisarg) -* [`chain.head`](#_firstarray--callbackn-thisarg) -* [`chain.indexOf`](#_indexofarray-value--fromindex0) -* [`chain.initial`](#_initialarray--callbackn1-thisarg) -* [`chain.intersection`](#_intersectionarray1-array2-) -* [`chain.last`](#_lastarray--callbackn-thisarg) -* [`chain.lastIndexOf`](#_lastindexofarray-value--fromindexarraylength-1) -* [`chain.object`](#_zipobjectkeys--values) -* [`chain.range`](#_rangestart0-end--step1) -* [`chain.rest`](#_restarray--callbackn1-thisarg) -* [`chain.sortedIndex`](#_sortedindexarray-value--callbackidentity-thisarg) -* [`chain.tail`](#_restarray--callbackn1-thisarg) -* [`chain.take`](#_firstarray--callbackn-thisarg) -* [`chain.union`](#_unionarray1-array2-) -* [`chain.uniq`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`chain.unique`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`chain.unzip`](#_unziparray) -* [`chain.without`](#_withoutarray--value1-value2-) -* [`chain.zip`](#_ziparray1-array2-) -* [`chain.zipObject`](#_zipobjectkeys--values) +* [`_.compact`](#_compactarray) +* [`_.difference`](#_differencearray--array1-array2-) +* [`_.drop`](#_restarray--callbackn1-thisarg) +* [`_.findIndex`](#_findindexarray--callbackidentity-thisarg) +* [`_.first`](#_firstarray--callbackn-thisarg) +* [`_.flatten`](#_flattenarray--isshallowfalse-callbackidentity-thisarg) +* [`_.head`](#_firstarray--callbackn-thisarg) +* [`_.indexOf`](#_indexofarray-value--fromindex0) +* [`_.initial`](#_initialarray--callbackn1-thisarg) +* [`_.intersection`](#_intersectionarray1-array2-) +* [`_.last`](#_lastarray--callbackn-thisarg) +* [`_.lastIndexOf`](#_lastindexofarray-value--fromindexarraylength-1) +* [`_.object`](#_zipobjectkeys--values) +* [`_.range`](#_rangestart0-end--step1) +* [`_.rest`](#_restarray--callbackn1-thisarg) +* [`_.sortedIndex`](#_sortedindexarray-value--callbackidentity-thisarg) +* [`_.tail`](#_restarray--callbackn1-thisarg) +* [`_.take`](#_firstarray--callbackn-thisarg) +* [`_.union`](#_unionarray1-array2-) +* [`_.uniq`](#_uniqarray--issortedfalse-callbackidentity-thisarg) +* [`_.unique`](#_uniqarray--issortedfalse-callbackidentity-thisarg) +* [`_.unzip`](#_unziparray) +* [`_.without`](#_withoutarray--value1-value2-) +* [`_.zip`](#_ziparray1-array2-) +* [`_.zipObject`](#_zipobjectkeys--values) @@ -38,11 +38,12 @@ ## `Chaining` -* [`chain`](#_value) -* [`chain.tap`](#_tapvalue-interceptor) -* [`chain.prototype.toString`](#_prototypetostring) -* [`chain.prototype.value`](#_prototypevalueof) -* [`chain.prototype.valueOf`](#_prototypevalueof) +* [`_`](#_value) +* [`_.chain`](#_value) +* [`_.tap`](#_tapvalue-interceptor) +* [`_.prototype.toString`](#_prototypetostring) +* [`_.prototype.value`](#_prototypevalueof) +* [`_.prototype.valueOf`](#_prototypevalueof) @@ -50,38 +51,38 @@ ## `Collections` -* [`chain.all`](#_everycollection--callbackidentity-thisarg) -* [`chain.any`](#_somecollection--callbackidentity-thisarg) -* [`chain.at`](#_atcollection--index1-index2-) -* [`chain.collect`](#_mapcollection--callbackidentity-thisarg) -* [`chain.contains`](#_containscollection-target--fromindex0) -* [`chain.countBy`](#_countbycollection--callbackidentity-thisarg) -* [`chain.detect`](#_findcollection--callbackidentity-thisarg) -* [`chain.each`](#_foreachcollection--callbackidentity-thisarg) -* [`chain.every`](#_everycollection--callbackidentity-thisarg) -* [`chain.filter`](#_filtercollection--callbackidentity-thisarg) -* [`chain.find`](#_findcollection--callbackidentity-thisarg) -* [`chain.foldl`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`chain.foldr`](#_reducerightcollection--callbackidentity-accumulator-thisarg) -* [`chain.forEach`](#_foreachcollection--callbackidentity-thisarg) -* [`chain.groupBy`](#_groupbycollection--callbackidentity-thisarg) -* [`chain.include`](#_containscollection-target--fromindex0) -* [`chain.inject`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`chain.invoke`](#_invokecollection-methodname--arg1-arg2-) -* [`chain.map`](#_mapcollection--callbackidentity-thisarg) -* [`chain.max`](#_maxcollection--callbackidentity-thisarg) -* [`chain.min`](#_mincollection--callbackidentity-thisarg) -* [`chain.pluck`](#_pluckcollection-property) -* [`chain.reduce`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`chain.reduceRight`](#_reducerightcollection--callbackidentity-accumulator-thisarg) -* [`chain.reject`](#_rejectcollection--callbackidentity-thisarg) -* [`chain.select`](#_filtercollection--callbackidentity-thisarg) -* [`chain.shuffle`](#_shufflecollection) -* [`chain.size`](#_sizecollection) -* [`chain.some`](#_somecollection--callbackidentity-thisarg) -* [`chain.sortBy`](#_sortbycollection--callbackidentity-thisarg) -* [`chain.toArray`](#_toarraycollection) -* [`chain.where`](#_wherecollection-properties) +* [`_.all`](#_everycollection--callbackidentity-thisarg) +* [`_.any`](#_somecollection--callbackidentity-thisarg) +* [`_.at`](#_atcollection--index1-index2-) +* [`_.collect`](#_mapcollection--callbackidentity-thisarg) +* [`_.contains`](#_containscollection-target--fromindex0) +* [`_.countBy`](#_countbycollection--callbackidentity-thisarg) +* [`_.detect`](#_findcollection--callbackidentity-thisarg) +* [`_.each`](#_foreachcollection--callbackidentity-thisarg) +* [`_.every`](#_everycollection--callbackidentity-thisarg) +* [`_.filter`](#_filtercollection--callbackidentity-thisarg) +* [`_.find`](#_findcollection--callbackidentity-thisarg) +* [`_.foldl`](#_reducecollection--callbackidentity-accumulator-thisarg) +* [`_.foldr`](#_reducerightcollection--callbackidentity-accumulator-thisarg) +* [`_.forEach`](#_foreachcollection--callbackidentity-thisarg) +* [`_.groupBy`](#_groupbycollection--callbackidentity-thisarg) +* [`_.include`](#_containscollection-target--fromindex0) +* [`_.inject`](#_reducecollection--callbackidentity-accumulator-thisarg) +* [`_.invoke`](#_invokecollection-methodname--arg1-arg2-) +* [`_.map`](#_mapcollection--callbackidentity-thisarg) +* [`_.max`](#_maxcollection--callbackidentity-thisarg) +* [`_.min`](#_mincollection--callbackidentity-thisarg) +* [`_.pluck`](#_pluckcollection-property) +* [`_.reduce`](#_reducecollection--callbackidentity-accumulator-thisarg) +* [`_.reduceRight`](#_reducerightcollection--callbackidentity-accumulator-thisarg) +* [`_.reject`](#_rejectcollection--callbackidentity-thisarg) +* [`_.select`](#_filtercollection--callbackidentity-thisarg) +* [`_.shuffle`](#_shufflecollection) +* [`_.size`](#_sizecollection) +* [`_.some`](#_somecollection--callbackidentity-thisarg) +* [`_.sortBy`](#_sortbycollection--callbackidentity-thisarg) +* [`_.toArray`](#_toarraycollection) +* [`_.where`](#_wherecollection-properties) @@ -89,21 +90,21 @@ ## `Functions` -* [`chain.after`](#_aftern-func) -* [`chain.bind`](#_bindfunc--thisarg-arg1-arg2-) -* [`chain.bindAll`](#_bindallobject--methodname1-methodname2-) -* [`chain.bindKey`](#_bindkeyobject-key--arg1-arg2-) -* [`chain.compose`](#_composefunc1-func2-) -* [`chain.createCallback`](#_createcallbackfuncidentity-thisarg-argcount3) -* [`chain.debounce`](#_debouncefunc-wait-options) -* [`chain.defer`](#_deferfunc--arg1-arg2-) -* [`chain.delay`](#_delayfunc-wait--arg1-arg2-) -* [`chain.memoize`](#_memoizefunc--resolver) -* [`chain.once`](#_oncefunc) -* [`chain.partial`](#_partialfunc--arg1-arg2-) -* [`chain.partialRight`](#_partialrightfunc--arg1-arg2-) -* [`chain.throttle`](#_throttlefunc-wait-options) -* [`chain.wrap`](#_wrapvalue-wrapper) +* [`_.after`](#_aftern-func) +* [`_.bind`](#_bindfunc--thisarg-arg1-arg2-) +* [`_.bindAll`](#_bindallobject--methodname1-methodname2-) +* [`_.bindKey`](#_bindkeyobject-key--arg1-arg2-) +* [`_.compose`](#_composefunc1-func2-) +* [`_.createCallback`](#_createcallbackfuncidentity-thisarg-argcount3) +* [`_.debounce`](#_debouncefunc-wait-options) +* [`_.defer`](#_deferfunc--arg1-arg2-) +* [`_.delay`](#_delayfunc-wait--arg1-arg2-) +* [`_.memoize`](#_memoizefunc--resolver) +* [`_.once`](#_oncefunc) +* [`_.partial`](#_partialfunc--arg1-arg2-) +* [`_.partialRight`](#_partialrightfunc--arg1-arg2-) +* [`_.throttle`](#_throttlefunc-wait-options) +* [`_.wrap`](#_wrapvalue-wrapper) @@ -111,41 +112,42 @@ ## `Objects` -* [`chain.assign`](#_assignobject--source1-source2--callback-thisarg) -* [`chain.clone`](#_clonevalue--deepfalse-callback-thisarg) -* [`chain.cloneDeep`](#_clonedeepvalue--callback-thisarg) -* [`chain.defaults`](#_defaultsobject--source1-source2-) -* [`chain.extend`](#_assignobject--source1-source2--callback-thisarg) -* [`chain.findKey`](#_findkeyobject--callbackidentity-thisarg) -* [`chain.forIn`](#_forinobject--callbackidentity-thisarg) -* [`chain.forOwn`](#_forownobject--callbackidentity-thisarg) -* [`chain.functions`](#_functionsobject) -* [`chain.has`](#_hasobject-property) -* [`chain.invert`](#_invertobject) -* [`chain.isArguments`](#_isargumentsvalue) -* [`chain.isArray`](#_isarrayvalue) -* [`chain.isBoolean`](#_isbooleanvalue) -* [`chain.isDate`](#_isdatevalue) -* [`chain.isElement`](#_iselementvalue) -* [`chain.isEmpty`](#_isemptyvalue) -* [`chain.isEqual`](#_isequala-b--callback-thisarg) -* [`chain.isFinite`](#_isfinitevalue) -* [`chain.isFunction`](#_isfunctionvalue) -* [`chain.isNaN`](#_isnanvalue) -* [`chain.isNull`](#_isnullvalue) -* [`chain.isNumber`](#_isnumbervalue) -* [`chain.isObject`](#_isobjectvalue) -* [`chain.isPlainObject`](#_isplainobjectvalue) -* [`chain.isRegExp`](#_isregexpvalue) -* [`chain.isString`](#_isstringvalue) -* [`chain.isUndefined`](#_isundefinedvalue) -* [`chain.keys`](#_keysobject) -* [`chain.merge`](#_mergeobject--source1-source2--callback-thisarg) -* [`chain.methods`](#_functionsobject) -* [`chain.omit`](#_omitobject-callback-prop1-prop2--thisarg) -* [`chain.pairs`](#_pairsobject) -* [`chain.pick`](#_pickobject-callback-prop1-prop2--thisarg) -* [`chain.values`](#_valuesobject) +* [`_.assign`](#_assignobject--source1-source2--callback-thisarg) +* [`_.clone`](#_clonevalue--deepfalse-callback-thisarg) +* [`_.cloneDeep`](#_clonedeepvalue--callback-thisarg) +* [`_.defaults`](#_defaultsobject--source1-source2-) +* [`_.extend`](#_assignobject--source1-source2--callback-thisarg) +* [`_.findKey`](#_findkeyobject--callbackidentity-thisarg) +* [`_.forIn`](#_forinobject--callbackidentity-thisarg) +* [`_.forOwn`](#_forownobject--callbackidentity-thisarg) +* [`_.functions`](#_functionsobject) +* [`_.has`](#_hasobject-property) +* [`_.invert`](#_invertobject) +* [`_.isArguments`](#_isargumentsvalue) +* [`_.isArray`](#_isarrayvalue) +* [`_.isBoolean`](#_isbooleanvalue) +* [`_.isDate`](#_isdatevalue) +* [`_.isElement`](#_iselementvalue) +* [`_.isEmpty`](#_isemptyvalue) +* [`_.isEqual`](#_isequala-b--callback-thisarg) +* [`_.isFinite`](#_isfinitevalue) +* [`_.isFunction`](#_isfunctionvalue) +* [`_.isNaN`](#_isnanvalue) +* [`_.isNull`](#_isnullvalue) +* [`_.isNumber`](#_isnumbervalue) +* [`_.isObject`](#_isobjectvalue) +* [`_.isPlainObject`](#_isplainobjectvalue) +* [`_.isRegExp`](#_isregexpvalue) +* [`_.isString`](#_isstringvalue) +* [`_.isUndefined`](#_isundefinedvalue) +* [`_.keys`](#_keysobject) +* [`_.merge`](#_mergeobject--source1-source2--callback-thisarg) +* [`_.methods`](#_functionsobject) +* [`_.omit`](#_omitobject-callback-prop1-prop2--thisarg) +* [`_.pairs`](#_pairsobject) +* [`_.pick`](#_pickobject-callback-prop1-prop2--thisarg) +* [`_.transform`](#_transformcollection--callbackidentity-accumulator-thisarg) +* [`_.values`](#_valuesobject) @@ -153,17 +155,18 @@ ## `Utilities` -* [`chain.escape`](#_escapestring) -* [`chain.identity`](#_identityvalue) -* [`chain.mixin`](#_mixinobject) -* [`chain.noConflict`](#_noconflict) -* [`chain.parseInt`](#_parseintvalue--radix) -* [`chain.random`](#_randommin0-max1) -* [`chain.result`](#_resultobject-property) -* [`chain.template`](#_templatetext-data-options) -* [`chain.times`](#_timesn-callback--thisarg) -* [`chain.unescape`](#_unescapestring) -* [`chain.uniqueId`](#_uniqueidprefix) +* [`_.escape`](#_escapestring) +* [`_.identity`](#_identityvalue) +* [`_.mixin`](#_mixinobject) +* [`_.noConflict`](#_noconflict) +* [`_.parseInt`](#_parseintvalue--radix) +* [`_.random`](#_randommin0-max1) +* [`_.result`](#_resultobject-property) +* [`_.runInContext`](#_runincontextcontextwindow) +* [`_.template`](#_templatetext-data-options) +* [`_.times`](#_timesn-callback--thisarg) +* [`_.unescape`](#_unescapestring) +* [`_.uniqueId`](#_uniqueidprefix) @@ -179,11 +182,11 @@ ## `Properties` -* [`chain.VERSION`](#_version) -* [`enumErrorProps`](#enumerrorprops) +* [`_.VERSION`](#_version) * [`_.support`](#_support) * [`_.support.argsClass`](#_supportargsclass) * [`_.support.argsObject`](#_supportargsobject) +* [`_.support.enumErrorProps`](#_supportenumerrorprops) * [`_.support.enumPrototypes`](#_supportenumprototypes) * [`_.support.fastBind`](#_supportfastbind) * [`_.support.nonEnumArgs`](#_supportnonenumargs) @@ -213,8 +216,8 @@ -### `chain.compact(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3339 "View in source") [Ⓣ][1] +### `_.compact(array)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3410 "View in source") [Ⓣ][1] Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. @@ -237,8 +240,8 @@ _.compact([0, 1, false, 2, '', 3]); -### `chain.difference(array [, array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3369 "View in source") [Ⓣ][1] +### `_.difference(array [, array1, array2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3440 "View in source") [Ⓣ][1] Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`. @@ -262,8 +265,8 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]); -### `chain.findIndex(array [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3405 "View in source") [Ⓣ][1] +### `_.findIndex(array [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3476 "View in source") [Ⓣ][1] This method is similar to `_.find`, except that it returns the index of the element that passes the callback check, instead of the element itself. @@ -290,8 +293,8 @@ _.findIndex(['apple', 'banana', 'beet'], function(food) { -### `chain.first(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3475 "View in source") [Ⓣ][1] +### `_.first(array [, callback|n, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3546 "View in source") [Ⓣ][1] Gets the first element of the `array`. If a number `n` is passed, the first `n` elements of the `array` are returned. If a `callback` function is passed, elements at the beginning of the array are returned as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -350,8 +353,8 @@ _.first(food, { 'type': 'fruit' }); -### `chain.flatten(array [, isShallow=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3537 "View in source") [Ⓣ][1] +### `_.flatten(array [, isShallow=false, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3608 "View in source") [Ⓣ][1] Flattens a nested array *(the nesting can be to any depth)*. If `isShallow` is truthy, `array` will only be flattened a single level. If `callback` is passed, each element of `array` is passed through a `callback` before flattening. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -393,8 +396,8 @@ _.flatten(stooges, 'quotes'); -### `chain.indexOf(array, value [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3590 "View in source") [Ⓣ][1] +### `_.indexOf(array, value [, fromIndex=0])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3661 "View in source") [Ⓣ][1] Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search. @@ -425,8 +428,8 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true); -### `chain.initial(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3664 "View in source") [Ⓣ][1] +### `_.initial(array [, callback|n=1, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3735 "View in source") [Ⓣ][1] Gets all but the last element of `array`. If a number `n` is passed, the last `n` elements are excluded from the result. If a `callback` function is passed, elements at the end of the array are excluded from the result as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -482,8 +485,8 @@ _.initial(food, { 'type': 'vegetable' }); -### `chain.intersection([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3698 "View in source") [Ⓣ][1] +### `_.intersection([array1, array2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3769 "View in source") [Ⓣ][1] Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`. @@ -506,8 +509,8 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); -### `chain.last(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3790 "View in source") [Ⓣ][1] +### `_.last(array [, callback|n, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3861 "View in source") [Ⓣ][1] Gets the last element of the `array`. If a number `n` is passed, the last `n` elements of the `array` are returned. If a `callback` function is passed, elements at the end of the array are returned as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments;(value, index, array). @@ -563,8 +566,8 @@ _.last(food, { 'type': 'vegetable' }); -### `chain.lastIndexOf(array, value [, fromIndex=array.length-1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3831 "View in source") [Ⓣ][1] +### `_.lastIndexOf(array, value [, fromIndex=array.length-1])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3902 "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. @@ -592,8 +595,8 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); -### `chain.range([start=0], end [, step=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3872 "View in source") [Ⓣ][1] +### `_.range([start=0], end [, step=1])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3943 "View in source") [Ⓣ][1] Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. @@ -630,8 +633,8 @@ _.range(0); -### `chain.rest(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3951 "View in source") [Ⓣ][1] +### `_.rest(array [, callback|n=1, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4022 "View in source") [Ⓣ][1] The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is passed, the first `n` values are excluded from the result. If a `callback` function is passed, elements at the beginning of the array are excluded from the result as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -690,8 +693,8 @@ _.rest(food, { 'type': 'fruit' }); -### `chain.sortedIndex(array, value [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4015 "View in source") [Ⓣ][1] +### `_.sortedIndex(array, value [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4086 "View in source") [Ⓣ][1] Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. @@ -739,8 +742,8 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { -### `chain.union([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4047 "View in source") [Ⓣ][1] +### `_.union([array1, array2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4118 "View in source") [Ⓣ][1] Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`. @@ -763,8 +766,8 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); -### `chain.uniq(array [, isSorted=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4097 "View in source") [Ⓣ][1] +### `_.uniq(array [, isSorted=false, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4168 "View in source") [Ⓣ][1] Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through a `callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -810,8 +813,8 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); -### `chain.unzip(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4155 "View in source") [Ⓣ][1] +### `_.unzip(array)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4226 "View in source") [Ⓣ][1] The inverse of `_.zip`, this method splits groups of elements into arrays composed of elements from each group at their corresponding indexes. @@ -834,8 +837,8 @@ _.unzip([['moe', 30, true], ['larry', 40, false]]); -### `chain.without(array [, value1, value2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4181 "View in source") [Ⓣ][1] +### `_.without(array [, value1, value2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4252 "View in source") [Ⓣ][1] Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`. @@ -859,8 +862,8 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); -### `chain.zip([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4201 "View in source") [Ⓣ][1] +### `_.zip([array1, array2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4272 "View in source") [Ⓣ][1] Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion. @@ -883,8 +886,8 @@ _.zip(['moe', 'larry'], [30, 40], [true, false]); -### `chain.zipObject(keys [, values=[]])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4223 "View in source") [Ⓣ][1] +### `_.zipObject(keys [, values=[]])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4294 "View in source") [Ⓣ][1] Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`. @@ -918,8 +921,64 @@ _.zipObject(['moe', 'larry'], [30, 40]); -### `chain.tap(value, interceptor)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5297 "View in source") [Ⓣ][1] +### `_(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L309 "View in source") [Ⓣ][1] + +Creates a `lodash` object, which wraps the given `value`, to enable method chaining. + +In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
+`concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift` + +Chaining is supported in custom builds as long as the `value` method is implicitly or explicitly included in the build. + +The chainable wrapper functions are:
+`after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, `concat`, `countBy`, `createCallback`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, and `zip` + +The non-chainable wrapper functions are:
+`clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, `template`, `unescape`, `uniqueId`, and `value` + +The wrapper functions `first` and `last` return wrapped values when `n` is passed, otherwise they return unwrapped values. + +#### Aliases +*chain* + +#### Arguments +1. `value` *(Mixed)*: The value to wrap in a `lodash` instance. + +#### Returns +*(Object)*: Returns a `lodash` instance. + +#### Example +```js +var wrapped = _([1, 2, 3]); + +// returns an unwrapped value +wrapped.reduce(function(sum, num) { + return sum + num; +}); +// => 6 + +// returns a wrapped value +var squares = wrapped.map(function(num) { + return num * num; +}); + +_.isArray(squares); +// => false + +_.isArray(squares.value()); +// => true +``` + +* * * + + + + + + +### `_.tap(value, interceptor)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5368 "View in source") [Ⓣ][1] Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. @@ -948,8 +1007,8 @@ _([1, 2, 3, 4]) -### `chain.prototype.toString()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5314 "View in source") [Ⓣ][1] +### `_.prototype.toString()` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5385 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. @@ -969,8 +1028,8 @@ _([1, 2, 3]).toString(); -### `chain.prototype.valueOf()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5331 "View in source") [Ⓣ][1] +### `_.prototype.valueOf()` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5402 "View in source") [Ⓣ][1] Extracts the wrapped value. @@ -1000,8 +1059,8 @@ _([1, 2, 3]).valueOf(); -### `chain.at(collection [, index1, index2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2328 "View in source") [Ⓣ][1] +### `_.at(collection [, index1, index2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2399 "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. @@ -1028,8 +1087,8 @@ _.at(['moe', 'larry', 'curly'], 0, 2); -### `chain.contains(collection, target [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2370 "View in source") [Ⓣ][1] +### `_.contains(collection, target [, fromIndex=0])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2441 "View in source") [Ⓣ][1] Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. @@ -1066,8 +1125,8 @@ _.contains('curly', 'ur'); -### `chain.countBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2424 "View in source") [Ⓣ][1] +### `_.countBy(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2495 "View in source") [Ⓣ][1] Creates an object composed of keys returned from running each element of the `collection` through the given `callback`. The corresponding value of each key is the number of times the key was returned by the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1102,8 +1161,8 @@ _.countBy(['one', 'two', 'three'], 'length'); -### `chain.every(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2476 "View in source") [Ⓣ][1] +### `_.every(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2547 "View in source") [Ⓣ][1] Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1148,8 +1207,8 @@ _.every(stooges, { 'age': 50 }); -### `chain.filter(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2537 "View in source") [Ⓣ][1] +### `_.filter(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2608 "View in source") [Ⓣ][1] Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1194,8 +1253,8 @@ _.filter(food, { 'type': 'fruit' }); -### `chain.find(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2604 "View in source") [Ⓣ][1] +### `_.find(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2675 "View in source") [Ⓣ][1] Examines each element in a `collection`, returning the first that the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1243,8 +1302,8 @@ _.find(food, 'organic'); -### `chain.forEach(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2651 "View in source") [Ⓣ][1] +### `_.forEach(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2722 "View in source") [Ⓣ][1] Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -1275,8 +1334,8 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); -### `chain.groupBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2701 "View in source") [Ⓣ][1] +### `_.groupBy(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2772 "View in source") [Ⓣ][1] Creates an object composed of keys returned from running each element of the `collection` through the `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1312,8 +1371,8 @@ _.groupBy(['one', 'two', 'three'], 'length'); -### `chain.invoke(collection, methodName [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2734 "View in source") [Ⓣ][1] +### `_.invoke(collection, methodName [, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2805 "View in source") [Ⓣ][1] Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`. @@ -1341,8 +1400,8 @@ _.invoke([123, 456], String.prototype.split, ''); -### `chain.map(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2786 "View in source") [Ⓣ][1] +### `_.map(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2857 "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)*. @@ -1386,8 +1445,8 @@ _.map(stooges, 'name'); -### `chain.max(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2843 "View in source") [Ⓣ][1] +### `_.max(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2914 "View in source") [Ⓣ][1] Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1428,8 +1487,8 @@ _.max(stooges, 'age'); -### `chain.min(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2912 "View in source") [Ⓣ][1] +### `_.min(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2983 "View in source") [Ⓣ][1] Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1470,8 +1529,8 @@ _.min(stooges, 'age'); -### `chain.pluck(collection, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2962 "View in source") [Ⓣ][1] +### `_.pluck(collection, property)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3033 "View in source") [Ⓣ][1] Retrieves the value of a specified property from all elements in the `collection`. @@ -1500,8 +1559,8 @@ _.pluck(stooges, 'name'); -### `chain.reduce(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2994 "View in source") [Ⓣ][1] +### `_.reduce(collection [, callback=identity, accumulator, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3065 "View in source") [Ⓣ][1] Reduces a `collection` to a value which is the accumulated result of running each element in the `collection` through the `callback`, where each successive `callback` execution consumes the return value of the previous execution. If `accumulator` is not passed, the first element of the `collection` will be used as the initial `accumulator` value. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, index|key, collection)*. @@ -1538,8 +1597,8 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { -### `chain.reduceRight(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3037 "View in source") [Ⓣ][1] +### `_.reduceRight(collection [, callback=identity, accumulator, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3108 "View in source") [Ⓣ][1] This method is similar to `_.reduce`, except that it iterates over a `collection` from right to left. @@ -1569,8 +1628,8 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); -### `chain.reject(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3097 "View in source") [Ⓣ][1] +### `_.reject(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3168 "View in source") [Ⓣ][1] The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for. @@ -1612,8 +1671,8 @@ _.reject(food, { 'type': 'fruit' }); -### `chain.shuffle(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3118 "View in source") [Ⓣ][1] +### `_.shuffle(collection)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3189 "View in source") [Ⓣ][1] Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. @@ -1636,8 +1695,8 @@ _.shuffle([1, 2, 3, 4, 5, 6]); -### `chain.size(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3151 "View in source") [Ⓣ][1] +### `_.size(collection)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3222 "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. @@ -1666,8 +1725,8 @@ _.size('curly'); -### `chain.some(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3198 "View in source") [Ⓣ][1] +### `_.some(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3269 "View in source") [Ⓣ][1] Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1712,8 +1771,8 @@ _.some(food, { 'type': 'meat' }); -### `chain.sortBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3254 "View in source") [Ⓣ][1] +### `_.sortBy(collection [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3325 "View in source") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in the `collection` through the `callback`. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1749,8 +1808,8 @@ _.sortBy(['banana', 'strawberry', 'apple'], 'length'); -### `chain.toArray(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3289 "View in source") [Ⓣ][1] +### `_.toArray(collection)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3360 "View in source") [Ⓣ][1] Converts the `collection` to an array. @@ -1773,8 +1832,8 @@ Converts the `collection` to an array. -### `chain.where(collection, properties)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3321 "View in source") [Ⓣ][1] +### `_.where(collection, properties)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3392 "View in source") [Ⓣ][1] Examines each element in a `collection`, returning an array of all elements that have the given `properties`. When checking `properties`, this method performs a deep comparison between values to determine if they are equivalent to each other. @@ -1810,8 +1869,8 @@ _.where(stooges, { 'age': 40 }); -### `chain.after(n, func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4263 "View in source") [Ⓣ][1] +### `_.after(n, func)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4334 "View in source") [Ⓣ][1] If `n` is greater than `0`, a function is created that is restricted to executing `func`, with the `this` binding and arguments of the created function, only after it is called `n` times. If `n` is less than `1`, `func` is executed immediately, without a `this` binding or additional arguments, and its result is returned. @@ -1838,8 +1897,8 @@ _.forEach(notes, function(note) { -### `chain.bind(func [, thisArg, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4296 "View in source") [Ⓣ][1] +### `_.bind(func [, thisArg, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4367 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function. @@ -1869,8 +1928,8 @@ func(); -### `chain.bindAll(object [, methodName1, methodName2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4327 "View in source") [Ⓣ][1] +### `_.bindAll(object [, methodName1, methodName2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4398 "View in source") [Ⓣ][1] Binds methods on `object` to `object`, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided, all the function properties of `object` will be bound. @@ -1900,8 +1959,8 @@ jQuery('#docs').on('click', view.onClick); -### `chain.bindKey(object, key [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4373 "View in source") [Ⓣ][1] +### `_.bindKey(object, key [, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4444 "View in source") [Ⓣ][1] Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern. @@ -1941,8 +2000,8 @@ func(); -### `chain.compose([func1, func2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4396 "View in source") [Ⓣ][1] +### `_.compose([func1, func2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4467 "View in source") [Ⓣ][1] Creates a function that is the composition of the passed functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. @@ -1968,8 +2027,8 @@ welcome('moe'); -### `chain.createCallback([func=identity, thisArg, argCount=3])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4455 "View in source") [Ⓣ][1] +### `_.createCallback([func=identity, thisArg, argCount=3])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4526 "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`. @@ -2022,8 +2081,8 @@ _.toLookup(stooges, 'name'); -### `chain.debounce(func, wait, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4531 "View in source") [Ⓣ][1] +### `_.debounce(func, wait, options)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4602 "View in source") [Ⓣ][1] Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass an `options` object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. @@ -2055,8 +2114,8 @@ jQuery('#postbox').on('click', _.debounce(sendMail, 200, { -### `chain.defer(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4581 "View in source") [Ⓣ][1] +### `_.defer(func [, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4652 "View in source") [Ⓣ][1] Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked. @@ -2080,8 +2139,8 @@ _.defer(function() { alert('deferred'); }); -### `chain.delay(func, wait [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4607 "View in source") [Ⓣ][1] +### `_.delay(func, wait [, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4678 "View in source") [Ⓣ][1] Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked. @@ -2107,8 +2166,8 @@ _.delay(log, 1000, 'logged later'); -### `chain.memoize(func [, resolver])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4631 "View in source") [Ⓣ][1] +### `_.memoize(func [, resolver])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4702 "View in source") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. @@ -2133,8 +2192,8 @@ var fibonacci = _.memoize(function(n) { -### `chain.once(func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4661 "View in source") [Ⓣ][1] +### `_.once(func)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4732 "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. @@ -2159,8 +2218,8 @@ initialize(); -### `chain.partial(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4696 "View in source") [Ⓣ][1] +### `_.partial(func [, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4767 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding. @@ -2186,8 +2245,8 @@ hi('moe'); -### `chain.partialRight(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4727 "View in source") [Ⓣ][1] +### `_.partialRight(func [, arg1, arg2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4798 "View in source") [Ⓣ][1] This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function. @@ -2223,8 +2282,8 @@ options.imports -### `chain.throttle(func, wait, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4760 "View in source") [Ⓣ][1] +### `_.throttle(func, wait, options)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4831 "View in source") [Ⓣ][1] Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Pass an `options` object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call. @@ -2255,8 +2314,8 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { -### `chain.wrap(value, wrapper)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4825 "View in source") [Ⓣ][1] +### `_.wrap(value, wrapper)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4896 "View in source") [Ⓣ][1] Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function. @@ -2291,8 +2350,8 @@ hello(); -### `chain.assign(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1134 "View in source") [Ⓣ][1] +### `_.assign(object [, source1, source2, ..., callback, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1155 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources will overwrite property assignments of previous sources. If a `callback` function is passed, it will be executed to produce the assigned values. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -2329,8 +2388,8 @@ defaults(food, { 'name': 'banana', 'type': 'fruit' }); -### `chain.clone(value [, deep=false, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1189 "View in source") [Ⓣ][1] +### `_.clone(value [, deep=false, callback, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1210 "View in source") [Ⓣ][1] Creates a clone of `value`. If `deep` is `true`, nested objects will also be cloned, otherwise they will be assigned by reference. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2376,8 +2435,8 @@ clone.childNodes.length; -### `chain.cloneDeep(value [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1314 "View in source") [Ⓣ][1] +### `_.cloneDeep(value [, callback, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1335 "View in source") [Ⓣ][1] Creates a deep clone of `value`. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2422,8 +2481,8 @@ clone.node == view.node; -### `chain.defaults(object [, source1, source2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1338 "View in source") [Ⓣ][1] +### `_.defaults(object [, source1, source2, ...])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1359 "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. @@ -2448,8 +2507,8 @@ _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); -### `chain.findKey(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1360 "View in source") [Ⓣ][1] +### `_.findKey(object [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1381 "View in source") [Ⓣ][1] This method is similar to `_.find`, except that it returns the key of the element that passes the callback check, instead of the element itself. @@ -2476,8 +2535,8 @@ _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { -### `chain.forIn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1401 "View in source") [Ⓣ][1] +### `_.forIn(object [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1422 "View in source") [Ⓣ][1] Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -2512,8 +2571,8 @@ _.forIn(new Dog('Dagny'), function(value, key) { -### `chain.forOwn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1426 "View in source") [Ⓣ][1] +### `_.forOwn(object [, callback=identity, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1447 "View in source") [Ⓣ][1] Iterates over an object's own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -2540,8 +2599,8 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { -### `chain.functions(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1443 "View in source") [Ⓣ][1] +### `_.functions(object)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1464 "View in source") [Ⓣ][1] Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values. @@ -2567,8 +2626,8 @@ _.functions(_); -### `chain.has(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1468 "View in source") [Ⓣ][1] +### `_.has(object, property)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1489 "View in source") [Ⓣ][1] Checks if the specified object `property` exists and is a direct property, instead of an inherited property. @@ -2592,8 +2651,8 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); -### `chain.invert(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1485 "View in source") [Ⓣ][1] +### `_.invert(object)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1506 "View in source") [Ⓣ][1] Creates an object composed of the inverted keys and values of the given `object`. @@ -2616,8 +2675,8 @@ _.invert({ 'first': 'moe', 'second': 'larry' }); -### `chain.isArguments(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L997 "View in source") [Ⓣ][1] +### `_.isArguments(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1018 "View in source") [Ⓣ][1] Checks if `value` is an `arguments` object. @@ -2643,8 +2702,8 @@ _.isArguments([1, 2, 3]); -### `chain.isArray(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1023 "View in source") [Ⓣ][1] +### `_.isArray(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1044 "View in source") [Ⓣ][1] Checks if `value` is an array. @@ -2670,8 +2729,8 @@ _.isArray([1, 2, 3]); -### `chain.isBoolean(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1511 "View in source") [Ⓣ][1] +### `_.isBoolean(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1532 "View in source") [Ⓣ][1] Checks if `value` is a boolean value. @@ -2694,8 +2753,8 @@ _.isBoolean(null); -### `chain.isDate(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1528 "View in source") [Ⓣ][1] +### `_.isDate(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1549 "View in source") [Ⓣ][1] Checks if `value` is a date. @@ -2718,8 +2777,8 @@ _.isDate(new Date); -### `chain.isElement(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1545 "View in source") [Ⓣ][1] +### `_.isElement(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1566 "View in source") [Ⓣ][1] Checks if `value` is a DOM element. @@ -2742,8 +2801,8 @@ _.isElement(document.body); -### `chain.isEmpty(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1570 "View in source") [Ⓣ][1] +### `_.isEmpty(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1591 "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". @@ -2772,8 +2831,8 @@ _.isEmpty(''); -### `chain.isEqual(a, b [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1629 "View in source") [Ⓣ][1] +### `_.isEqual(a, b [, callback, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1650 "View in source") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent to each other. If `callback` is passed, it will be executed to compare values. If `callback` returns `undefined`, comparisons will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(a, b)*. @@ -2817,8 +2876,8 @@ _.isEqual(words, otherWords, function(a, b) { -### `chain.isFinite(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1810 "View in source") [Ⓣ][1] +### `_.isFinite(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1831 "View in source") [Ⓣ][1] Checks if `value` is, or can be coerced to, a finite number. @@ -2855,8 +2914,8 @@ _.isFinite(Infinity); -### `chain.isFunction(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1827 "View in source") [Ⓣ][1] +### `_.isFunction(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1848 "View in source") [Ⓣ][1] Checks if `value` is a function. @@ -2879,8 +2938,8 @@ _.isFunction(_); -### `chain.isNaN(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1890 "View in source") [Ⓣ][1] +### `_.isNaN(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1911 "View in source") [Ⓣ][1] Checks if `value` is `NaN`. @@ -2914,8 +2973,8 @@ _.isNaN(undefined); -### `chain.isNull(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1912 "View in source") [Ⓣ][1] +### `_.isNull(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1933 "View in source") [Ⓣ][1] Checks if `value` is `null`. @@ -2941,8 +3000,8 @@ _.isNull(undefined); -### `chain.isNumber(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1929 "View in source") [Ⓣ][1] +### `_.isNumber(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1950 "View in source") [Ⓣ][1] Checks if `value` is a number. @@ -2965,8 +3024,8 @@ _.isNumber(8.4 * 5); -### `chain.isObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1857 "View in source") [Ⓣ][1] +### `_.isObject(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1878 "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('')`)* @@ -2995,8 +3054,8 @@ _.isObject(1); -### `chain.isPlainObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1957 "View in source") [Ⓣ][1] +### `_.isPlainObject(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1978 "View in source") [Ⓣ][1] Checks if a given `value` is an object created by the `Object` constructor. @@ -3030,8 +3089,8 @@ _.isPlainObject({ 'name': 'moe', 'age': 40 }); -### `chain.isRegExp(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1982 "View in source") [Ⓣ][1] +### `_.isRegExp(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2003 "View in source") [Ⓣ][1] Checks if `value` is a regular expression. @@ -3054,8 +3113,8 @@ _.isRegExp(/moe/); -### `chain.isString(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1999 "View in source") [Ⓣ][1] +### `_.isString(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2020 "View in source") [Ⓣ][1] Checks if `value` is a string. @@ -3078,8 +3137,8 @@ _.isString('moe'); -### `chain.isUndefined(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2016 "View in source") [Ⓣ][1] +### `_.isUndefined(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2037 "View in source") [Ⓣ][1] Checks if `value` is `undefined`. @@ -3102,8 +3161,8 @@ _.isUndefined(void 0); -### `chain.keys(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1056 "View in source") [Ⓣ][1] +### `_.keys(object)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1077 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property names of `object`. @@ -3126,8 +3185,8 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 }); -### `chain.merge(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2075 "View in source") [Ⓣ][1] +### `_.merge(object [, source1, source2, ..., callback, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2096 "View in source") [Ⓣ][1] Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined`, into the destination object. Subsequent sources will overwrite property assignments of previous sources. If a `callback` function is passed, it will be executed to produce the merged values of the destination and source properties. If `callback` returns `undefined`, merging will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -3182,8 +3241,8 @@ _.merge(food, otherFood, function(a, b) { -### `chain.omit(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2184 "View in source") [Ⓣ][1] +### `_.omit(object, callback|[prop1, prop2, ..., thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2205 "View in source") [Ⓣ][1] Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a `callback` function is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3213,8 +3272,8 @@ _.omit({ 'name': 'moe', 'age': 40 }, function(value) { -### `chain.pairs(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2218 "View in source") [Ⓣ][1] +### `_.pairs(object)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2239 "View in source") [Ⓣ][1] Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. @@ -3237,8 +3296,8 @@ _.pairs({ 'moe': 30, 'larry': 40 }); -### `chain.pick(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2256 "View in source") [Ⓣ][1] +### `_.pick(object, callback|[prop1, prop2, ..., thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2277 "View in source") [Ⓣ][1] Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3268,8 +3327,45 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { -### `chain.values(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2293 "View in source") [Ⓣ][1] +### `_.transform(collection [, callback=identity, accumulator, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2331 "View in source") [Ⓣ][1] + +Transforms an `object` to an new `accumulator` object which is the result of running each of its elements through the `callback`, with each `callback` execution potentially mutating the `accumulator` object. The `callback`is bound to `thisArg` and invoked with four arguments; *(accumulator, value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. + +#### Arguments +1. `collection` *(Array|Object)*: The collection to iterate over. +2. `[callback=identity]` *(Function)*: The function called per iteration. +3. `[accumulator]` *(Mixed)*: The custom accumulator value. +4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. + +#### Returns +*(Mixed)*: Returns the accumulated value. + +#### Example +```js +var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) { + num *= num; + if (num % 2) { + return result.push(num) < 3; + } +}); +// => [1, 9, 25] + +var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + result[key] = num * 3; +}); +// => { 'a': 3, 'b': 6, 'c': 9 } +``` + +* * * + + + + + + +### `_.values(object)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2364 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property values of `object`. @@ -3299,8 +3395,8 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); -### `chain.escape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4849 "View in source") [Ⓣ][1] +### `_.escape(string)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4920 "View in source") [Ⓣ][1] Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. @@ -3323,8 +3419,8 @@ _.escape('Moe, Larry & Curly'); -### `chain.identity(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4867 "View in source") [Ⓣ][1] +### `_.identity(value)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4938 "View in source") [Ⓣ][1] This function returns the first argument passed to it. @@ -3348,8 +3444,8 @@ moe === _.identity(moe); -### `chain.mixin(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4893 "View in source") [Ⓣ][1] +### `_.mixin(object)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4964 "View in source") [Ⓣ][1] Adds functions properties of `object` to the `lodash` function and chainable wrapper. @@ -3378,8 +3474,8 @@ _('moe').capitalize(); -### `chain.noConflict()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4922 "View in source") [Ⓣ][1] +### `_.noConflict()` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4993 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -3398,8 +3494,8 @@ var lodash = _.noConflict(); -### `chain.parseInt(value [, radix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4946 "View in source") [Ⓣ][1] +### `_.parseInt(value [, radix])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5017 "View in source") [Ⓣ][1] Converts the given `value` into an integer of the specified `radix`. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used. @@ -3425,8 +3521,8 @@ _.parseInt('08'); -### `chain.random([min=0, max=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4969 "View in source") [Ⓣ][1] +### `_.random([min=0, max=1])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5040 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned. @@ -3453,8 +3549,8 @@ _.random(5); -### `chain.result(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5013 "View in source") [Ⓣ][1] +### `_.result(object, property)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5084 "View in source") [Ⓣ][1] Resolves the value of `property` on `object`. If `property` is a function, it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is falsey, then `undefined` is returned. @@ -3488,8 +3584,26 @@ _.result(object, 'stuff'); -### `chain.template(text, data, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5097 "View in source") [Ⓣ][1] +### `_.runInContext([context=window])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L150 "View in source") [Ⓣ][1] + +Create a new `lodash` function using the given `context` object. + +#### Arguments +1. `[context=window]` *(Object)*: The context object. + +#### Returns +*(Function)*: Returns the `lodash` function. + +* * * + + + + + + +### `_.template(text, data, options)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5168 "View in source") [Ⓣ][1] A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. @@ -3570,8 +3684,8 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ -### `chain.times(n, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5222 "View in source") [Ⓣ][1] +### `_.times(n, callback [, thisArg])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5293 "View in source") [Ⓣ][1] Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*. @@ -3602,8 +3716,8 @@ _.times(3, function(n) { this.cast(n); }, mage); -### `chain.unescape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5249 "View in source") [Ⓣ][1] +### `_.unescape(string)` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5320 "View in source") [Ⓣ][1] The inverse of `_.escape`, this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. @@ -3626,8 +3740,8 @@ _.unescape('Moe, Larry & Curly'); -### `chain.uniqueId([prefix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5269 "View in source") [Ⓣ][1] +### `_.uniqueId([prefix])` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5340 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is passed, the ID will be appended to it. @@ -3661,7 +3775,7 @@ _.uniqueId(); ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L504 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L505 "View in source") [Ⓣ][1] A reference to the `lodash` function. @@ -3679,8 +3793,8 @@ A reference to the `lodash` function. -### `chain.VERSION` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5507 "View in source") [Ⓣ][1] +### `_.VERSION` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5582 "View in source") [Ⓣ][1] *(String)*: The semantic version number. @@ -3689,18 +3803,6 @@ A reference to the `lodash` function. - - -### `enumErrorProps` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L356 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. *(IE < `9`, Safari < `5.1`)* - -* * * - - - - ### `_.support` @@ -3737,10 +3839,22 @@ A reference to the `lodash` function. + + +### `_.support.enumErrorProps` +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L357 "View in source") [Ⓣ][1] + +*(Boolean)*: Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. *(IE < `9`, Safari < `5.1`)* + +* * * + + + + ### `_.support.enumPrototypes` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L369 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L370 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `prototype` properties are enumerable by default. @@ -3754,7 +3868,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.fastBind` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L377 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L378 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `Function#bind` exists and is inferred to be fast *(all but V8)*. @@ -3766,7 +3880,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.nonEnumArgs` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L394 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L395 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `arguments` object indexes are non-enumerable *(Firefox < `4`, IE < `9`, PhantomJS, Safari < `5.1`)*. @@ -3778,7 +3892,7 @@ Firefox < `3.6`, Opera > `9.50` - Opera < `11.60`, and Safari < `5.1` *(if the p ### `_.support.nonEnumShadows` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L405 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L406 "View in source") [Ⓣ][1] *(Boolean)*: Detect if properties shadowing those on `Object.prototype` are non-enumerable. @@ -3792,7 +3906,7 @@ In IE < `9` an objects own properties, shadowing non-enumerable ones, are made n ### `_.support.ownLast` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L385 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L386 "View in source") [Ⓣ][1] *(Boolean)*: Detect if own properties are iterated after inherited properties *(all but IE < `9`)*. @@ -3804,7 +3918,7 @@ In IE < `9` an objects own properties, shadowing non-enumerable ones, are made n ### `_.support.spliceObjects` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L419 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L420 "View in source") [Ⓣ][1] *(Boolean)*: Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. @@ -3818,7 +3932,7 @@ Firefox < `10`, IE compatibility mode, and IE < `9` have buggy Array `shift()` a ### `_.support.unindexedChars` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L430 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L431 "View in source") [Ⓣ][1] *(Boolean)*: Detect lack of support for accessing string characters by index. @@ -3832,7 +3946,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L456 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L457 "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. @@ -3844,7 +3958,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L464 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L465 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect `data` property values to be HTML-escaped. @@ -3856,7 +3970,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L472 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L473 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect code to be evaluated. @@ -3868,7 +3982,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L480 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L481 "View in source") [Ⓣ][1] *(RegExp)*: Used to detect `data` property values to inject. @@ -3880,7 +3994,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L488 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L489 "View in source") [Ⓣ][1] *(String)*: Used to reference the data object in the template text. @@ -3892,7 +4006,7 @@ IE < `8` can't access characters by index and IE `8` can only access characters ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L496 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L497 "View in source") [Ⓣ][1] *(Object)*: Used to import variables into the compiled template. diff --git a/vendor/benchmark.js/README.md b/vendor/benchmark.js/README.md index d2a03e3fe..cb10e88ea 100644 --- a/vendor/benchmark.js/README.md +++ b/vendor/benchmark.js/README.md @@ -15,7 +15,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best ## Support -Benchmark.js has been tested in at least Chrome 5~26, Firefox 2~20, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. +Benchmark.js has been tested in at least Chrome 5~26, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. ## Installation and usage diff --git a/vendor/benchmark.js/benchmark.js b/vendor/benchmark.js/benchmark.js index 4a48ab9b5..cb22503df 100644 --- a/vendor/benchmark.js/benchmark.js +++ b/vendor/benchmark.js/benchmark.js @@ -1675,7 +1675,7 @@ // start timer 't#.start(d#);' + // execute `deferred.fn` and return a dummy object - '}d#.fn();return{}' + '}d#.fn();return{uid:"${uid}"}' : 'var r#,s#,m#=this,f#=m#.fn,i#=m#.count,n#=t#.ns;${setup}\n${begin};' + 'while(i#--){${fn}\n}${end};${teardown}\nreturn{elapsed:r#,uid:"${uid}"}' diff --git a/vendor/docdown/src/DocDown/Generator.php b/vendor/docdown/src/DocDown/Generator.php index 691d92e92..285a92528 100644 --- a/vendor/docdown/src/DocDown/Generator.php +++ b/vendor/docdown/src/DocDown/Generator.php @@ -321,9 +321,7 @@ class Generator { $api[$member] = $entry; foreach ($entry->getAliases() as $alias) { - $api[$member] = $alias; - $alias->static = array(); - $alias->plugin = array(); + $api[$member]->static[] = $alias; } } else if ($entry->isStatic()) { diff --git a/vendor/platform.js/README.md b/vendor/platform.js/README.md index a1f06caff..53ef14fc3 100644 --- a/vendor/platform.js/README.md +++ b/vendor/platform.js/README.md @@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best ## Support -Platform.js has been tested in at least Chrome 5~26, Firefox 2~20, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. +Platform.js has been tested in at least Chrome 5~26, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. ## Installation and usage diff --git a/vendor/requirejs/require.js b/vendor/requirejs/require.js index 062516acd..2109a2514 100644 --- a/vendor/requirejs/require.js +++ b/vendor/requirejs/require.js @@ -1,5 +1,5 @@ /** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * @license RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ @@ -12,7 +12,7 @@ var requirejs, require, define; (function (global) { var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, - version = '2.1.5', + version = '2.1.6', commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, jsSuffixRegExp = /\.js$/, @@ -22,7 +22,7 @@ var requirejs, require, define; hasOwn = op.hasOwnProperty, ap = Array.prototype, apsp = ap.splice, - isBrowser = !!(typeof window !== 'undefined' && navigator && document), + isBrowser = !!(typeof window !== 'undefined' && navigator && window.document), isWebWorker = !isBrowser && typeof importScripts !== 'undefined', //PS3 indicates loaded and complete, but need to wait for complete //specifically. Sequence is 'loading', 'loaded', execution, @@ -134,6 +134,10 @@ var requirejs, require, define; return document.getElementsByTagName('script'); } + function defaultOnError(err) { + throw err; + } + //Allow getting a global that expressed in //dot notation, like 'a.b.c'. function getGlobal(value) { @@ -500,7 +504,12 @@ var requirejs, require, define; fn(defined[id]); } } else { - getModule(depMap).on(name, fn); + mod = getModule(depMap); + if (mod.error && name === 'error') { + fn(mod.error); + } else { + mod.on(name, fn); + } } } @@ -571,7 +580,13 @@ var requirejs, require, define; id: mod.map.id, uri: mod.map.url, config: function () { - return (config.config && getOwn(config.config, mod.map.id)) || {}; + var c, + pkg = getOwn(config.pkgs, mod.map.id); + // For packages, only support config targeted + // at the main module. + c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) : + getOwn(config.config, mod.map.id); + return c || {}; }, exports: defined[mod.map.id] }); @@ -840,8 +855,13 @@ var requirejs, require, define; if (this.depCount < 1 && !this.defined) { if (isFunction(factory)) { //If there is an error listener, favor passing - //to that instead of throwing an error. - if (this.events.error) { + //to that instead of throwing an error. However, + //only do it for define()'d modules. require + //errbacks should not be called for failures in + //their callbacks (#699). However if a global + //onError is set, use that. + if ((this.events.error && this.map.isDefine) || + req.onError !== defaultOnError) { try { exports = context.execCb(id, factory, depExports, exports); } catch (e) { @@ -869,8 +889,8 @@ var requirejs, require, define; if (err) { err.requireMap = this.map; - err.requireModules = [this.map.id]; - err.requireType = 'define'; + err.requireModules = this.map.isDefine ? [this.map.id] : null; + err.requireType = this.map.isDefine ? 'define' : 'require'; return onError((this.error = err)); } @@ -1093,7 +1113,7 @@ var requirejs, require, define; })); if (this.errback) { - on(depMap, 'error', this.errback); + on(depMap, 'error', bind(this, this.errback)); } } @@ -1605,7 +1625,7 @@ var requirejs, require, define; }, /** - * Executes a module callack function. Broken out as a separate function + * Executes a module callback function. Broken out as a separate function * solely to allow the build system to sequence the files in the built * layer in the right sequence. * @@ -1643,7 +1663,7 @@ var requirejs, require, define; onScriptError: function (evt) { var data = getScriptData(evt); if (!hasPathFallback(data.id)) { - return onError(makeError('scripterror', 'Script error', evt, [data.id])); + return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id])); } } }; @@ -1772,9 +1792,7 @@ var requirejs, require, define; * function. Intercept/override it if you want custom error handling. * @param {Error} err the error object. */ - req.onError = function (err) { - throw err; - }; + req.onError = defaultOnError; /** * Does the request to load a module for the browser case. @@ -1906,24 +1924,31 @@ var requirejs, require, define; //baseUrl, if it is not already set. dataMain = script.getAttribute('data-main'); if (dataMain) { + //Preserve dataMain in case it is a path (i.e. contains '?') + mainScript = dataMain; + //Set final baseUrl if there is not already an explicit one. if (!cfg.baseUrl) { //Pull off the directory of data-main for use as the //baseUrl. - src = dataMain.split('/'); + src = mainScript.split('/'); mainScript = src.pop(); subPath = src.length ? src.join('/') + '/' : './'; cfg.baseUrl = subPath; - dataMain = mainScript; } - //Strip off any trailing .js since dataMain is now + //Strip off any trailing .js since mainScript is now //like a module name. - dataMain = dataMain.replace(jsSuffixRegExp, ''); + mainScript = mainScript.replace(jsSuffixRegExp, ''); + + //If mainScript is still a path, fall back to dataMain + if (req.jsExtRegExp.test(mainScript)) { + mainScript = dataMain; + } //Put the data-main script in the files to load. - cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; return true; } @@ -1951,12 +1976,13 @@ var requirejs, require, define; //This module may not have dependencies if (!isArray(deps)) { callback = deps; - deps = []; + deps = null; } //If no name, and callback is a function, then figure out if it a //CommonJS thing with dependencies. - if (!deps.length && isFunction(callback)) { + if (!deps && isFunction(callback)) { + deps = []; //Remove comments from the callback string, //look for require calls, and pull them into the dependencies, //but only if there are function args. diff --git a/vendor/underscore/underscore-min.js b/vendor/underscore/underscore-min.js index 603aeb330..9e669d307 100644 --- a/vendor/underscore/underscore-min.js +++ b/vendor/underscore/underscore-min.js @@ -3,4 +3,4 @@ // (c) 2009-2011 Jeremy Ashkenas, DocumentCloud Inc. // (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,m=e.every,g=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},w.find=w.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:m&&n.every===m?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:g&&n.some===g?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?void 0:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.unzip=function(n){var t=w.max(w.pluck(n,"length"));return w.times(t,w.partial(w.pluck,n))},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i};var M=function(){};w.bind=function(n,t){var r,e;if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));if(!w.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));M.prototype=n.prototype;var u=new M;M.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw Error("bindAll must be passed function names");return A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t,r){var e,u,i,a,o=0,c=function(){o=new Date,i=null,a=n.apply(e,u)};return function(){var l=new Date;o||r!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(i),i=null,o=l,a=n.apply(e,u)):i||(i=setTimeout(c,f)),a}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&t.push(r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var S={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};S.unescape=w.invert(S.escape);var T={escape:RegExp("["+w.keys(S.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(S.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return S[n][t]})}}),w.result=function(n,t){if(null==n)return void 0;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(z,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file +(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,m=e.every,g=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},w.find=w.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:m&&n.every===m?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:g&&n.some===g?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?void 0:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var F=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=F(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)||w.isArguments(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(w.flatten(arguments,!0))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){return w.unzip(o.call(arguments))},w.unzip=function(n){for(var t=w.max(w.pluck(n,"length").concat(0)),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i};var M=function(){};w.bind=function(n,t){var r,e;if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));if(!w.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));M.prototype=n.prototype;var u=new M;M.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw Error("bindAll must be passed function names");return A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t,r){var e,u,i,a,o=0,c=function(){o=new Date,i=null,a=n.apply(e,u)};return function(){var l=new Date;o||r!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(i),i=null,o=l,a=n.apply(e,u)):i||(i=setTimeout(c,f)),a}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&t.push(r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var S={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};S.unescape=w.invert(S.escape);var T={escape:RegExp("["+w.keys(S.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(S.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return S[n][t]})}}),w.result=function(n,t){if(null==n)return void 0;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(z,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/vendor/underscore/underscore.js b/vendor/underscore/underscore.js index 7b116b104..b01e3c91a 100644 --- a/vendor/underscore/underscore.js +++ b/vendor/underscore/underscore.js @@ -365,7 +365,7 @@ return low; }; - // Safely convert anything iterable into a real, live array. + // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); @@ -425,7 +425,7 @@ // Internal implementation of a recursive `flatten` function. var flatten = function(input, shallow, output) { each(input, function(value) { - if (_.isArray(value)) { + if (_.isArray(value) || _.isArguments(value)) { shallow ? push.apply(output, value) : flatten(value, shallow, output); } else { output.push(value); @@ -468,7 +468,7 @@ // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); + return _.uniq(_.flatten(arguments, true)); }; // Produce an array that contains every item shared between all the @@ -492,13 +492,7 @@ // Zip together multiple lists into a single array -- elements that share // an index go together. _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; + return _.unzip(slice.call(arguments)); }; // The inverse operation to `_.zip`. If given an array of pairs it @@ -507,9 +501,13 @@ // three element array and so on. For example, `_.unzip` given // `[['a',1],['b',2],['c',3]]` returns the array // [['a','b','c'],[1,2,3]]. - _.unzip = function(tuples) { - var maxLen = _.max(_.pluck(tuples, "length")) - return _.times(maxLen, _.partial(_.pluck, tuples)); + _.unzip = function(list) { + var length = _.max(_.pluck(list, "length").concat(0)); + var results = new Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(list, '' + i); + } + return results; }; // Converts lists into objects. Pass either a single array of `[key, value]`