mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Save 2 gzipped bytes by flipping args in math.max
Also, remove some stray whitespace. Former-commit-id: 98b4711bc7d978ef66a693593d6be108f6bcfd8d
This commit is contained in:
@@ -986,7 +986,7 @@
|
||||
} else if (thisArg) {
|
||||
callback = iteratorBind(callback, thisArg);
|
||||
}
|
||||
|
||||
|
||||
var result = map(collection, function(value, index) {
|
||||
return {
|
||||
'criteria': callback(value, index, collection),
|
||||
@@ -1479,7 +1479,7 @@
|
||||
// use `Array(length)` so V8 will avoid the slower "dictionary" mode
|
||||
// http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s
|
||||
var index = -1,
|
||||
length = Math.max(Math.ceil((end - start) / step), 0),
|
||||
length = Math.max(0, Math.ceil((end - start) / step)),
|
||||
result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
|
||||
58
lodash.min.js
vendored
58
lodash.min.js
vendored
@@ -2,31 +2,33 @@
|
||||
Lo-Dash 0.3.2 lodash.com/license
|
||||
Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
|
||||
*/
|
||||
;(function(e,t){"use strict";function s(e){return"[object Arguments]"==nt.call(e)}function o(e){return new u(e)}function u(e){if(e&&e._wrapped)return e;this._wrapped=e}function a(){for(var e,t,s,o=-1,u=arguments.length,a={e:"",f:"",k:"",q:"",c:{d:"",m:"++l<o"},o:{d:""}};++o<u;)for(t in e=arguments[o],e)s=(s=e[t])==r?"":s,/d|m|j/.test(t)?("string"==typeof s&&(s={b:s,n:s}),a.c[t]=s.b,a.o[t]=s.n):a[t]=s;e=a.a,t=a.c,s=a.o;var o=/^[^,]+/.exec(e)[0],u=s.m,f=/\S+$/.exec(u||o)[0];a.g=o,a.i=O,a.h="j.call("+
|
||||
f+",l)",a.l=f,a.p=j,a.r=a.r!==i,a.f||(a.f="if(!"+o+")return u");if("r"==o||!t.j)a.c=r;return u||(s.m="l in "+f),Function("c,i,j,k,n,s,w,z,C,D,h,E",'"use strict";return function('+e+"){"+ft(a)+"}")(z,V,Z,k,h,R,tt,K,nt,n,i)}function f(e,t){return I[t]}function l(e){return"\\"+U[e]}function c(e){return q[e]}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(){}function d(e,t){var n=I.length;return I[n]="'+_.escape("+t+")+'",F+n}function v(e,t){var n=I.length;return I[n]="'+((__t=("+
|
||||
t+"))==null?'':__t)+'",F+n}function m(e,t){var n=I.length;return I[n]="';"+t+";__p+='",F+n}function g(e,t,n,r){if(!e)return n;var i=e.length,s=3>arguments.length;r&&(t=h(t,r));if(i===i>>>0){for(i&&s&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}var o=At(e);for((i=o.length)&&s&&(n=e[o[--i]]);i--;)s=o[i],n=t(n,e[s],s,e);return n}function y(e,n,r){if(e)return n==t||r?e[0]:tt.call(e,0,n)}function b(e,t){var n=[];if(!e)return n;for(var r,i=-1,s=e.length;++i<s;)r=e[i],Lt(r)?et.apply(n,t?r:b(r)):n.push(r);return n
|
||||
}function w(e,t,n){if(!e)return-1;var r=-1,i=e.length;if(n){if("number"!=typeof n)return r=x(e,t),e[r]===t?r:-1;r=(0>n?Math.max(0,i+n):n)-1}for(;++r<i;)if(e[r]===t)return r;return-1}function E(e,t,n){var r=-Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]>i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n>r&&(r=n,i=e[s]);return i}function S(e,n,r){return e?tt.call(e,n==t||r?1:n):[]}function x(e,t,n,r){if(!e)return 0;var i=0,s=e.length;if(n){r&&(n=N(n,r));for(t=n(
|
||||
t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+s>>>1,e[r]<t?i=r+1:s=r;return i}function T(e,t,n,r){var s=[];if(!e)return s;var o=-1,u=e.length,a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n?r&&(n=h(n,r)):n=k;++o<u;)if(r=n(e[o],o,e),t?!o||a[a.length-1]!==r:0>w(a,r))a.push(r),s.push(e[o]);return s}function N(e,t){function n(){var u=arguments,a=t;return s||(e=t[i]),o.length&&(u=u.length?Y.apply(o,u):o),this instanceof n?(p.prototype=e.prototype,a=new p,u=e.apply(a,u),R[typeof u]&&u!==r?u:a
|
||||
):e.apply(a,u)}var i,s=nt.call(e)==V;if(s){if(rt)return rt.call.apply(rt,arguments)}else i=t,t=e;var o=tt.call(arguments,2);return n}function C(e,r,s){s||(s=[]);if(e===r)return 0!==e||1/e==1/r;if(e==t||r==t)return e===r;e._chain&&(e=e._wrapped),r._chain&&(r=r._wrapped);if(e.isEqual&&nt.call(e.isEqual)==V)return e.isEqual(r);if(r.isEqual&&nt.call(r.isEqual)==V)return r.isEqual(e);var o=nt.call(e);if(o!=nt.call(r))return i;switch(o){case K:return e==""+r;case $:return e!=+e?r!=+r:0==e?1/e==1/r:e==+
|
||||
r;case W:case X:return+e==+r;case J:return e.source==r.source&&e.global==r.global&&e.multiline==r.multiline&&e.ignoreCase==r.ignoreCase}if("object"!=typeof e||"object"!=typeof r)return i;for(var u=s.length;u--;)if(s[u]==e)return n;var u=-1,a=n,f=0;s.push(e);if(o==z){if(f=e.length,a=f==r.length)for(;f--&&(a=C(e[f],r[f],s)););}else{if("constructor"in e!="constructor"in r||e.constructor!=r.constructor)return i;for(var l in e)if(Z.call(e,l)&&(f++,!(a=Z.call(r,l)&&C(e[l],r[l],s))))break;if(a){for(l in
|
||||
r)if(Z.call(r,l)&&!(f--))break;a=!f}if(a&&O)for(;7>++u&&(l=j[u],!Z.call(e,l)||!!(a=Z.call(r,l)&&C(e[l],r[l],s))););}return s.pop(),a}function k(e){return e}function L(e){wt(kt(e),function(t){var r=o[t]=e[t];u.prototype[t]=function(){var e=[this._wrapped];return arguments.length&&et.apply(e,arguments),e=r.apply(o,e),this._chain&&(e=new u(e),e._chain=n),e}})}var n=!0,r=null,i=!1,A="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),O=!{valueOf
|
||||
:0}.propertyIsEnumerable("valueOf"),M=0,_=e._,D=RegExp("^"+({}.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),P=/__token__(\d+)/g,H=/[&<"']/g,B=/['\n\r\t\u2028\u2029\\]/g,j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),F="__token__",I=[],q={"&":"&","<":"<",'"':""","'":"'"},R={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},U={"\\":"\\","'":"'","\n":"n"
|
||||
,"\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},z="[object Array]",W="[object Boolean]",X="[object Date]",V="[object Function]",$="[object Number]",J="[object RegExp]",K="[object String]",Q=Array.prototype,G=Object.prototype,Y=Q.concat,Z=G.hasOwnProperty,et=Q.push,tt=Q.slice,nt=G.toString,rt=D.test(rt=tt.bind)&&/\n|Opera/.test(rt+nt.call(e.opera))&&rt,it=D.test(it=Array.isArray)&&it,st=e.isFinite,ot=D.test(ot=Object.keys)&&ot,ut=e.clearTimeout,at=e.setTimeout;o.templateSettings={escape:/<%-([\s\S]+?)%>/g
|
||||
,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"obj"};var ft=Function("obj","var __p;with(obj){__p='var l,u';if(k){__p+='='+k};__p+=';'+f+';'+q+';';if(c){__p+='var o='+g+'.length;l=-1;';if(o){__p+='if(o===o>>>0){'};__p+=''+c['d']+';while('+c['m']+'){'+c['j']+'}';if(o){__p+='}'}}if(o){if(c){__p+='else{'}if(!i){__p+='var v=typeof '+l+'==\\'function\\';'};__p+=''+o['d']+';for('+o['m']+'){';if(i){if(r){__p+='if('+h+'){'};__p+=''+o['j']+';';if(r){__p+='}'}}else{__p+='if(!(v&&l==\\'prototype\\')';if(r){__p+='&&'+h};__p+='){'+o['j']+'}'};__p+='}';if(i){__p+='var g='+l+'.constructor;';for(var k=0;k<7;k++){__p+='l=\\''+p[k]+'\\';if(';if(p[k]=='constructor'){__p+='!(g&&g.prototype==='+l+')&&'};__p+=''+h+'){'+o['j']+'}'}}if(c){__p+='}'}};__p+=''+e+';return u'}return __p"
|
||||
),lt={a:"f,d,B",k:"f",q:"if(!d){d=k}else if(B){d=n(d,B)}",j:"d(f[l],l,f)"},ct={k:"D",j:"if(!d(f[l],l,f))return!u"},ht={a:"r",k:"r",q:"for(var x,y=1,o=arguments.length;y<o;y++){x=arguments[y];"+(O?"if(x){":""),m:"l in x",r:i,j:"r[l]=x[l]",e:(O?"}":"")+"}"},pt={k:"[]",j:"d(f[l],l,f)&&u.push(f[l])"},dt={q:"if(B)d=n(d,B)"},vt={j:{n:lt.j}},mt={k:"",f:"if(!f)return[]",d:{b:"u=Array(o)",n:"u=[]"},j:{b:"u[l]=d(f[l],l,f)",n:"u.push(d(f[l],l,f))"}},gt=a({a:"r",f:"if(!s[typeof r]||r===null)throw TypeError()"
|
||||
,k:"[]",j:"u.push(l)"}),D=a({a:"f,A",k:"h",j:"if(f[l]===A)return D"}),yt=a(lt,ct),G=a(lt,pt),bt=a(lt,dt,{k:"",j:"if(d(f[l],l,f))return f[l]"}),wt=a(lt,dt),Et=a(lt,{k:"{}",q:"var prop,m=typeof d=='function';if(m&&B)d=n(d,B)",j:"prop=m?d(f[l],l,f):f[l][d];(j.call(u,prop)?u[prop]:u[prop]=[]).push(f[l])"}),St=a(mt,{a:"f,p",q:"var b=w.call(arguments,2),m=typeof p=='function'",j:{b:"u[l]=(m?p:f[l][p]).apply(f[l],b)",n:"u.push((m?p:f[l][p]).apply(f[l],b))"}}),xt=a(lt,mt),Tt=a(mt,{a:"f,t",j:{b:"u[l]=f[l][t]"
|
||||
,n:"u.push(f[l][t])"}}),mt=a({a:"f,d,a,B",k:"a",q:"var q=arguments.length<3;if(B)d=n(d,B)",d:{b:"if(q)u=f[++l]"},j:{b:"u=d(u,f[l],l,f)",n:"u=q?(q=h,f[l]):d(u,f[l],l,f)"}}),pt=a(lt,pt,{j:"!"+pt.j}),ct=a(lt,ct,{k:"h",j:ct.j.replace("!","")}),Nt=a(ht,{j:"if(r[l]==E)"+ht.j}),Ct=a(ht),ht=a(lt,dt,vt,{r:i}),lt=a(lt,dt,vt),kt=a({a:"r",k:"[]",r:i,j:"if(C.call(r[l])==i)u.push(l)",e:"u.sort()"});s(arguments)||(s=function(e){return!!e&&!!Z.call(e,"callee")});var Lt=it||function(e){return nt.call(e)==z},it=a(
|
||||
{a:"F",k:"D",q:"var e=C.call(F);if(e==c||e==z)return!F.length",j:{n:"return h"}}),At=ot?function(e){return"function"==typeof e?gt(e):ot(e)}:gt,Ot=a({a:"r",k:"[]",j:"u.push(r[l])"});o.VERSION="0.3.2",o.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},o.bind=N,o.bindAll=function(e){var t=arguments,n=1;1==t.length&&(n=0,t=kt(e));for(var r=t.length;n<r;n++)e[t[n]]=N(e[t[n]],e);return e},o.chain=function(e){return e=new u(e),e._chain=n,e},o.clone=function(e){return R
|
||||
[typeof e]&&e!==r?Lt(e)?e.slice():Ct({},e):e},o.compact=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length;++n<r;)e[n]&&t.push(e[n]);return t},o.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},o.contains=D,o.debounce=function(e,n,r){function i(){a=t,r||e.apply(u,s)}var s,o,u,a;return function(){var t=r&&!a;return s=arguments,u=this,ut(a),a=at(i,n),t&&(o=e.apply(u,s)),o}},o.defaults=Nt,o.defer=function(e){var n=
|
||||
tt.call(arguments,1);return at(function(){return e.apply(t,n)},1)},o.delay=function(e,n){var r=tt.call(arguments,2);return at(function(){return e.apply(t,r)},n)},o.difference=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=Y.apply(t,arguments);++n<r;)0>w(i,e[n],r)&&t.push(e[n]);return t},o.escape=function(e){return e==r?"":(e+"").replace(H,c)},o.every=yt,o.extend=Ct,o.filter=G,o.find=bt,o.first=y,o.flatten=b,o.forEach=wt,o.forIn=ht,o.forOwn=lt,o.functions=kt,o.groupBy=Et,o.has=function(
|
||||
e,t){return Z.call(e,t)},o.identity=k,o.indexOf=w,o.initial=function(e,n,r){return e?tt.call(e,0,-(n==t||r?1:n)):[]},o.intersection=function(e){var t=[];if(!e)return t;for(var n,r=-1,i=e.length,s=tt.call(arguments,1);++r<i;)n=e[r],0>w(t,n)&&yt(s,function(e){return-1<w(e,n)})&&t.push(n);return t},o.invoke=St,o.isArguments=s,o.isArray=Lt,o.isBoolean=function(e){return e===n||e===i||nt.call(e)==W},o.isDate=function(e){return nt.call(e)==X},o.isElement=function(e){return!!e&&1==e.nodeType},o.isEmpty=
|
||||
it,o.isEqual=C,o.isFinite=function(e){return st(e)&&nt.call(e)==$},o.isFunction=function(e){return nt.call(e)==V},o.isNaN=function(e){return nt.call(e)==$&&e!=+e},o.isNull=function(e){return e===r},o.isNumber=function(e){return nt.call(e)==$},o.isObject=function(e){return R[typeof e]&&e!==r},o.isRegExp=function(e){return nt.call(e)==J},o.isString=function(e){return nt.call(e)==K},o.isUndefined=function(e){return e===t},o.keys=At,o.last=function(e,n,r){if(e){var i=e.length;return n==t||r?e[i-1]:tt
|
||||
.call(e,-n||i)}},o.lastIndexOf=function(e,t,n){if(!e)return-1;var r=e.length;for(n&&"number"==typeof n&&(r=(0>n?Math.max(0,r+n):Math.min(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},o.map=xt,o.max=E,o.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Z.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},o.min=function(e,t,n){var r=Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]<i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t
|
||||
(e[s],s,e),n<r&&(r=n,i=e[s]);return i},o.mixin=L,o.noConflict=function(){return e._=_,this},o.once=function(e){var t,r=i;return function(){return r?t:(r=n,t=e.apply(this,arguments))}},o.partial=function(e){var t=tt.call(arguments,1),n=t.length;return function(){var r;return r=arguments,r.length&&(t.length=n,et.apply(t,r)),r=1==t.length?e.call(this,t[0]):e.apply(this,t),t.length=n,r}},o.pick=function(e){for(var t,n=0,r=Y.apply(Q,arguments),i=r.length,s={};++n<i;)t=r[n],t in e&&(s[t]=e[t]);return s
|
||||
},o.pluck=Tt,o.range=function(e,t,n){n||(n=1),2>arguments.length&&(t=e||0,e=0);for(var r=-1,i=Math.max(Math.ceil((t-e)/n),0),s=Array(i);++r<i;)s[r]=e,e+=n;return s},o.reduce=mt,o.reduceRight=g,o.reject=pt,o.rest=S,o.result=function(e,t){if(!e)return r;var n=e[t];return nt.call(n)==V?e[t]():n},o.shuffle=function(e){if(!e)return[];for(var t,n=-1,r=e.length,i=Array(r);++n<r;)t=Math.floor(Math.random()*(n+1)),i[n]=i[t],i[t]=e[n];return i},o.size=function(e){if(!e)return 0;var t=e.length;return t===t>>>0?
|
||||
e.length:At(e).length},o.some=ct,o.sortBy=function(e,n,r){if("string"==typeof n)var i=n,n=function(e){return e[i]};else r&&(n=h(n,r));r=xt(e,function(t,r){return{a:n(t,r,e),b:t}}),r.sort(function(e,n){var r=e.a,i=n.a;return r===t?1:i===t?-1:r<i?-1:r>i?1:0});for(var s=r.length;s--;)r[s]=r[s].b;return r},o.sortedIndex=x,o.tap=function(e,t){return t(e),e},o.template=function(e,t,n){n||(n={});var i,s,u=o.templateSettings,a=n.escape,c=n.evaluate,h=n.interpolate,n=n.variable;return a==r&&(a=u.escape),c==
|
||||
r&&(c=u.evaluate),h==r&&(h=u.interpolate),a&&(e=e.replace(a,d)),h&&(s=e!=(e=e.replace(h,v))),c&&(i=e!=(e=e.replace(c,m))),e="__p='"+e.replace(B,l).replace(P,f)+"';",I.length=0,n||(n=u.variable,e="with("+n+"||{}){"+e+"}"),e="function("+n+"){var __p"+(s?",__t":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+e+"return __p}",i=Function("_","return "+e)(o),t?i(t):(i.source=e,i)},o.throttle=function(e,n){function r(){a=new Date,u=t,e.apply(o,i)}var i,s,o,u,a=0;return function(
|
||||
){var t=new Date,f=n-(t-a);return i=arguments,o=this,0>=f?(a=t,s=e.apply(o,i)):u||(u=at(r,f)),s}},o.times=function(e,t,n){var r=-1;if(n)for(;++r<e;)t.call(n,r);else for(;++r<e;)t(r)},o.toArray=function(e){if(!e)return[];if(e.toArray&&nt.call(e.toArray)==V)return e.toArray();var t=e.length;return t===t>>>0?tt.call(e):Ot(e)},o.union=function(){for(var e=-1,t=[],n=Y.apply(t,arguments),r=n.length;++e<r;)0>w(t,n[e])&&t.push(n[e]);return t},o.uniq=T,o.uniqueId=function(e){var t=M++;return e?e+t:t},o.values=
|
||||
Ot,o.without=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length;++n<r;)0>w(arguments,e[n],1)&&t.push(e[n]);return t},o.wrap=function(e,t){return function(){var n=[e];return arguments.length&&et.apply(n,arguments),t.apply(this,n)}},o.zip=function(e){if(!e)return[];for(var t=-1,n=E(Tt(arguments,"length")),r=Array(n);++t<n;)r[t]=Tt(arguments,t);return r},o.all=yt,o.any=ct,o.collect=xt,o.detect=bt,o.each=wt,o.foldl=mt,o.foldr=g,o.head=y,o.include=D,o.inject=mt,o.methods=kt,o.select=G,o.tail=
|
||||
S,o.take=y,o.unique=T,u.prototype=o.prototype,L(o),u.prototype.chain=function(){return this._chain=n,this},u.prototype.value=function(){return this._wrapped},wt("pop push reverse shift sort splice unshift".split(" "),function(e){var t=Q[e];u.prototype[e]=function(){var e=this._wrapped;return t.apply(e,arguments),e.length===0&&delete e[0],this._chain&&(e=new u(e),e._chain=n),e}}),wt(["concat","join","slice"],function(e){var t=Q[e];u.prototype[e]=function(){var e=t.apply(this._wrapped,arguments);return this
|
||||
._chain&&(e=new u(e),e._chain=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=o,define(function(){return o})):A?"object"==typeof module&&module&&module.s==A?(module.s=o)._=o:A._=o:e._=o})(this);
|
||||
;(function(e,t){"use strict";function s(e){return"[object Arguments]"==it.call(e)}function o(e){return new u(e)}function u(e){if(e&&e._wrapped)return e;this._wrapped=e}function a(){for(var e,t,s,o=-1,u=arguments.length,a={e:"",f:"",k:"",q:"",c:{d:"",m:"++l<o"},o:{d:""}};++o<u;)for(t in e=arguments[o],e)s=(s=e[t])==r?"":s,/d|m|j/.test(t)?("string"==typeof s&&(s={b:s,n:s}),a.c[t]=s.b,a.o[t]=s.n):a[t]=s;e=a.a,t=a.c,s=a.o;var o=/^[^,]+/.exec(e)[0],u=s.m,f=/\S+$/.exec(u||o)[0];a.g=o,a.i=M,a.h="j.call("+
|
||||
f+",l)",a.l=f,a.p=F,a.r=a.r!==i,a.f||(a.f="if(!"+o+")return u");if("r"==o||!t.j)a.c=r;return u||(s.m="l in "+f),Function("c,i,j,k,n,s,w,z,C,D,h,E",'"use strict";return function('+e+"){"+ct(a)+"}")(X,J,tt,k,h,z,rt,G,it,n,i)}function f(e,t){return q[t]}function l(e){return"\\"+W[e]}function c(e){return U[e]}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(){}function d(e,t){var n=q.length;return q[n]="'+_.escape("+t+")+'",I+n}function v(e,t){var n=q.length;return q[n]="'+((__t=("+
|
||||
t+"))==null?'':__t)+'",I+n}function m(e,t){var n=q.length;return q[n]="';"+t+";__p+='",I+n}function g(e,t,n,r){if(!e)return n;var i=e.length,s=3>arguments.length;r&&(t=h(t,r));if(i===i>>>0){for(i&&s&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}var o=Mt(e);for((i=o.length)&&s&&(n=e[o[--i]]);i--;)s=o[i],n=t(n,e[s],s,e);return n}function y(e,n,r){if(e)return n==t||r?e[0]:rt.call(e,0,n)}function b(e,t){var n=[];if(!e)return n;for(var r,i=-1,s=e.length;++i<s;)r=e[i],Ot(r)?nt.apply(n,t?r:b(r)):n.push(r);return n
|
||||
}function w(e,t,n){if(!e)return-1;var r=-1,i=e.length;if(n){if("number"!=typeof n)return r=x(e,t),e[r]===t?r:-1;r=(0>n?Math.max(0,i+n):n)-1}for(;++r<i;)if(e[r]===t)return r;return-1}function E(e,t,n){var r=-Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]>i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n>r&&(r=n,i=e[s]);return i}function S(e,n,r){return e?rt.call(e,n==t||r?1:n):[]}function x(e,t,n,r){if(!e)return 0;var i=0,s=e.length;if(n){r&&(n=N(n,r));for(t=n(
|
||||
t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+s>>>1,e[r]<t?i=r+1:s=r;return i}function T(e,t,n,r){var s=[];if(!e)return s;var o=-1,u=e.length,a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n?r&&(n=h(n,r)):n=k;++o<u;)if(r=n(e[o],o,e),t?!o||a[a.length-1]!==r:0>w(a,r))a.push(r),s.push(e[o]);return s}function N(e,t){function n(){var u=arguments,a=t;return s||(e=t[i]),o.length&&(u=u.length?et.apply(o,u):o),this instanceof n?(p.prototype=e.prototype,a=new p,u=e.apply(a,u),z[typeof u]&&u!==r?u:
|
||||
a):e.apply(a,u)}var i,s=it.call(e)==J;if(s){if(st)return st.call.apply(st,arguments)}else i=t,t=e;var o=rt.call(arguments,2);return n}function C(e,r,s){s||(s=[]);if(e===r)return 0!==e||1/e==1/r;if(e==t||r==t)return e===r;e._chain&&(e=e._wrapped),r._chain&&(r=r._wrapped);if(e.isEqual&&it.call(e.isEqual)==J)return e.isEqual(r);if(r.isEqual&&it.call(r.isEqual)==J)return r.isEqual(e);var o=it.call(e);if(o!=it.call(r))return i;switch(o){case G:return e==""+r;case K:return e!=+e?r!=+r:0==e?1/e==1/r:e==+
|
||||
r;case V:case $:return+e==+r;case Q:return e.source==r.source&&e.global==r.global&&e.multiline==r.multiline&&e.ignoreCase==r.ignoreCase}if("object"!=typeof e||"object"!=typeof r)return i;for(var u=s.length;u--;)if(s[u]==e)return n;var u=-1,a=n,f=0;s.push(e);if(o==X){if(f=e.length,a=f==r.length)for(;f--&&(a=C(e[f],r[f],s)););}else{if("constructor"in e!="constructor"in r||e.constructor!=r.constructor)return i;for(var l in e)if(tt.call(e,l)&&(f++,!(a=tt.call(r,l)&&C(e[l],r[l],s))))break;if(a){for(l in
|
||||
r)if(tt.call(r,l)&&!(f--))break;a=!f}if(a&&M)for(;7>++u&&(l=F[u],!tt.call(e,l)||!!(a=tt.call(r,l)&&C(e[l],r[l],s))););}return s.pop(),a}function k(e){return e}function L(e){St(At(e),function(t){var r=o[t]=e[t];u.prototype[t]=function(){var e=[this._wrapped];return arguments.length&&nt.apply(e,arguments),e=r.apply(o,e),this._chain&&(e=new u(e),e._chain=n),e}})}function A(e,t,n){n||(n={});var i,s,u=o.templateSettings,a=n.escape,c=n.evaluate,h=n.interpolate,n=n.variable;return a==r&&(a=u.escape),c==
|
||||
r&&(c=u.evaluate),h==r&&(h=u.interpolate),a&&(e=e.replace(a,d)),h&&(s=e!=(e=e.replace(h,v))),c&&(i=e!=(e=e.replace(c,m))),e="__p='"+e.replace(j,l).replace(H,f)+"';",q.length=0,n||(n=u.variable,e="with("+n+"||{}){"+e+"}"),e="function("+n+"){var __p"+(s?",__t":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+e+"return __p}",i=Function("_","return "+e)(o),t?i(t):(i.source=e,i)}var n=!0,r=null,i=!1,O="object"==typeof exports&&exports&&("object"==typeof global&&global&&
|
||||
global==global.global&&(e=global),exports),M=!{valueOf:0}.propertyIsEnumerable("valueOf"),_=0,D=e._,P=RegExp("^"+({}.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),H=/__token__(\d+)/g,B=/[&<"']/g,j=/['\n\r\t\u2028\u2029\\]/g,F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),I="__token__",q=[];try{Function("//@")()}catch(R){}var U={"&":"&","<":"<",'"':""","'":"'"},z={"boolean"
|
||||
:i,"function":n,object:n,number:i,string:i,"undefined":i},W={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X="[object Array]",V="[object Boolean]",$="[object Date]",J="[object Function]",K="[object Number]",Q="[object RegExp]",G="[object String]",Y=Array.prototype,Z=Object.prototype,et=Y.concat,tt=Z.hasOwnProperty,nt=Y.push,rt=Y.slice,it=Z.toString,st=P.test(st=rt.bind)&&/\n|Opera/.test(st+it.call(e.opera))&&st,ot=P.test(ot=Array.isArray)&&ot,ut=e.isFinite,at=P.test
|
||||
(at=Object.keys)&&at,ft=e.clearTimeout,lt=e.setTimeout;o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"obj"};var ct=A("var index,result<%if(init){%>=<%=init%><%}%>;<%=exit%>;<%=top%>;<%if(arrayBranch){%>var length=<%=firstArg%>.length;index=-1;<%if(objectBranch){%>if(length===length>>>0){<%}%><%=arrayBranch.beforeLoop%>;while(<%=arrayBranch.loopExp%>){<%=arrayBranch.inLoop%>;}<%if(objectBranch){%>}<%}}if(objectBranch){if(arrayBranch){%>else{<%}if(!hasDontEnumBug){%>var skipProto=typeof <%=iteratedObject%>=='function';<%}%><%=objectBranch.beforeLoop%>;for(<%=objectBranch.loopExp%>){<%if(hasDontEnumBug){if(useHas){%>if(<%=hasExp%>){<%}%><%=objectBranch.inLoop%>;<%if(useHas){%>}<%}}else{%>if(!(skipProto&&index=='prototype')<%if(useHas){%>&&<%=hasExp%><%}%>){<%=objectBranch.inLoop%>;}<%}%>}<%if(hasDontEnumBug){%>var ctor=<%=iteratedObject%>.constructor;<%for(var k=0;k<7;k++){%>index='<%=shadowed[k]%>';if(<%if(shadowed[k]=='constructor'){%>!(ctor&&ctor.prototype===<%=iteratedObject%>)&&<%}%><%=hasExp%>){<%=objectBranch.inLoop%>;}<%}}if(arrayBranch){%>}<%}}%><%=bottom%>;return result"
|
||||
),ht={a:"f,d,B",k:"f",q:"if(!d){d=k}else if(B){d=n(d,B)}",j:"d(f[l],l,f)"},pt={k:"D",j:"if(!d(f[l],l,f))return!u"},dt={a:"r",k:"r",q:"for(var x,y=1,o=arguments.length;y<o;y++){x=arguments[y];"+(M?"if(x){":""),m:"l in x",r:i,j:"r[l]=x[l]",e:(M?"}":"")+"}"},vt={k:"[]",j:"d(f[l],l,f)&&u.push(f[l])"},mt={q:"if(B)d=n(d,B)"},gt={j:{n:ht.j}},yt={k:"",f:"if(!f)return[]",d:{b:"u=Array(o)",n:"u=[]"},j:{b:"u[l]=d(f[l],l,f)",n:"u.push(d(f[l],l,f))"}},bt=a({args:"object",exit:"if(!objectTypes[typeof object]||object===null)throw TypeError()"
|
||||
,init:"[]",inLoop:"result.push(index)"}),P=a({args:"collection,target",init:"false",inLoop:"if(collection[index]===target)return true"}),wt=a(ht,pt),Z=a(ht,vt),Et=a(ht,mt,{init:"",inLoop:"if(callback(collection[index],index,collection))return collection[index]"}),St=a(ht,mt),xt=a(ht,{init:"{}",top:"var prop,isFunc=typeof callback=='function';if(isFunc&&thisArg)callback=iteratorBind(callback,thisArg)",inLoop:"prop=isFunc?callback(collection[index],index,collection):collection[index][callback];(hasOwnProperty.call(result,prop)?result[prop]:result[prop]=[]).push(collection[index])"
|
||||
}),Tt=a(yt,{args:"collection,methodName",top:"var args=slice.call(arguments,2),isFunc=typeof methodName=='function'",inLoop:{array:"result[index]=(isFunc?methodName:collection[index][methodName]).apply(collection[index],args)",object:"result.push((isFunc?methodName:collection[index][methodName]).apply(collection[index],args))"}}),Nt=a(ht,yt),Ct=a(yt,{args:"collection,property",inLoop:{array:"result[index]=collection[index][property]",object:"result.push(collection[index][property])"}}),yt=a({args
|
||||
:"collection,callback,accumulator,thisArg",init:"accumulator",top:"var noaccum=arguments.length<3;if(thisArg)callback=iteratorBind(callback,thisArg)",beforeLoop:{array:"if(noaccum)result=collection[++index]"},inLoop:{array:"result=callback(result,collection[index],index,collection)",object:"result=noaccum?(noaccum=false,collection[index]):callback(result,collection[index],index,collection)"}}),vt=a(ht,vt,{inLoop:"!"+vt.s}),pt=a(ht,pt,{init:"false",inLoop:pt.s.replace("!","")}),kt=a(dt,{inLoop:"if(object[index]==undefined)"+
|
||||
dt.s}),Lt=a(dt),dt=a(ht,mt,gt,{useHas:i}),ht=a(ht,mt,gt),At=a({args:"object",init:"[]",useHas:i,inLoop:"if(toString.call(object[index])==funcClass)result.push(index)",bottom:"result.sort()"});s(arguments)||(s=function(e){return!!e&&!!tt.call(e,"callee")});var Ot=ot||function(e){return it.call(e)==X},ot=a({args:"value",init:"true",top:"var className=toString.call(value);if(className==arrayClass||className==stringClass)return!value.length",inLoop:{object:"return false"}}),Mt=at?function(e){return"function"==typeof
|
||||
e?bt(e):at(e)}:bt,_t=a({args:"object",init:"[]",inLoop:"result.push(object[index])"});o.VERSION="0.3.2",o.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},o.bind=N,o.bindAll=function(e){var t=arguments,n=1;1==t.length&&(n=0,t=At(e));for(var r=t.length;n<r;n++)e[t[n]]=N(e[t[n]],e);return e},o.chain=function(e){return e=new u(e),e._chain=n,e},o.clone=function(e){return z[typeof e]&&e!==r?Ot(e)?e.slice():Lt({},e):e},o.compact=function(e){var t=[];if(!e)return t
|
||||
;for(var n=-1,r=e.length;++n<r;)e[n]&&t.push(e[n]);return t},o.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},o.contains=P,o.debounce=function(e,n,r){function i(){a=t,r||e.apply(u,s)}var s,o,u,a;return function(){var t=r&&!a;return s=arguments,u=this,ft(a),a=lt(i,n),t&&(o=e.apply(u,s)),o}},o.defaults=kt,o.defer=function(e){var n=rt.call(arguments,1);return lt(function(){return e.apply(t,n)},1)},o.delay=function(e,n){var r=
|
||||
rt.call(arguments,2);return lt(function(){return e.apply(t,r)},n)},o.difference=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=et.apply(t,arguments);++n<r;)0>w(i,e[n],r)&&t.push(e[n]);return t},o.escape=function(e){return e==r?"":(e+"").replace(B,c)},o.every=wt,o.extend=Lt,o.filter=Z,o.find=Et,o.first=y,o.flatten=b,o.forEach=St,o.forIn=dt,o.forOwn=ht,o.functions=At,o.groupBy=xt,o.has=function(e,t){return tt.call(e,t)},o.identity=k,o.indexOf=w,o.initial=function(e,n,r){return e?rt.call
|
||||
(e,0,-(n==t||r?1:n)):[]},o.intersection=function(e){var t=[];if(!e)return t;for(var n,r=-1,i=e.length,s=rt.call(arguments,1);++r<i;)n=e[r],0>w(t,n)&&wt(s,function(e){return-1<w(e,n)})&&t.push(n);return t},o.invoke=Tt,o.isArguments=s,o.isArray=Ot,o.isBoolean=function(e){return e===n||e===i||it.call(e)==V},o.isDate=function(e){return it.call(e)==$},o.isElement=function(e){return!!e&&1==e.nodeType},o.isEmpty=ot,o.isEqual=C,o.isFinite=function(e){return ut(e)&&it.call(e)==K},o.isFunction=function(e){
|
||||
return it.call(e)==J},o.isNaN=function(e){return it.call(e)==K&&e!=+e},o.isNull=function(e){return e===r},o.isNumber=function(e){return it.call(e)==K},o.isObject=function(e){return z[typeof e]&&e!==r},o.isRegExp=function(e){return it.call(e)==Q},o.isString=function(e){return it.call(e)==G},o.isUndefined=function(e){return e===t},o.keys=Mt,o.last=function(e,n,r){if(e){var i=e.length;return n==t||r?e[i-1]:rt.call(e,-n||i)}},o.lastIndexOf=function(e,t,n){if(!e)return-1;var r=e.length;for(n&&"number"==typeof
|
||||
n&&(r=(0>n?Math.max(0,r+n):Math.min(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},o.map=Nt,o.max=E,o.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},o.min=function(e,t,n){var r=Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]<i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n<r&&(r=n,i=e[s]);return i},o.mixin=L,o.noConflict=function(){return e._=D,this},o.once=function(
|
||||
e){var t,r=i;return function(){return r?t:(r=n,t=e.apply(this,arguments))}},o.partial=function(e){var t=rt.call(arguments,1),n=t.length;return function(){var r;return r=arguments,r.length&&(t.length=n,nt.apply(t,r)),r=1==t.length?e.call(this,t[0]):e.apply(this,t),t.length=n,r}},o.pick=function(e){for(var t,n=0,r=et.apply(Y,arguments),i=r.length,s={};++n<i;)t=r[n],t in e&&(s[t]=e[t]);return s},o.pluck=Ct,o.range=function(e,t,n){n||(n=1),t==r&&(t=e||0,e=0);for(var i=-1,t=Math.max(0,Math.ceil((t-e)/
|
||||
n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},o.reduce=yt,o.reduceRight=g,o.reject=vt,o.rest=S,o.result=function(e,t){if(!e)return r;var n=e[t];return it.call(n)==J?e[t]():n},o.shuffle=function(e){if(!e)return[];for(var t,n=-1,r=e.length,i=Array(r);++n<r;)t=Math.floor(Math.random()*(n+1)),i[n]=i[t],i[t]=e[n];return i},o.size=function(e){if(!e)return 0;var t=e.length;return t===t>>>0?e.length:Mt(e).length},o.some=pt,o.sortBy=function(e,n,r){if("string"==typeof n)var i=n,n=function(e){return e[i]};else r&&
|
||||
(n=h(n,r));r=Nt(e,function(t,r){return{a:n(t,r,e),b:t}}),r.sort(function(e,n){var r=e.a,i=n.a;return r===t?1:i===t?-1:r<i?-1:r>i?1:0});for(var s=r.length;s--;)r[s]=r[s].b;return r},o.sortedIndex=x,o.tap=function(e,t){return t(e),e},o.template=A,o.throttle=function(e,n){function r(){a=new Date,u=t,e.apply(o,i)}var i,s,o,u,a=0;return function(){var t=new Date,f=n-(t-a);return i=arguments,o=this,0>=f?(a=t,s=e.apply(o,i)):u||(u=lt(r,f)),s}},o.times=function(e,t,n){var r=-1;if(n)for(;++r<e;)t.call(n,r
|
||||
);else for(;++r<e;)t(r)},o.toArray=function(e){if(!e)return[];if(e.toArray&&it.call(e.toArray)==J)return e.toArray();var t=e.length;return t===t>>>0?rt.call(e):_t(e)},o.union=function(){for(var e=-1,t=[],n=et.apply(t,arguments),r=n.length;++e<r;)0>w(t,n[e])&&t.push(n[e]);return t},o.uniq=T,o.uniqueId=function(e){var t=_++;return e?e+t:t},o.values=_t,o.without=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length;++n<r;)0>w(arguments,e[n],1)&&t.push(e[n]);return t},o.wrap=function(e,t){return function(
|
||||
){var n=[e];return arguments.length&&nt.apply(n,arguments),t.apply(this,n)}},o.zip=function(e){if(!e)return[];for(var t=-1,n=E(Ct(arguments,"length")),r=Array(n);++t<n;)r[t]=Ct(arguments,t);return r},o.all=wt,o.any=pt,o.collect=Nt,o.detect=Et,o.each=St,o.foldl=yt,o.foldr=g,o.head=y,o.include=P,o.inject=yt,o.methods=At,o.select=Z,o.tail=S,o.take=y,o.unique=T,o.u=ct,o.v=bt,u.prototype=o.prototype,L(o),u.prototype.chain=function(){return this._chain=n,this},u.prototype.value=function(){return this._wrapped
|
||||
},St("pop push reverse shift sort splice unshift".split(" "),function(e){var t=Y[e];u.prototype[e]=function(){var e=this._wrapped;return t.apply(e,arguments),e.length===0&&delete e[0],this._chain&&(e=new u(e),e._chain=n),e}}),St(["concat","join","slice"],function(e){var t=Y[e];u.prototype[e]=function(){var e=t.apply(this._wrapped,arguments);return this._chain&&(e=new u(e),e._chain=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=o,define(function(){return o})):O?"object"==typeof
|
||||
module&&module&&module.t==O?(module.t=o)._=o:O._=o:e._=o})(this);
|
||||
Reference in New Issue
Block a user