lodash-rails 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.compat.js +215 -137
- data/vendor/assets/javascripts/lodash.compat.min.js +41 -41
- data/vendor/assets/javascripts/lodash.js +312 -291
- data/vendor/assets/javascripts/lodash.min.js +39 -37
- data/vendor/assets/javascripts/lodash.underscore.js +165 -120
- data/vendor/assets/javascripts/lodash.underscore.min.js +29 -29
- metadata +2 -2
@@ -1,42 +1,44 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
|
-
* Lo-Dash 1.
|
3
|
+
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license
|
4
4
|
* Build: `lodash modern -o ./dist/lodash.js`
|
5
5
|
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
6
6
|
*/
|
7
|
-
;(function(n){function t(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
if(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}function
|
19
|
-
if(typeof u=="number")for(;++
|
20
|
-
|
21
|
-
typeof
|
22
|
-
return
|
23
|
-
|
24
|
-
|
25
|
-
var
|
26
|
-
n[u]=
|
27
|
-
if("function"!=r){if("object"!=r)return function(t){return t[n]};var
|
28
|
-
}
|
29
|
-
var r=0,
|
30
|
-
return
|
31
|
-
if(
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
},
|
36
|
-
},
|
37
|
-
},
|
38
|
-
},
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
7
|
+
;(function(n){function t(o){function f(n){if(!n||ue.call(n)!=S)return a;var t=n.valueOf,e=typeof t=="function"&&(e=Zt(t))&&Zt(e);return e?n==e||Zt(n)==e:X(n)}function q(n,t,e){if(!n||!F[typeof n])return n;t=t&&typeof e=="undefined"?t:M.createCallback(t,e);for(var r=-1,u=F[typeof n]?me(n):[],o=u.length;++r<o&&(e=u[r],!(t(n[e],e,n)===a)););return n}function D(n,t,e){var r;if(!n||!F[typeof n])return n;t=t&&typeof e=="undefined"?t:M.createCallback(t,e);for(r in n)if(t(n[r],r,n)===a)break;return n}function z(n,t,e){var r,u=n,a=u;
|
8
|
+
if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&F[typeof u]){var c=u.length;if(r=-1,rt(u))for(;++r<c;)"undefined"==typeof a[r]&&(a[r]=u[r]);else for(var l=-1,p=F[typeof u]?me(u):[],c=p.length;++l<c;)r=p[l],"undefined"==typeof a[r]&&(a[r]=u[r])}return a}function P(n,t,e){var r,u=n,a=u;if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var c=M.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(c=o[--f]);
|
9
|
+
for(;++i<f;)if((u=o[i])&&F[typeof u]){var l=u.length;if(r=-1,rt(u))for(;++r<l;)a[r]=c?c(a[r],u[r]):u[r];else for(var p=-1,s=F[typeof u]?me(u):[],l=s.length;++p<l;)r=s[p],a[r]=c?c(a[r],u[r]):u[r]}return a}function K(n){var t,e=[];if(!n||!F[typeof n])return e;for(t in n)ne.call(n,t)&&e.push(t);return e}function M(n){return n&&typeof n=="object"&&!rt(n)&&ne.call(n,"__wrapped__")?n:new Q(n)}function U(n){var t=n.length,e=t>=s;if(e)for(var r={},u=-1;++u<t;){var a=p+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=p+t;
|
10
|
+
return r[u]&&-1<xt(r[u],t)}return-1<xt(n,t)}}function V(n){return n.charCodeAt(0)}function G(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function H(n,t,e,r){function a(){var r=arguments,l=i?this:t;return o||(n=t[f]),e.length&&(r=r.length?(r=ge.call(r),c?r.concat(e):e.concat(r)):e),this instanceof a?(W.prototype=n.prototype,l=new W,W.prototype=u,r=n.apply(l,r),ot(r)?r:l):n.apply(l,r)}var o=at(n),i=!e,f=t;if(i){var c=r;
|
11
|
+
e=t}else if(!o){if(!r)throw new Vt;t=n}return a}function J(n){return"\\"+R[n]}function L(n){return be[n]}function Q(n){this.__wrapped__=n}function W(){}function X(n){var t=a;if(!n||ue.call(n)!=S)return t;var e=n.constructor;return(at(e)?e instanceof e:he.nodeClass||!isNode(n))?(D(n,function(n,e){t=e}),t===a||ne.call(n,t)):t}function Y(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Rt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function Z(n){return de[n]}function nt(n,t,r,u,o,i){var f=n;
|
12
|
+
if(typeof t=="function"&&(u=r,r=t,t=a),typeof r=="function"){if(r=typeof u=="undefined"?r:M.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=ot(f)){var c=ue.call(f);if(!B[c])return f;var l=rt(f)}if(!u||!t)return u?l?Y(f):P({},f):f;switch(u=ye[c],c){case N:case E:return new u(+f);case I:case $:return new u(f);case A:return u(f.source,b.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(ne.call(n,"index")&&(f.index=n.index),ne.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?yt:q)(n,function(n,u){f[u]=nt(n,t,r,e,o,i)
|
13
|
+
}),f}function tt(n){var t=[];return D(n,function(n,e){at(n)&&t.push(e)}),t.sort()}function et(n){for(var t=-1,e=me(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function rt(n){return n instanceof Rt||oe(n)}function ut(n,t,e,o,i,f){var c=e===l;if(typeof e=="function"&&!c){e=M.createCallback(e,o,2);var p=e(n,t);if(typeof p!="undefined")return!!p}if(n===t)return 0!==n||1/n==1/t;var s=typeof n,v=typeof t;if(n===n&&(!n||"function"!=s&&"object"!=s)&&(!t||"function"!=v&&"object"!=v))return a;
|
14
|
+
if(n==u||t==u)return n===t;if(v=ue.call(n),s=ue.call(t),v==x&&(v=S),s==x&&(s=S),v!=s)return a;switch(v){case N:case E:return+n==+t;case I:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case A:case $:return n==Ut(t)}if(s=v==O,!s){if(ne.call(n,"__wrapped__")||ne.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,e,o,i,f);if(v!=S)return a;var v=n.constructor,g=t.constructor;if(v!=g&&(!at(v)||!(v instanceof v&&at(g)&&g instanceof g)))return a}for(i||(i=[]),f||(f=[]),v=i.length;v--;)if(i[v]==n)return f[v]==t;
|
15
|
+
var y=0,p=r;if(i.push(n),f.push(t),s){if(v=n.length,y=t.length,p=y==n.length,!p&&!c)return p;for(;y--;)if(s=v,g=t[y],c)for(;s--&&!(p=ut(n[s],g,e,o,i,f)););else if(!(p=ut(n[y],g,e,o,i,f)))break;return p}return D(t,function(t,r,u){return ne.call(u,r)?(y++,p=ne.call(n,r)&&ut(n[r],t,e,o,i,f)):void 0}),p&&!c&&D(n,function(n,t,e){return ne.call(e,t)?p=-1<--y:void 0}),p}function at(n){return typeof n=="function"}function ot(n){return n?F[typeof n]:a}function it(n){return typeof n=="number"||ue.call(n)==I}function ft(n){return typeof n=="string"||ue.call(n)==$
|
16
|
+
}function ct(n,t,e){var r=arguments,u=0,a=2;if(!ot(n))return n;if(e===l)var o=r[3],i=r[4],c=r[5];else i=[],c=[],typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=M.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a]);for(;++u<a;)(rt(r[u])?yt:q)(r[u],function(t,e){var r,u,a=t,p=n[e];if(t&&((u=rt(t))||f(t))){for(a=i.length;a--;)if(r=i[a]==t){p=c[a];break}if(!r){var s;o&&(a=o(p,t),s=typeof a!="undefined")&&(p=a),s||(p=u?rt(p)?p:[]:f(p)?p:{}),i.push(t),c.push(p),s||(p=ct(p,t,l,o,i,c))
|
17
|
+
}}else o&&(a=o(p,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(p=a);n[e]=p});return n}function lt(n){for(var t=-1,e=me(n),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u}function pt(n,t,e){var r=-1,u=n?n.length:0,o=a;return e=(0>e?le(0,u+e):e)||0,typeof u=="number"?o=-1<(ft(n)?n.indexOf(t,e):xt(n,t,e)):q(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function st(n,t,e){var u=r;t=M.createCallback(t,e),e=-1;var a=n?n.length:0;if(typeof a=="number")for(;++e<a&&(u=!!t(n[e],e,n)););else q(n,function(n,e,r){return u=!!t(n,e,r)
|
18
|
+
});return u}function vt(n,t,e){var r=[];t=M.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else q(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function gt(n,t,e){t=M.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return q(n,function(n,e,r){return t(n,e,r)?(u=n,a):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function yt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:M.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==a;);else q(n,t);
|
19
|
+
return n}function ht(n,t,e){var r=-1,u=n?n.length:0;if(t=M.createCallback(t,e),typeof u=="number")for(var a=Rt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],q(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function mt(n,t,e){var r=-1/0,u=r;if(!t&&rt(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o>u&&(u=o)}}else t=!t&&ft(n)?V:M.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function bt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Rt(r);++e<r;)u[e]=n[e][t];return u||ht(n,t)
|
20
|
+
}function dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=M.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else q(n,function(n,r,o){e=u?(u=a,n):t(e,n,r,o)});return e}function _t(n,t,e,r){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=me(n),u=i.length;return t=M.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=M.createCallback(t,e),e=-1;var u=n?n.length:0;
|
21
|
+
if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else q(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function wt(n){for(var t=-1,e=n?n.length:0,r=Xt.apply(Gt,ge.call(arguments,1)),r=U(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function Ct(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=-1;for(t=M.createCallback(t,e);++o<a&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[0];return Y(n,0,pe(le(0,r),a))}}function jt(n,t,e,r){var o=-1,i=n?n.length:0,f=[];for(typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a),e!=u&&(e=M.createCallback(e,r));++o<i;)r=n[o],e&&(r=e(r,o,n)),rt(r)?te.apply(f,t?r:jt(r)):f.push(r);
|
22
|
+
return f}function xt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?le(0,u+e):e||0)-1;else if(e)return r=Nt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function Ot(n,t,e){if(typeof t!="number"&&t!=u){var r=0,a=-1,o=n?n.length:0;for(t=M.createCallback(t,e);++a<o&&t(n[a],a,n);)r++}else r=t==u||e?1:le(0,t);return Y(n,r)}function Nt(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?M.createCallback(e,r,1):$t,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Et(n,t,e,r){var o=-1,i=n?n.length:0,f=[],c=f;
|
23
|
+
typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a);var l=!t&&i>=s;if(l)var v={};for(e!=u&&(c=[],e=M.createCallback(e,r));++o<i;){r=n[o];var g=e?e(r,o,n):r;if(l)var y=p+g,y=v[y]?!(c=v[y]):c=v[y]=[];(t?!o||c[c.length-1]!==g:y||0>xt(c,g))&&((e||l)&&c.push(g),f.push(r))}return f}function It(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function St(n,t){return he.fastBind||ae&&2<arguments.length?ae.call.apply(ae,arguments):H(n,t,ge.call(arguments,2))}function At(n){var t=ge.call(arguments,1);
|
24
|
+
return re(function(){n.apply(e,t)},1)}function $t(n){return n}function Bt(n){yt(tt(n),function(t){var e=M[t]=n[t];M.prototype[t]=function(){var n=this.__wrapped__,t=[n];return te.apply(t,arguments),t=e.apply(M,t),n&&typeof n=="object"&&n==t?this:new Q(t)}})}function Ft(){return this.__wrapped__}o=o?T.defaults(n.Object(),o,T.pick(n,j)):n;var Rt=o.Array,Tt=o.Boolean,qt=o.Date,Dt=o.Function,zt=o.Math,Pt=o.Number,Kt=o.Object,Mt=o.RegExp,Ut=o.String,Vt=o.TypeError,Gt=Rt(),Ht=Kt(),Jt=o._,Lt=Mt("^"+Ut(Ht.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Qt=zt.ceil,Wt=o.clearTimeout,Xt=Gt.concat,Yt=zt.floor,Zt=Lt.test(Zt=Kt.getPrototypeOf)&&Zt,ne=Ht.hasOwnProperty,te=Gt.push,ee=o.setImmediate,re=o.setTimeout,ue=Ht.toString,ae=Lt.test(ae=ue.bind)&&ae,oe=Lt.test(oe=Rt.isArray)&&oe,ie=o.isFinite,fe=o.isNaN,ce=Lt.test(ce=Kt.keys)&&ce,le=zt.max,pe=zt.min,se=o.parseInt,ve=zt.random,ge=Gt.slice,zt=Lt.test(o.attachEvent),zt=ae&&!/\n|true/.test(ae+zt),ye={};
|
25
|
+
ye[O]=Rt,ye[N]=Tt,ye[E]=qt,ye[S]=Kt,ye[I]=Pt,ye[A]=Mt,ye[$]=Ut;var he=M.support={};he.fastBind=ae&&!zt,M.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:M}},Q.prototype=M.prototype;var me=ce?function(n){return ot(n)?ce(n):[]}:K,be={"&":"&","<":"<",">":">",'"':""","'":"'"},de=et(be);return zt&&i&&typeof ee=="function"&&(At=St(ee,o)),Tt=8==se("08")?se:function(n,t){return se(ft(n)?n.replace(_,""):n,t||0)},M.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
26
|
+
}},M.assign=P,M.at=function(n){for(var t=-1,e=Xt.apply(Gt,ge.call(arguments,1)),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u},M.bind=St,M.bindAll=function(n){for(var t=1<arguments.length?Xt.apply(Gt,ge.call(arguments,1)):tt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=St(n[u],n)}return n},M.bindKey=function(n,t){return H(n,t,ge.call(arguments,2),l)},M.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},M.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
27
|
+
return t[0]}},M.countBy=function(n,t,e){var r={};return t=M.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),ne.call(r,e)?r[e]++:r[e]=1}),r},M.createCallback=function(n,t,e){if(n==u)return $t;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var o=me(n);return function(t){for(var e=o.length,r=a;e--&&(r=ut(t[o[e]],n[o[e]],l)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
|
28
|
+
}:function(e,r,u){return n.call(t,e,r,u)}:n},M.debounce=function(n,t,e){function o(){l=u,p&&(f=n.apply(c,i))}var i,f,c,l,p=r;if(e===r)var s=r,p=a;else e&&F[typeof e]&&(s=e.leading,p="trailing"in e?e.trailing:p);return function(){var e=s&&!l;return i=arguments,c=this,Wt(l),l=re(o,t),e&&(f=n.apply(c,i)),f}},M.defaults=z,M.defer=At,M.delay=function(n,t){var r=ge.call(arguments,2);return re(function(){n.apply(e,r)},t)},M.difference=wt,M.filter=vt,M.flatten=jt,M.forEach=yt,M.forIn=D,M.forOwn=q,M.functions=tt,M.groupBy=function(n,t,e){var r={};
|
29
|
+
return t=M.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),(ne.call(r,e)?r[e]:r[e]=[]).push(n)}),r},M.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=M.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return Y(n,0,pe(le(0,a-r),a))},M.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(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>xt(f,c)){o&&f.push(c);
|
30
|
+
for(var v=e;--v;)if(!(r[v]||(r[v]=U(t[v])))(c))continue n;i.push(c)}}return i},M.invert=et,M.invoke=function(n,t){var e=ge.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Rt(typeof a=="number"?a:0);return yt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},M.keys=me,M.map=ht,M.max=mt,M.memoize=function(n,t){var e={};return function(){var r=p+(t?t.apply(this,arguments):arguments[0]);return ne.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},M.merge=ct,M.min=function(n,t,e){var r=1/0,u=r;
|
31
|
+
if(!t&&rt(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&ft(n)?V:M.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},M.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=M.createCallback(t,e);else var a=Xt.apply(Gt,ge.call(arguments,1));return D(n,function(n,e,o){(r?!t(n,e,o):0>xt(a,e))&&(u[e]=n)}),u},M.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},M.pairs=function(n){for(var t=-1,e=me(n),r=e.length,u=Rt(r);++t<r;){var a=e[t];
|
32
|
+
u[t]=[a,n[a]]}return u},M.partial=function(n){return H(n,ge.call(arguments,1))},M.partialRight=function(n){return H(n,ge.call(arguments,1),u,l)},M.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Xt.apply(Gt,ge.call(arguments,1)),o=ot(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=M.createCallback(t,e),D(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},M.pluck=bt,M.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);var r=-1;t=le(0,Qt((t-n)/e));for(var a=Rt(t);++r<t;)a[r]=n,n+=e;
|
33
|
+
return a},M.reject=function(n,t,e){return t=M.createCallback(t,e),vt(n,function(n,e,r){return!t(n,e,r)})},M.rest=Ot,M.shuffle=function(n){var t=-1,e=n?n.length:0,r=Rt(typeof e=="number"?e:0);return yt(n,function(n){var e=Yt(ve()*(++t+1));r[t]=r[e],r[e]=n}),r},M.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Rt(typeof u=="number"?u:0);for(t=M.createCallback(t,e),yt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}}),u=a.length,a.sort(G);u--;)a[u]=a[u].c;return a},M.tap=function(n,t){return t(n),n},M.throttle=function(n,t,e){function o(){p=new qt,l=u,v&&(f=n.apply(c,i))
|
34
|
+
}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&F[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new qt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=re(o,r)):(Wt(l),l=u,p=e,f=n.apply(c,i)),f}},M.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Rt(n);for(t=M.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},M.toArray=function(n){return n&&typeof n.length=="number"?Y(n):lt(n)},M.union=function(n){return rt(n)||(arguments[0]=n?ge.call(n):Gt),Et(Xt.apply(Gt,arguments))
|
35
|
+
},M.uniq=Et,M.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?mt(bt(n,"length")):0,u=Rt(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=Rt(e)))[t]=o[a];return u},M.values=lt,M.where=vt,M.without=function(n){return wt(n,ge.call(arguments,1))},M.wrap=function(n,t){return function(){var e=[n];return te.apply(e,arguments),t.apply(this,e)}},M.zip=function(n){for(var t=-1,e=n?mt(bt(arguments,"length")):0,r=Rt(e);++t<e;)r[t]=bt(arguments,t);return r},M.zipObject=It,M.collect=ht,M.drop=Ot,M.each=yt,M.extend=P,M.methods=tt,M.object=It,M.select=vt,M.tail=Ot,M.unique=Et,Bt(M),M.clone=nt,M.cloneDeep=function(n,t,e){return nt(n,r,t,e)
|
36
|
+
},M.contains=pt,M.escape=function(n){return n==u?"":Ut(n).replace(w,L)},M.every=st,M.find=gt,M.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=M.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},M.findKey=function(n,t,e){var r;return t=M.createCallback(t,e),q(n,function(n,e,u){return t(n,e,u)?(r=e,a):void 0}),r},M.has=function(n,t){return n?ne.call(n,t):a},M.identity=$t,M.indexOf=xt,M.isArguments=function(n){return ue.call(n)==x},M.isArray=rt,M.isBoolean=function(n){return n===r||n===a||ue.call(n)==N
|
37
|
+
},M.isDate=function(n){return n instanceof qt||ue.call(n)==E},M.isElement=function(n){return n?1===n.nodeType:a},M.isEmpty=function(n){var t=r;if(!n)return t;var e=ue.call(n),u=n.length;return e==O||e==$||e==x||e==S&&typeof u=="number"&&at(n.splice)?!u:(q(n,function(){return t=a}),t)},M.isEqual=ut,M.isFinite=function(n){return ie(n)&&!fe(parseFloat(n))},M.isFunction=at,M.isNaN=function(n){return it(n)&&n!=+n},M.isNull=function(n){return n===u},M.isNumber=it,M.isObject=ot,M.isPlainObject=f,M.isRegExp=function(n){return n instanceof Mt||ue.call(n)==A
|
38
|
+
},M.isString=ft,M.isUndefined=function(n){return typeof n=="undefined"},M.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?le(0,r+e):pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},M.mixin=Bt,M.noConflict=function(){return o._=Jt,this},M.parseInt=Tt,M.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+Yt(ve()*((+t||0)-n+1))},M.reduce=dt,M.reduceRight=_t,M.result=function(n,t){var r=n?n[t]:e;return at(r)?n[t]():r},M.runInContext=t,M.size=function(n){var t=n?n.length:0;
|
39
|
+
return typeof t=="number"?t:me(n).length},M.some=kt,M.sortedIndex=Nt,M.template=function(n,t,u){var a=M.templateSettings;n||(n=""),u=z({},u,a);var o,i=z({},u.imports,a.imports),a=me(i),i=lt(i),f=0,c=u.interpolate||k,l="__p+='",c=Mt((u.escape||k).source+"|"+c.source+"|"+(c===d?m:k).source+"|"+(u.evaluate||k).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(C,J),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t
|
40
|
+
}),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=Dt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},M.unescape=function(n){return n==u?"":Ut(n).replace(h,Z)},M.uniqueId=function(n){var t=++c;return Ut(n==u?"":n)+t
|
41
|
+
},M.all=st,M.any=kt,M.detect=gt,M.foldl=dt,M.foldr=_t,M.include=pt,M.inject=dt,q(M,function(n,t){M.prototype[t]||(M.prototype[t]=function(){var t=[this.__wrapped__];return te.apply(t,arguments),n.apply(M,t)})}),M.first=Ct,M.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=M.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return Y(n,le(0,a-r))}},M.take=Ct,M.head=Ct,q(M,function(n,t){M.prototype[t]||(M.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
|
42
|
+
return t==u||e&&typeof t!="function"?r:new Q(r)})}),M.VERSION="1.2.0",M.prototype.toString=function(){return Ut(this.__wrapped__)},M.prototype.value=Ft,M.prototype.valueOf=Ft,yt(["join","pop","shift"],function(n){var t=Gt[n];M.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),yt(["push","reverse","sort","unshift"],function(n){var t=Gt[n];M.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),yt(["concat","slice","splice"],function(n){var t=Gt[n];M.prototype[n]=function(){return new Q(t.apply(this.__wrapped__,arguments))
|
43
|
+
}}),M}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,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=/^0+(?=.$)/,k=/($^)/,w=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,j="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),x="[object Arguments]",O="[object Array]",N="[object Boolean]",E="[object Date]",I="[object Number]",S="[object Object]",A="[object RegExp]",$="[object String]",B={"[object Function]":a};
|
44
|
+
B[x]=B[O]=B[N]=B[E]=B[I]=B[S]=B[A]=B[$]=r;var F={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},R={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},T=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=T,define(function(){return T})):o&&!o.nodeType?i?(i.exports=T)._=T:o._=T:n._=T})(this);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
|
-
* Lo-Dash 1.
|
3
|
+
* Lo-Dash 1.2.0 (Custom Build) <http://lodash.com/>
|
4
4
|
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
5
5
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
6
6
|
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
|
@@ -18,9 +18,9 @@
|
|
18
18
|
/** Detect free variable `module` */
|
19
19
|
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
|
20
20
|
|
21
|
-
/** Detect free variable `global
|
21
|
+
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
22
22
|
var freeGlobal = typeof global == 'object' && global;
|
23
|
-
if (freeGlobal.global === freeGlobal) {
|
23
|
+
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
24
24
|
window = freeGlobal;
|
25
25
|
}
|
26
26
|
|
@@ -30,6 +30,12 @@
|
|
30
30
|
/** Used internally to indicate various things */
|
31
31
|
var indicatorObject = {};
|
32
32
|
|
33
|
+
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
|
34
|
+
var keyPrefix = +new Date + '';
|
35
|
+
|
36
|
+
/** Used as the size when optimizations are enabled for large arrays */
|
37
|
+
var largeArraySize = 200;
|
38
|
+
|
33
39
|
/** Used to match empty string literals in compiled template source */
|
34
40
|
var reEmptyStringLeading = /\b__p \+= '';/g,
|
35
41
|
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
@@ -118,18 +124,18 @@
|
|
118
124
|
hasOwnProperty = objectRef.hasOwnProperty,
|
119
125
|
push = arrayRef.push,
|
120
126
|
setTimeout = window.setTimeout,
|
121
|
-
slice = arrayRef.slice,
|
122
127
|
toString = objectRef.toString;
|
123
128
|
|
124
129
|
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
125
|
-
var nativeBind = reNative.test(nativeBind =
|
130
|
+
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
|
126
131
|
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
127
132
|
nativeIsFinite = window.isFinite,
|
128
133
|
nativeIsNaN = window.isNaN,
|
129
134
|
nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
|
130
135
|
nativeMax = Math.max,
|
131
136
|
nativeMin = Math.min,
|
132
|
-
nativeRandom = Math.random
|
137
|
+
nativeRandom = Math.random,
|
138
|
+
nativeSlice = arrayRef.slice;
|
133
139
|
|
134
140
|
/** Detect various environments */
|
135
141
|
var isIeOpera = reNative.test(window.attachEvent),
|
@@ -138,7 +144,7 @@
|
|
138
144
|
/*--------------------------------------------------------------------------*/
|
139
145
|
|
140
146
|
/**
|
141
|
-
* Creates a `lodash` object,
|
147
|
+
* Creates a `lodash` object, which wraps the given `value`, to enable method
|
142
148
|
* chaining.
|
143
149
|
*
|
144
150
|
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
|
@@ -156,8 +162,8 @@
|
|
156
162
|
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
|
157
163
|
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
|
158
164
|
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
|
159
|
-
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `
|
160
|
-
* `where`, `without`, `wrap`, and `zip`
|
165
|
+
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
|
166
|
+
* `values`, `where`, `without`, `wrap`, and `zip`
|
161
167
|
*
|
162
168
|
* The non-chainable wrapper functions are:
|
163
169
|
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
|
@@ -176,6 +182,26 @@
|
|
176
182
|
* @category Chaining
|
177
183
|
* @param {Mixed} value The value to wrap in a `lodash` instance.
|
178
184
|
* @returns {Object} Returns a `lodash` instance.
|
185
|
+
* @example
|
186
|
+
*
|
187
|
+
* var wrapped = _([1, 2, 3]);
|
188
|
+
*
|
189
|
+
* // returns an unwrapped value
|
190
|
+
* wrapped.reduce(function(sum, num) {
|
191
|
+
* return sum + num;
|
192
|
+
* });
|
193
|
+
* // => 6
|
194
|
+
*
|
195
|
+
* // returns a wrapped value
|
196
|
+
* var squares = wrapped.map(function(num) {
|
197
|
+
* return num * num;
|
198
|
+
* });
|
199
|
+
*
|
200
|
+
* _.isArray(squares);
|
201
|
+
* // => false
|
202
|
+
*
|
203
|
+
* _.isArray(squares.value());
|
204
|
+
* // => true
|
179
205
|
*/
|
180
206
|
function lodash(value) {
|
181
207
|
return (value instanceof lodash)
|
@@ -196,12 +222,12 @@
|
|
196
222
|
var object = { '0': 1, 'length': 1 };
|
197
223
|
|
198
224
|
/**
|
199
|
-
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5).
|
225
|
+
* Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
|
200
226
|
*
|
201
227
|
* @memberOf _.support
|
202
228
|
* @type Boolean
|
203
229
|
*/
|
204
|
-
support.argsObject = arguments.constructor == Object;
|
230
|
+
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
|
205
231
|
|
206
232
|
/**
|
207
233
|
* Detect if `Function#bind` exists and is inferred to be fast (all but V8).
|
@@ -354,7 +380,7 @@
|
|
354
380
|
}
|
355
381
|
if (partialArgs.length) {
|
356
382
|
args = args.length
|
357
|
-
? (args =
|
383
|
+
? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
358
384
|
: partialArgs;
|
359
385
|
}
|
360
386
|
if (this instanceof bound) {
|
@@ -458,29 +484,7 @@
|
|
458
484
|
}
|
459
485
|
|
460
486
|
/**
|
461
|
-
*
|
462
|
-
*
|
463
|
-
* @static
|
464
|
-
* @memberOf _
|
465
|
-
* @category Objects
|
466
|
-
* @param {Mixed} value The value to check.
|
467
|
-
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
468
|
-
* @example
|
469
|
-
*
|
470
|
-
* (function() { return _.isArray(arguments); })();
|
471
|
-
* // => false
|
472
|
-
*
|
473
|
-
* _.isArray([1, 2, 3]);
|
474
|
-
* // => true
|
475
|
-
*/
|
476
|
-
var isArray = nativeIsArray || function(value) {
|
477
|
-
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
|
478
|
-
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
|
479
|
-
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
|
480
|
-
};
|
481
|
-
|
482
|
-
/**
|
483
|
-
* A fallback implementation of `Object.keys` that produces an array of the
|
487
|
+
* A fallback implementation of `Object.keys` which produces an array of the
|
484
488
|
* given object's own enumerable property names.
|
485
489
|
*
|
486
490
|
* @private
|
@@ -631,7 +635,7 @@
|
|
631
635
|
*/
|
632
636
|
function clone(value) {
|
633
637
|
return isObject(value)
|
634
|
-
? (isArray(value) ?
|
638
|
+
? (isArray(value) ? nativeSlice.call(value) : assign({}, value))
|
635
639
|
: value;
|
636
640
|
}
|
637
641
|
|
@@ -816,6 +820,26 @@
|
|
816
820
|
return result;
|
817
821
|
}
|
818
822
|
|
823
|
+
/**
|
824
|
+
* Checks if `value` is an array.
|
825
|
+
*
|
826
|
+
* @static
|
827
|
+
* @memberOf _
|
828
|
+
* @category Objects
|
829
|
+
* @param {Mixed} value The value to check.
|
830
|
+
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
831
|
+
* @example
|
832
|
+
*
|
833
|
+
* (function() { return _.isArray(arguments); })();
|
834
|
+
* // => false
|
835
|
+
*
|
836
|
+
* _.isArray([1, 2, 3]);
|
837
|
+
* // => true
|
838
|
+
*/
|
839
|
+
var isArray = nativeIsArray || function(value) {
|
840
|
+
return toString.call(value) == arrayClass;
|
841
|
+
};
|
842
|
+
|
819
843
|
/**
|
820
844
|
* Checks if `value` is a boolean value.
|
821
845
|
*
|
@@ -847,7 +871,7 @@
|
|
847
871
|
* // => true
|
848
872
|
*/
|
849
873
|
function isDate(value) {
|
850
|
-
return
|
874
|
+
return toString.call(value) == dateClass;
|
851
875
|
}
|
852
876
|
|
853
877
|
/**
|
@@ -1092,7 +1116,7 @@
|
|
1092
1116
|
// fallback for older versions of Chrome and Safari
|
1093
1117
|
if (isFunction(/x/)) {
|
1094
1118
|
isFunction = function(value) {
|
1095
|
-
return
|
1119
|
+
return toString.call(value) == funcClass;
|
1096
1120
|
};
|
1097
1121
|
}
|
1098
1122
|
|
@@ -1206,7 +1230,7 @@
|
|
1206
1230
|
* // => true
|
1207
1231
|
*/
|
1208
1232
|
function isRegExp(value) {
|
1209
|
-
return
|
1233
|
+
return toString.call(value) == regexpClass;
|
1210
1234
|
}
|
1211
1235
|
|
1212
1236
|
/**
|
@@ -1270,11 +1294,11 @@
|
|
1270
1294
|
* // => { 'name': 'moe' }
|
1271
1295
|
*/
|
1272
1296
|
function omit(object) {
|
1273
|
-
var props = concat.apply(arrayRef, arguments),
|
1297
|
+
var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
1274
1298
|
result = {};
|
1275
1299
|
|
1276
1300
|
forIn(object, function(value, key) {
|
1277
|
-
if (indexOf(props, key
|
1301
|
+
if (indexOf(props, key) < 0) {
|
1278
1302
|
result[key] = value;
|
1279
1303
|
}
|
1280
1304
|
});
|
@@ -1334,8 +1358,8 @@
|
|
1334
1358
|
* // => { 'name': 'moe' }
|
1335
1359
|
*/
|
1336
1360
|
function pick(object) {
|
1337
|
-
var index =
|
1338
|
-
props = concat.apply(arrayRef, arguments),
|
1361
|
+
var index = -1,
|
1362
|
+
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
1339
1363
|
length = props.length,
|
1340
1364
|
result = {};
|
1341
1365
|
|
@@ -1609,7 +1633,9 @@
|
|
1609
1633
|
* @returns {Mixed} Returns the found element, else `undefined`.
|
1610
1634
|
* @example
|
1611
1635
|
*
|
1612
|
-
* _.find([1, 2, 3, 4], function(num) {
|
1636
|
+
* _.find([1, 2, 3, 4], function(num) {
|
1637
|
+
* return num % 2 == 0;
|
1638
|
+
* });
|
1613
1639
|
* // => 2
|
1614
1640
|
*
|
1615
1641
|
* var food = [
|
@@ -1651,6 +1677,29 @@
|
|
1651
1677
|
}
|
1652
1678
|
}
|
1653
1679
|
|
1680
|
+
/**
|
1681
|
+
* Examines each element in a `collection`, returning the first that
|
1682
|
+
* has the given `properties`. When checking `properties`, this method
|
1683
|
+
* performs a deep comparison between values to determine if they are
|
1684
|
+
* equivalent to each other.
|
1685
|
+
*
|
1686
|
+
* @static
|
1687
|
+
* @memberOf _
|
1688
|
+
* @category Collections
|
1689
|
+
* @param {Array|Object|String} collection The collection to iterate over.
|
1690
|
+
* @param {Object} properties The object of property values to filter by.
|
1691
|
+
* @returns {Mixed} Returns the found element, else `undefined`.
|
1692
|
+
* @example
|
1693
|
+
*
|
1694
|
+
* var food = [
|
1695
|
+
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
1696
|
+
* { 'name': 'banana', 'organic': true, 'type': 'fruit' },
|
1697
|
+
* { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
1698
|
+
* ];
|
1699
|
+
*
|
1700
|
+
* _.findWhere(food, { 'type': 'vegetable' });
|
1701
|
+
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
1702
|
+
*/
|
1654
1703
|
function findWhere(object, properties) {
|
1655
1704
|
return where(object, properties, true);
|
1656
1705
|
}
|
@@ -1761,7 +1810,7 @@
|
|
1761
1810
|
* // => [['1', '2', '3'], ['4', '5', '6']]
|
1762
1811
|
*/
|
1763
1812
|
function invoke(collection, methodName) {
|
1764
|
-
var args =
|
1813
|
+
var args = nativeSlice.call(arguments, 2),
|
1765
1814
|
index = -1,
|
1766
1815
|
isFunc = typeof methodName == 'function',
|
1767
1816
|
length = collection ? collection.length : 0,
|
@@ -1999,7 +2048,7 @@
|
|
1999
2048
|
}
|
2000
2049
|
|
2001
2050
|
/**
|
2002
|
-
* Reduces a `collection` to a value
|
2051
|
+
* Reduces a `collection` to a value which is the accumulated result of running
|
2003
2052
|
* each element in the `collection` through the `callback`, where each successive
|
2004
2053
|
* `callback` execution consumes the return value of the previous execution.
|
2005
2054
|
* If `accumulator` is not passed, the first element of the `collection` will be
|
@@ -2324,7 +2373,7 @@
|
|
2324
2373
|
*/
|
2325
2374
|
function toArray(collection) {
|
2326
2375
|
if (isArray(collection)) {
|
2327
|
-
return
|
2376
|
+
return nativeSlice.call(collection);
|
2328
2377
|
}
|
2329
2378
|
if (collection && typeof collection.length == 'number') {
|
2330
2379
|
return map(collection);
|
@@ -2410,12 +2459,12 @@
|
|
2410
2459
|
function difference(array) {
|
2411
2460
|
var index = -1,
|
2412
2461
|
length = array.length,
|
2413
|
-
flattened = concat.apply(arrayRef, arguments),
|
2462
|
+
flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
2414
2463
|
result = [];
|
2415
2464
|
|
2416
2465
|
while (++index < length) {
|
2417
2466
|
var value = array[index];
|
2418
|
-
if (indexOf(flattened, value
|
2467
|
+
if (indexOf(flattened, value) < 0) {
|
2419
2468
|
result.push(value);
|
2420
2469
|
}
|
2421
2470
|
}
|
@@ -2496,7 +2545,7 @@
|
|
2496
2545
|
return array[0];
|
2497
2546
|
}
|
2498
2547
|
}
|
2499
|
-
return
|
2548
|
+
return nativeSlice.call(array, 0, nativeMin(nativeMax(0, n), length));
|
2500
2549
|
}
|
2501
2550
|
}
|
2502
2551
|
|
@@ -2517,7 +2566,7 @@
|
|
2517
2566
|
* @static
|
2518
2567
|
* @memberOf _
|
2519
2568
|
* @category Arrays
|
2520
|
-
* @param {Array} array The array to
|
2569
|
+
* @param {Array} array The array to flatten.
|
2521
2570
|
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
|
2522
2571
|
* @param {Function|Object|String} [callback=identity] The function called per
|
2523
2572
|
* iteration. If a property name or object is passed, it will be used to create
|
@@ -2671,7 +2720,7 @@
|
|
2671
2720
|
} else {
|
2672
2721
|
n = (callback == null || thisArg) ? 1 : callback || n;
|
2673
2722
|
}
|
2674
|
-
return
|
2723
|
+
return nativeSlice.call(array, 0, nativeMin(nativeMax(0, length - n), length));
|
2675
2724
|
}
|
2676
2725
|
|
2677
2726
|
/**
|
@@ -2786,7 +2835,7 @@
|
|
2786
2835
|
return array[length - 1];
|
2787
2836
|
}
|
2788
2837
|
}
|
2789
|
-
return
|
2838
|
+
return nativeSlice.call(array, nativeMax(0, length - n));
|
2790
2839
|
}
|
2791
2840
|
}
|
2792
2841
|
|
@@ -2943,7 +2992,7 @@
|
|
2943
2992
|
} else {
|
2944
2993
|
n = (callback == null || thisArg) ? 1 : nativeMax(0, callback);
|
2945
2994
|
}
|
2946
|
-
return
|
2995
|
+
return nativeSlice.call(array, n);
|
2947
2996
|
}
|
2948
2997
|
|
2949
2998
|
/**
|
@@ -2963,7 +3012,7 @@
|
|
2963
3012
|
* @static
|
2964
3013
|
* @memberOf _
|
2965
3014
|
* @category Arrays
|
2966
|
-
* @param {Array} array The array to
|
3015
|
+
* @param {Array} array The array to inspect.
|
2967
3016
|
* @param {Mixed} value The value to evaluate.
|
2968
3017
|
* @param {Function|Object|String} [callback=identity] The function called per
|
2969
3018
|
* iteration. If a property name or object is passed, it will be used to create
|
@@ -3026,7 +3075,10 @@
|
|
3026
3075
|
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
3027
3076
|
* // => [1, 2, 3, 101, 10]
|
3028
3077
|
*/
|
3029
|
-
function union() {
|
3078
|
+
function union(array) {
|
3079
|
+
if (!isArray(array)) {
|
3080
|
+
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
|
3081
|
+
}
|
3030
3082
|
return uniq(concat.apply(arrayRef, arguments));
|
3031
3083
|
}
|
3032
3084
|
|
@@ -3121,17 +3173,7 @@
|
|
3121
3173
|
* // => [2, 3, 4]
|
3122
3174
|
*/
|
3123
3175
|
function without(array) {
|
3124
|
-
|
3125
|
-
length = array.length,
|
3126
|
-
result = [];
|
3127
|
-
|
3128
|
-
while (++index < length) {
|
3129
|
-
var value = array[index];
|
3130
|
-
if (indexOf(arguments, value, 1) < 0) {
|
3131
|
-
result.push(value);
|
3132
|
-
}
|
3133
|
-
}
|
3134
|
-
return result
|
3176
|
+
return difference(array, nativeSlice.call(arguments, 1));
|
3135
3177
|
}
|
3136
3178
|
|
3137
3179
|
/**
|
@@ -3257,7 +3299,7 @@
|
|
3257
3299
|
// (in V8 `Function#bind` is slower except when partially applied)
|
3258
3300
|
return support.fastBind || (nativeBind && arguments.length > 2)
|
3259
3301
|
? nativeBind.call.apply(nativeBind, arguments)
|
3260
|
-
: createBound(func, thisArg,
|
3302
|
+
: createBound(func, thisArg, nativeSlice.call(arguments, 2));
|
3261
3303
|
}
|
3262
3304
|
|
3263
3305
|
/**
|
@@ -3284,8 +3326,8 @@
|
|
3284
3326
|
* // => alerts 'clicked docs', when the button is clicked
|
3285
3327
|
*/
|
3286
3328
|
function bindAll(object) {
|
3287
|
-
var funcs = concat.apply(arrayRef, arguments),
|
3288
|
-
index =
|
3329
|
+
var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
|
3330
|
+
index = -1,
|
3289
3331
|
length = funcs.length;
|
3290
3332
|
|
3291
3333
|
while (++index < length) {
|
@@ -3422,17 +3464,18 @@
|
|
3422
3464
|
/**
|
3423
3465
|
* Creates a function that will delay the execution of `func` until after
|
3424
3466
|
* `wait` milliseconds have elapsed since the last time it was invoked. Pass
|
3425
|
-
* `
|
3426
|
-
*
|
3427
|
-
*
|
3467
|
+
* an `options` object to indicate that `func` should be invoked on the leading
|
3468
|
+
* and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
|
3469
|
+
* function will return the result of the last `func` call.
|
3428
3470
|
*
|
3429
3471
|
* @static
|
3430
3472
|
* @memberOf _
|
3431
3473
|
* @category Functions
|
3432
3474
|
* @param {Function} func The function to debounce.
|
3433
3475
|
* @param {Number} wait The number of milliseconds to delay.
|
3434
|
-
* @param {
|
3435
|
-
* edge of the timeout.
|
3476
|
+
* @param {Object} options The options object.
|
3477
|
+
* [leading=false] A boolean to specify execution on the leading edge of the timeout.
|
3478
|
+
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
3436
3479
|
* @returns {Function} Returns the new debounced function.
|
3437
3480
|
* @example
|
3438
3481
|
*
|
@@ -3482,7 +3525,7 @@
|
|
3482
3525
|
* // returns from the function before `alert` is called
|
3483
3526
|
*/
|
3484
3527
|
function defer(func) {
|
3485
|
-
var args =
|
3528
|
+
var args = nativeSlice.call(arguments, 1);
|
3486
3529
|
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
3487
3530
|
}
|
3488
3531
|
|
@@ -3504,7 +3547,7 @@
|
|
3504
3547
|
* // => 'logged later' (Appears after one second.)
|
3505
3548
|
*/
|
3506
3549
|
function delay(func, wait) {
|
3507
|
-
var args =
|
3550
|
+
var args = nativeSlice.call(arguments, 2);
|
3508
3551
|
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
3509
3552
|
}
|
3510
3553
|
|
@@ -3530,7 +3573,7 @@
|
|
3530
3573
|
function memoize(func, resolver) {
|
3531
3574
|
var cache = {};
|
3532
3575
|
return function() {
|
3533
|
-
var key =
|
3576
|
+
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
|
3534
3577
|
return hasOwnProperty.call(cache, key)
|
3535
3578
|
? cache[key]
|
3536
3579
|
: (cache[key] = func.apply(this, arguments));
|
@@ -3590,21 +3633,26 @@
|
|
3590
3633
|
* // => 'hi moe'
|
3591
3634
|
*/
|
3592
3635
|
function partial(func) {
|
3593
|
-
return createBound(func,
|
3636
|
+
return createBound(func, nativeSlice.call(arguments, 1));
|
3594
3637
|
}
|
3595
3638
|
|
3596
3639
|
/**
|
3597
|
-
* Creates a function that, when executed, will only call the `func`
|
3598
|
-
*
|
3599
|
-
*
|
3600
|
-
*
|
3601
|
-
*
|
3640
|
+
* Creates a function that, when executed, will only call the `func` function
|
3641
|
+
* at most once per every `wait` milliseconds. If the throttled function is
|
3642
|
+
* invoked more than once during the `wait` timeout, `func` will also be called
|
3643
|
+
* on the trailing edge of the timeout. Pass an `options` object to indicate
|
3644
|
+
* that `func` should be invoked on the leading and/or trailing edge of the
|
3645
|
+
* `wait` timeout. Subsequent calls to the throttled function will return
|
3646
|
+
* the result of the last `func` call.
|
3602
3647
|
*
|
3603
3648
|
* @static
|
3604
3649
|
* @memberOf _
|
3605
3650
|
* @category Functions
|
3606
3651
|
* @param {Function} func The function to throttle.
|
3607
3652
|
* @param {Number} wait The number of milliseconds to throttle executions to.
|
3653
|
+
* @param {Object} options The options object.
|
3654
|
+
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
|
3655
|
+
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
3608
3656
|
* @returns {Function} Returns the new throttled function.
|
3609
3657
|
* @example
|
3610
3658
|
*
|
@@ -3836,9 +3884,6 @@
|
|
3836
3884
|
* Note: In the development build, `_.template` utilizes sourceURLs for easier
|
3837
3885
|
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
|
3838
3886
|
*
|
3839
|
-
* Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp`
|
3840
|
-
* build and using precompiled templates, or loading Lo-Dash in a sandbox.
|
3841
|
-
*
|
3842
3887
|
* For more information on precompiling templates see:
|
3843
3888
|
* http://lodash.com/#custom-builds
|
3844
3889
|
*
|
@@ -3849,7 +3894,7 @@
|
|
3849
3894
|
* @memberOf _
|
3850
3895
|
* @category Utilities
|
3851
3896
|
* @param {String} text The template text.
|
3852
|
-
* @param {
|
3897
|
+
* @param {Object} data The data object used to populate the text.
|
3853
3898
|
* @param {Object} options The options object.
|
3854
3899
|
* escape - The "escape" delimiter regexp.
|
3855
3900
|
* evaluate - The "evaluate" delimiter regexp.
|
@@ -3998,7 +4043,7 @@
|
|
3998
4043
|
}
|
3999
4044
|
|
4000
4045
|
/**
|
4001
|
-
* The
|
4046
|
+
* The inverse of `_.escape`, this method converts the HTML entities
|
4002
4047
|
* `&`, `<`, `>`, `"`, and `'` in `string` to their
|
4003
4048
|
* corresponding characters.
|
4004
4049
|
*
|
@@ -4280,7 +4325,7 @@
|
|
4280
4325
|
* @memberOf _
|
4281
4326
|
* @type String
|
4282
4327
|
*/
|
4283
|
-
lodash.VERSION = '1.
|
4328
|
+
lodash.VERSION = '1.2.0';
|
4284
4329
|
|
4285
4330
|
// add functions to `lodash.prototype`
|
4286
4331
|
mixin(lodash);
|
@@ -4289,36 +4334,36 @@
|
|
4289
4334
|
lodash.prototype.chain = wrapperChain;
|
4290
4335
|
lodash.prototype.value = wrapperValueOf;
|
4291
4336
|
|
4292
|
-
|
4293
|
-
|
4294
|
-
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4299
|
-
|
4300
|
-
|
4301
|
-
|
4302
|
-
|
4303
|
-
|
4304
|
-
|
4305
|
-
|
4306
|
-
|
4307
|
-
|
4308
|
-
|
4309
|
-
|
4310
|
-
|
4311
|
-
|
4312
|
-
|
4313
|
-
|
4314
|
-
|
4315
|
-
|
4316
|
-
|
4317
|
-
|
4318
|
-
|
4319
|
-
|
4320
|
-
|
4321
|
-
|
4337
|
+
// add `Array` mutator functions to the wrapper
|
4338
|
+
forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
4339
|
+
var func = arrayRef[methodName];
|
4340
|
+
lodash.prototype[methodName] = function() {
|
4341
|
+
var value = this.__wrapped__;
|
4342
|
+
func.apply(value, arguments);
|
4343
|
+
|
4344
|
+
// avoid array-like object bugs with `Array#shift` and `Array#splice`
|
4345
|
+
// in Firefox < 10 and IE < 9
|
4346
|
+
if (!support.spliceObjects && value.length === 0) {
|
4347
|
+
delete value[0];
|
4348
|
+
}
|
4349
|
+
return this;
|
4350
|
+
};
|
4351
|
+
});
|
4352
|
+
|
4353
|
+
// add `Array` accessor functions to the wrapper
|
4354
|
+
forEach(['concat', 'join', 'slice'], function(methodName) {
|
4355
|
+
var func = arrayRef[methodName];
|
4356
|
+
lodash.prototype[methodName] = function() {
|
4357
|
+
var value = this.__wrapped__,
|
4358
|
+
result = func.apply(value, arguments);
|
4359
|
+
|
4360
|
+
if (this.__chain__) {
|
4361
|
+
result = new lodashWrapper(result);
|
4362
|
+
result.__chain__ = true;
|
4363
|
+
}
|
4364
|
+
return result;
|
4365
|
+
};
|
4366
|
+
});
|
4322
4367
|
|
4323
4368
|
/*--------------------------------------------------------------------------*/
|
4324
4369
|
|