lodash-rails 2.2.1 → 2.3.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 +783 -552
- data/vendor/assets/javascripts/lodash.compat.min.js +54 -52
- data/vendor/assets/javascripts/lodash.js +776 -545
- data/vendor/assets/javascripts/lodash.min.js +51 -50
- data/vendor/assets/javascripts/lodash.underscore.js +553 -439
- data/vendor/assets/javascripts/lodash.underscore.min.js +35 -34
- metadata +2 -2
@@ -1,56 +1,58 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
|
-
* Lo-Dash 2.
|
3
|
+
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
4
4
|
* Build: `lodash -o ./dist/lodash.compat.js`
|
5
5
|
*/
|
6
|
-
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]
|
7
|
-
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[
|
8
|
-
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(
|
9
|
-
}function
|
10
|
-
}),
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}function
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
});return
|
26
|
-
|
27
|
-
return r}function Wt(n,t){
|
28
|
-
return function(){
|
29
|
-
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
return
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
},
|
43
|
-
for(var u=
|
44
|
-
return
|
45
|
-
|
46
|
-
},
|
47
|
-
}),
|
48
|
-
},
|
49
|
-
},
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}
|
54
|
-
|
55
|
-
|
56
|
-
|
6
|
+
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
|
7
|
+
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}
|
8
|
+
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function g(e){function v(n){return n&&typeof n=="object"&&!We(n)&&je.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n
|
9
|
+
}function w(n){function t(){if(r){var n=r.slice();Ce.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return Ct(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return Ke(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!Ct(n))return n;var a=ve.call(n);if(!H[a]||!qe.nodeClass&&f(n))return n;var l=Te[a];switch(a){case T:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o
|
10
|
+
}if(a=We(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):nr({},n);return a&&(je.call(n,"index")&&(o.index=n.index),je.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Ze:rr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return Ct(n)?Ae(n):{}}function tt(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(qe.funcNames&&(r=!n.name),r=r||!qe.funcDecomp,!r)){var u=_e.call(n);
|
11
|
+
qe.funcNames||(r=!I.test(u)),r||(r=B.test(u),Ke(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Ht(n,t)}function ot(n){function t(){var n=l?a:this;if(u){var h=u.slice();Ce.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&Ce.apply(h,o),c&&h.length<i)?(r|=16,ot([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),Ct(h)?h:n):e.apply(n,h))
|
12
|
+
}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return Ke(t,n),t}function at(e,r){var u=-1,a=yt(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function it(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(We(a)||bt(a))){t||(a=it(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o
|
13
|
+
}function lt(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=ve.call(n),p=ve.call(t);if(l==$&&(l=G),p==$&&(p=G),l!=p)return false;switch(l){case T:case z:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==le(t)}if(p=l==L,!p){var s=je.call(n,"__wrapped__"),g=je.call(t,"__wrapped__");if(s||g)return lt(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);
|
14
|
+
if(l!=G||!qe.nodeClass&&(f(n)||f(t)))return false;if(l=!qe.argsObject&&bt(n)?ae:n.constructor,s=!qe.argsObject&&bt(t)?ae:t.constructor,l!=s&&!(xt(l)&&l instanceof l&&xt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;var h=0,a=true;if(u.push(n),o.push(t),p){if(l=n.length,h=t.length,a=h==n.length,!a&&!r)return a;for(;h--;)if(p=l,s=t[h],r)for(;p--&&!(a=lt(n[p],s,e,r,u,o)););else if(!(a=lt(n[h],s,e,r,u,o)))break;return a
|
15
|
+
}return er(t,function(t,i,l){return je.call(l,i)?(h++,a=je.call(n,i)&<(n[i],t,e,r,u,o)):void 0}),a&&!r&&er(n,function(n,t,e){return je.call(e,t)?a=-1<--h:void 0}),s&&(c(u),c(o)),a}function ft(n,t,e,r,u){(We(t)?Nt:rr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=We(t))||ur(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?We(f)?f:[]:ur(f)?f:{}),r.push(t),u.push(f),c||ft(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);
|
16
|
+
n[o]=f})}function ct(n,t){return n+be(Le()*(t-n+1))}function pt(e,r,u){var a=-1,l=yt(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;if(g){var v=o(h);v?(l=t,h=v):(g=false,h=u?h:(c(h),s))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function st(n){return function(t,e,r){var u={};if(e=v.createCallback(e,r,3),We(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Ze(t,function(t,r,o){n(u,t,e(t,r,o),o)
|
17
|
+
});return u}}function gt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||xt(n)))throw new fe;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&Ce.apply(c[2]||(c[2]=[]),e),f&&Ce.apply(c[3]||(c[3]=[]),r),c[1]|=t,gt.apply(null,c)):(1==t||17===t?w:ot)([n,t,e,r,u,o])}function ht(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];
|
18
|
+
t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=re,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",qe.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):qe.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),qe.enumPrototypes&&(r+="var G=typeof t=='function';"),qe.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var u=[];if(qe.enumPrototypes&&u.push('!(G&&n=="prototype")'),qe.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";
|
19
|
+
else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",qe.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";r+="}"}return(e.b||qe.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,pe,je,d,bt,We,Et,Q.f,se,X,ze,M,ge,ve)
|
20
|
+
}function vt(n){return Ve[n]}function yt(){var t=(t=v.indexOf)===qt?n:t;return t}function mt(n){var t,e;return!n||ve.call(n)!=G||(t=n.constructor,xt(t)&&!(t instanceof t))||!qe.argsClass&&bt(n)||!qe.nodeClass&&f(n)?false:qe.ownLast?(er(n,function(n,t,r){return e=je.call(r,t),false}),false!==e):(er(n,function(n,t){e=t}),typeof e=="undefined"||je.call(n,e))}function dt(n){return Qe[n]}function bt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||false}function _t(n,t,e){var r=Je(n),u=r.length;
|
21
|
+
for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function wt(n){var t=[];return er(n,function(n,e){xt(n)&&t.push(e)}),t.sort()}function jt(n){for(var t=-1,e=Je(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function xt(n){return typeof n=="function"}function Ct(n){return!(!n||!X[typeof n])}function kt(n){return typeof n=="number"||n&&typeof n=="object"&&ve.call(n)==W||false}function Et(n){return typeof n=="string"||n&&typeof n=="object"&&ve.call(n)==M||false}function Ot(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;)u[t]=n[e[t]];
|
22
|
+
return u}function St(n,t,e){var r=-1,u=yt(),o=n?n.length:0,a=false;return e=(0>e?Re(0,o+e):e)||0,We(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(Et(n)?n.indexOf(t,e):u(n,t,e)):Ze(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function It(n,t,e){var r=true;if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Ze(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];
|
23
|
+
t(o,e,n)&&r.push(o)}}else Ze(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Dt(n,t,e){if(t=v.createCallback(t,e,3),!We(n)){var r;return Ze(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Nt(n,t,e){if(t&&typeof e=="undefined"&&We(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Ze(n,t,e);return n}function Bt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),We(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=Je(n),u=o.length;
|
24
|
+
else qe.unindexedChars&&Et(n)&&(r=n.split(""));Ze(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Pt(n,t,e){var r=-1,u=n?n.length:0,o=ne(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),We(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ze(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Rt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)
|
25
|
+
});return o}function Ft(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),We(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ze(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function $t(n,t,e,r){var u=3>arguments.length;return t=v.createCallback(t,r,4),Bt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Lt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Nt(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function Tt(n,t,e){var r;if(t=v.createCallback(t,e,3),We(n)){e=-1;
|
26
|
+
for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ze(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Fe(Re(0,r),u))}function qt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Re(0,u+r):r||0}else if(r)return r=Wt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
|
27
|
+
for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Re(0,t);return s(n,r)}function Wt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Gt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),pt(n,t,e)}function Jt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Rt(lr(n,"length")):0,r=ne(0>e?0:e);++t<e;)r[t]=lr(n,t);
|
28
|
+
return r}function Mt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Ht(n,t){return 2<arguments.length?gt(n,17,s(arguments,2),null,t):gt(n,1,null,null,t)}function Ut(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!xt(n))throw new fe;if(t=Re(0,t)||0,true===e)var g=true,s=false;else Ct(e)&&(g=e.leading,p="maxWait"in e&&(Re(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(xe()-a);0<e?l=Ee(v,e):(u&&de(u),e=f,u=l=f=h,e&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null)))
|
29
|
+
},y=function(){l&&de(l),u=l=f=h,(s||p!==t)&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=xe(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);var h=p-(a-c),m=0>=h;m?(u&&(u=de(u)),c=a,o=n.apply(i,r)):u||(u=Ee(y,h))}return m&&l?l=de(l):l||t===p||(l=Ee(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Vt(n){if(!xt(n))throw new fe;var t=s(arguments,1);return Ee(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||xt(e);
|
30
|
+
t||(e=y,t=n,n=v),Nt(wt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return Ce.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ae=e.Object,ie=e.RegExp,le=e.String,fe=e.TypeError,ce=[],pe=e.Error.prototype,se=ae.prototype,ge=le.prototype,he=e._,ve=se.toString,ye=ie("^"+le(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),me=ue.ceil,de=e.clearTimeout,be=ue.floor,_e=re.prototype.toString,we=ye.test(we=ae.getPrototypeOf)&&we,je=se.hasOwnProperty,xe=ye.test(xe=ee.now)&&xe||function(){return+new ee
|
31
|
+
},Ce=ce.push,ke=se.propertyIsEnumerable,Ee=e.setTimeout,Oe=ce.splice,Se=typeof(Se=rt&&et&&rt.setImmediate)=="function"&&!ye.test(Se)&&Se,Ie=function(){try{var n={},t=ye.test(t=ae.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ae=ye.test(Ae=ae.create)&&Ae,De=ye.test(De=ne.isArray)&&De,Ne=e.isFinite,Be=e.isNaN,Pe=ye.test(Pe=ae.keys)&&Pe,Re=ue.max,Fe=ue.min,$e=e.parseInt,Le=ue.random,Te={};Te[L]=ne,Te[T]=te,Te[z]=ee,Te[K]=re,Te[G]=ae,Te[W]=oe,Te[J]=ie,Te[M]=le;var ze={};ze[L]=ze[z]=ze[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},ze[T]=ze[M]={constructor:true,toString:true,valueOf:true},ze[q]=ze[K]=ze[J]={constructor:true,toString:true},ze[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
|
32
|
+
for(t in ze)je.call(ze,t)&&!je.call(ze[t],e)&&(ze[t][e]=false)}}(),y.prototype=v.prototype;var qe=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);qe.argsClass=ve.call(arguments)==$,qe.argsObject=arguments.constructor==ae&&!(arguments instanceof ne),qe.enumErrorProps=ke.call(pe,"message")||ke.call(pe,"name"),qe.enumPrototypes=ke.call(n,"prototype"),qe.funcDecomp=!ye.test(e.WinRTError)&&B.test(g),qe.funcNames=typeof re.name=="string",qe.nonEnumArgs=0!=u,qe.nonEnumShadows=!/valueOf/.test(r),qe.ownLast="x"!=r[0],qe.spliceObjects=(ce.splice.call(t,0,1),!t[0]),qe.unindexedChars="xx"!="x"[0]+ae("x")[0];
|
33
|
+
try{qe.nodeClass=!(ve.call(document)==G&&!({toString:0}+""))}catch(o){qe.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:v}},Ae||(nt=function(){function n(){}return function(t){if(Ct(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var Ke=Ie?function(n,t){V.value=t,Ie(n,"__bindData__",V)}:Yt;qe.argsClass||(bt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&je.call(n,"callee")&&!ke.call(n,"callee")||false
|
34
|
+
});var We=De||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==L||false},Ge=ht({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Je=Pe?function(n){return Ct(n)?qe.enumPrototypes&&typeof n=="function"||qe.nonEnumArgs&&n.length&&bt(n)?Ge(n):Pe(n):[]}:Ge,Me={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Je,g:"if(e(t[n],n,g)===false)return E"},He={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:Je,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Ue={i:"if(!B[typeof t])return E;"+Me.i,b:false},Ve={"&":"&","<":"<",">":">",'"':""","'":"'"},Qe=jt(Ve),Xe=ie("("+Je(Qe).join("|")+")","g"),Ye=ie("["+Je(Ve).join("")+"]","g"),Ze=ht(Me),nr=ht(He,{i:He.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),tr=ht(He),er=ht(Me,Ue,{j:false}),rr=ht(Me,Ue);
|
35
|
+
xt(/x/)&&(xt=function(n){return typeof n=="function"&&ve.call(n)==K});var ur=we?function(n){if(!n||ve.call(n)!=G||!qe.argsClass&&bt(n))return false;var t=n.valueOf,e=typeof t=="function"&&(e=we(t))&&we(e);return e?n==e||we(n)==e:mt(n)}:mt,or=st(function(n,t,e){je.call(n,e)?n[e]++:n[e]=1}),ar=st(function(n,t,e){(je.call(n,e)?n[e]:n[e]=[]).push(t)}),ir=st(function(n,t,e){n[e]=t}),lr=Pt;Se&&(Vt=function(n){if(!xt(n))throw new fe;return Se.apply(e,arguments)});var fr=8==$e(j+"08")?$e:function(n,t){return $e(Et(n)?n.replace(D,""):n,t||0)
|
36
|
+
};return v.after=function(n,t){if(!xt(t))throw new fe;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=nr,v.at=function(n){var t=arguments,e=-1,r=it(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);for(qe.unindexedChars&&Et(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Ht,v.bindAll=function(n){for(var t=1<arguments.length?it(arguments,true,false,1):wt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=gt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?gt(t,19,s(arguments,2),null,n):gt(t,3,null,null,n)
|
37
|
+
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.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},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!xt(n[t]))throw new fe;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.countBy=or,v.create=function(n,t){var e=nt(n);return t?nr(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);if("object"!=r)return function(t){return t[n]
|
38
|
+
};var u=Je(n),o=u[0],a=n[o];return 1!=u.length||a!==a||Ct(a)?function(t){for(var e=u.length,r=false;e--&&(r=lt(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,gt(n,4,null,null,null,t)},v.debounce=Ut,v.defaults=tr,v.defer=Vt,v.delay=function(n,t){if(!xt(n))throw new fe;var e=s(arguments,2);return Ee(function(){n.apply(h,e)},t)},v.difference=function(n){return at(n,it(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Pt(n,e,r)),it(n,t)
|
39
|
+
},v.forEach=Nt,v.forEachRight=Bt,v.forIn=er,v.forInRight=function(n,t,e){var r=[];er(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=rr,v.forOwnRight=_t,v.functions=wt,v.groupBy=ar,v.indexBy=ir,v.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Fe(Re(0,u-r),u))},v.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,s=yt(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
|
40
|
+
l[a]=s===n&&(y?y.length:0)>=_&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):s(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):s(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&p(m);return c(l),c(v),h},v.invert=jt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=ne(typeof o=="number"?o:0);return Nt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=Je,v.map=Pt,v.max=Rt,v.memoize=function(n,t){if(!xt(n))throw new fe;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];
|
41
|
+
return je.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!Ct(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)ft(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];
|
42
|
+
i<o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];er(n,function(n,t){u.push(t)});for(var u=at(u,it(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!xt(n))throw new fe;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)
|
43
|
+
}},v.pairs=function(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},v.partial=function(n){return gt(n,16,s(arguments,1))},v.partialRight=function(n){return gt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=it(arguments,true,false,1),a=Ct(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=lr,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(Oe.call(n,o--,1),u--);
|
44
|
+
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Re(0,me((t-n)/(e||1)));for(var u=ne(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Oe.call(n,r--,1),u--);return o},v.rest=Kt,v.shuffle=Lt,v.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=ne(typeof o=="number"?o:0);
|
45
|
+
for(t=v.createCallback(t,e,3),Nt(n,function(n,e,u){var o=a[++r]=l();o.m=t(n,e,u),o.n=r,o.o=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.o,p(n);return a},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!xt(n))throw new fe;return false===e?r=false:Ct(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),U.leading=r,U.maxWait=t,U.trailing=u,Ut(n,t,U)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=ne(n);for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?qe.unindexedChars&&Et(n)?n.split(""):s(n):Ot(n)
|
46
|
+
},v.transform=function(n,t,e,r){var u=We(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Ze:rr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return pt(it(arguments,true,true))},v.uniq=Gt,v.values=Ot,v.where=At,v.without=function(n){return at(n,s(arguments,1))},v.wrap=function(n,t){return gt(t,16,[n])},v.zip=Jt,v.zipObject=Mt,v.collect=Pt,v.drop=Kt,v.each=Nt,v.eachRight=Bt,v.extend=nr,v.methods=wt,v.object=Mt,v.select=At,v.tail=Kt,v.unique=Gt,v.unzip=Jt,Xt(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))
|
47
|
+
},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=St,v.escape=function(n){return null==n?"":le(n).replace(Ye,vt)},v.every=It,v.find=Dt,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),rr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Bt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0
|
48
|
+
}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),_t(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?je.call(n,t):false},v.identity=Qt,v.indexOf=qt,v.isArguments=bt,v.isArray=We,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ve.call(n)==T||false},v.isDate=function(n){return n&&typeof n=="object"&&ve.call(n)==z||false
|
49
|
+
},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=ve.call(n),r=n.length;return e==L||e==M||(qe.argsClass?e==$:bt(n))||e==G&&typeof r=="number"&&xt(n.splice)?!r:(rr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return lt(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ne(n)&&!Be(parseFloat(n))},v.isFunction=xt,v.isNaN=function(n){return kt(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=kt,v.isObject=Ct,v.isPlainObject=ur,v.isRegExp=function(n){return n&&X[typeof n]&&ve.call(n)==J||false
|
50
|
+
},v.isString=Et,v.isUndefined=function(n){return typeof n=="undefined"},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Re(0,r+e):Fe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Xt,v.noConflict=function(){return e._=he,this},v.noop=Yt,v.parseInt=fr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Le(),Fe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t)
|
51
|
+
},v.reduce=Ft,v.reduceRight=$t,v.result=function(n,t){if(n){var e=n[t];return xt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Je(n).length},v.some=Tt,v.sortedIndex=Wt,v.template=function(n,t,e){var r=v.templateSettings;n=le(n||""),e=tr({},e,r);var u,o=tr({},e.imports,r.imports),r=Je(o),o=Ot(o),i=0,l=e.interpolate||N,f="__p+='",l=ie((e.escape||N).source+"|"+l.source+"|"+(l===A?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
|
52
|
+
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=re(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":le(n).replace(Xe,dt)},v.uniqueId=function(n){var t=++m;return le(null==n?"":n)+t
|
53
|
+
},v.all=It,v.any=Tt,v.detect=Dt,v.findWhere=Dt,v.foldl=Ft,v.foldr=$t,v.include=St,v.inject=Ft,rr(v,function(n,t){v.prototype[t]||(v.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return Ce.apply(t,arguments),t=n.apply(v,t),e?new y(t,e):t})}),v.first=zt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Re(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Ot(n):qe.unindexedChars&&Et(n)&&(n=n.split("")),null==t||e?n?n[ct(0,n.length-1)]:h:(n=Lt(n),n.length=Fe(Re(0,t),n.length),n)
|
54
|
+
},v.take=zt,v.head=zt,rr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.3.0",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return le(this.__wrapped__)},v.prototype.value=Zt,v.prototype.valueOf=Zt,Ze(["join","pop","shift"],function(n){var t=ce[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
55
|
+
return n?new y(e,n):e}}),Ze(["push","reverse","sort","unshift"],function(n){var t=ce[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(n){var t=ce[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),qe.spliceObjects||Ze(["pop","shift","splice"],function(n){var t=ce[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
|
56
|
+
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \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",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,I=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),$="[object Arguments]",L="[object Array]",T="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",H={};
|
57
|
+
H[K]=false,H[$]=H[L]=H[T]=H[z]=H[W]=H[G]=H[J]=H[M]=true;var U={leading:false,maxWait:0,trailing:false},V={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
|
58
|
+
!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
|
-
* Lo-Dash 2.
|
3
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
4
4
|
* Build: `lodash modern -o ./dist/lodash.js`
|
5
5
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
6
6
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
@@ -55,7 +55,7 @@
|
|
55
55
|
var reFlags = /\w*$/;
|
56
56
|
|
57
57
|
/** Used to detected named functions */
|
58
|
-
var reFuncName =
|
58
|
+
var reFuncName = /^\s*function[ \n\r\t]+\w/;
|
59
59
|
|
60
60
|
/** Used to match "interpolate" template delimiters */
|
61
61
|
var reInterpolate = /<%=([\s\S]+?)%>/g;
|
@@ -353,15 +353,6 @@
|
|
353
353
|
};
|
354
354
|
}
|
355
355
|
|
356
|
-
/**
|
357
|
-
* A no-operation function.
|
358
|
-
*
|
359
|
-
* @private
|
360
|
-
*/
|
361
|
-
function noop() {
|
362
|
-
// no operation performed
|
363
|
-
}
|
364
|
-
|
365
356
|
/**
|
366
357
|
* Releases the given array back to the array pool.
|
367
358
|
*
|
@@ -464,11 +455,14 @@
|
|
464
455
|
/** Used to restore the original `_` reference in `noConflict` */
|
465
456
|
var oldDash = context._;
|
466
457
|
|
458
|
+
/** Used to resolve the internal [[Class]] of values */
|
459
|
+
var toString = objectProto.toString;
|
460
|
+
|
467
461
|
/** Used to detect if a method is native */
|
468
462
|
var reNative = RegExp('^' +
|
469
|
-
String(
|
463
|
+
String(toString)
|
470
464
|
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
471
|
-
.replace(/
|
465
|
+
.replace(/toString| for [^\]]+/g, '.*?') + '$'
|
472
466
|
);
|
473
467
|
|
474
468
|
/** Native method shortcuts */
|
@@ -480,13 +474,16 @@
|
|
480
474
|
hasOwnProperty = objectProto.hasOwnProperty,
|
481
475
|
now = reNative.test(now = Date.now) && now || function() { return +new Date; },
|
482
476
|
push = arrayRef.push,
|
483
|
-
setImmediate = context.setImmediate,
|
484
477
|
setTimeout = context.setTimeout,
|
485
|
-
splice = arrayRef.splice
|
486
|
-
|
487
|
-
|
478
|
+
splice = arrayRef.splice;
|
479
|
+
|
480
|
+
/** Used to detect `setImmediate` in Node.js */
|
481
|
+
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
|
482
|
+
!reNative.test(setImmediate) && setImmediate;
|
488
483
|
|
484
|
+
/** Used to set meta data on functions */
|
489
485
|
var defineProperty = (function() {
|
486
|
+
// IE 8 only accepts DOM elements
|
490
487
|
try {
|
491
488
|
var o = {},
|
492
489
|
func = reNative.test(func = Object.defineProperty) && func,
|
@@ -496,8 +493,7 @@
|
|
496
493
|
}());
|
497
494
|
|
498
495
|
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
499
|
-
var
|
500
|
-
nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
|
496
|
+
var nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
|
501
497
|
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
502
498
|
nativeIsFinite = context.isFinite,
|
503
499
|
nativeIsNaN = context.isNaN,
|
@@ -505,12 +501,7 @@
|
|
505
501
|
nativeMax = Math.max,
|
506
502
|
nativeMin = Math.min,
|
507
503
|
nativeParseInt = context.parseInt,
|
508
|
-
nativeRandom = Math.random
|
509
|
-
nativeSlice = arrayRef.slice;
|
510
|
-
|
511
|
-
/** Detect various environments */
|
512
|
-
var isIeOpera = reNative.test(context.attachEvent),
|
513
|
-
isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
|
504
|
+
nativeRandom = Math.random;
|
514
505
|
|
515
506
|
/** Used to lookup a built-in constructor by [[Class]] */
|
516
507
|
var ctorByClass = {};
|
@@ -538,15 +529,16 @@
|
|
538
529
|
*
|
539
530
|
* The chainable wrapper functions are:
|
540
531
|
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
|
541
|
-
* `compose`, `concat`, `countBy`, `
|
542
|
-
* `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`,
|
543
|
-
* `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
|
544
|
-
* `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
|
545
|
-
* `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
|
546
|
-
* `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`,
|
547
|
-
* `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`,
|
548
|
-
* `
|
549
|
-
* `unzip`, `values`, `where`, `without`, `wrap`,
|
532
|
+
* `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`,
|
533
|
+
* `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`,
|
534
|
+
* `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
|
535
|
+
* `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
|
536
|
+
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
|
537
|
+
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`,
|
538
|
+
* `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`,
|
539
|
+
* `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`,
|
540
|
+
* `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`,
|
541
|
+
* and `zip`
|
550
542
|
*
|
551
543
|
* The non-chainable wrapper functions are:
|
552
544
|
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`,
|
@@ -620,14 +612,6 @@
|
|
620
612
|
*/
|
621
613
|
var support = lodash.support = {};
|
622
614
|
|
623
|
-
/**
|
624
|
-
* Detect if `Function#bind` exists and is inferred to be fast (all but V8).
|
625
|
-
*
|
626
|
-
* @memberOf _.support
|
627
|
-
* @type boolean
|
628
|
-
*/
|
629
|
-
support.fastBind = nativeBind && !isV8;
|
630
|
-
|
631
615
|
/**
|
632
616
|
* Detect if functions can be decompiled by `Function#toString`
|
633
617
|
* (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).
|
@@ -708,19 +692,53 @@
|
|
708
692
|
|
709
693
|
/*--------------------------------------------------------------------------*/
|
710
694
|
|
695
|
+
/**
|
696
|
+
* The base implementation of `_.bind` that creates the bound function and
|
697
|
+
* sets its meta data.
|
698
|
+
*
|
699
|
+
* @private
|
700
|
+
* @param {Array} bindData The bind data array.
|
701
|
+
* @returns {Function} Returns the new bound function.
|
702
|
+
*/
|
703
|
+
function baseBind(bindData) {
|
704
|
+
var func = bindData[0],
|
705
|
+
partialArgs = bindData[2],
|
706
|
+
thisArg = bindData[4];
|
707
|
+
|
708
|
+
function bound() {
|
709
|
+
// `Function#bind` spec
|
710
|
+
// http://es5.github.io/#x15.3.4.5
|
711
|
+
if (partialArgs) {
|
712
|
+
var args = partialArgs.slice();
|
713
|
+
push.apply(args, arguments);
|
714
|
+
}
|
715
|
+
// mimic the constructor's `return` behavior
|
716
|
+
// http://es5.github.io/#x13.2.2
|
717
|
+
if (this instanceof bound) {
|
718
|
+
// ensure `new bound` is an instance of `func`
|
719
|
+
var thisBinding = baseCreate(func.prototype),
|
720
|
+
result = func.apply(thisBinding, args || arguments);
|
721
|
+
return isObject(result) ? result : thisBinding;
|
722
|
+
}
|
723
|
+
return func.apply(thisArg, args || arguments);
|
724
|
+
}
|
725
|
+
setBindData(bound, bindData);
|
726
|
+
return bound;
|
727
|
+
}
|
728
|
+
|
711
729
|
/**
|
712
730
|
* The base implementation of `_.clone` without argument juggling or support
|
713
731
|
* for `thisArg` binding.
|
714
732
|
*
|
715
733
|
* @private
|
716
734
|
* @param {*} value The value to clone.
|
717
|
-
* @param {boolean} [
|
735
|
+
* @param {boolean} [isDeep=false] Specify a deep clone.
|
718
736
|
* @param {Function} [callback] The function to customize cloning values.
|
719
737
|
* @param {Array} [stackA=[]] Tracks traversed source objects.
|
720
738
|
* @param {Array} [stackB=[]] Associates clones with source counterparts.
|
721
739
|
* @returns {*} Returns the cloned value.
|
722
740
|
*/
|
723
|
-
function baseClone(value,
|
741
|
+
function baseClone(value, isDeep, callback, stackA, stackB) {
|
724
742
|
if (callback) {
|
725
743
|
var result = callback(value);
|
726
744
|
if (typeof result != 'undefined') {
|
@@ -753,7 +771,7 @@
|
|
753
771
|
return value;
|
754
772
|
}
|
755
773
|
var isArr = isArray(value);
|
756
|
-
if (
|
774
|
+
if (isDeep) {
|
757
775
|
// check for circular references and return corresponding clone
|
758
776
|
var initedStack = !stackA;
|
759
777
|
stackA || (stackA = getArray());
|
@@ -780,7 +798,7 @@
|
|
780
798
|
}
|
781
799
|
}
|
782
800
|
// exit for shallow clone
|
783
|
-
if (!
|
801
|
+
if (!isDeep) {
|
784
802
|
return result;
|
785
803
|
}
|
786
804
|
// add the source value to the stack of traversed objects
|
@@ -790,7 +808,7 @@
|
|
790
808
|
|
791
809
|
// recursively populate clone (susceptible to call stack limits)
|
792
810
|
(isArr ? forEach : forOwn)(value, function(objValue, key) {
|
793
|
-
result[key] = baseClone(objValue,
|
811
|
+
result[key] = baseClone(objValue, isDeep, callback, stackA, stackB);
|
794
812
|
});
|
795
813
|
|
796
814
|
if (initedStack) {
|
@@ -800,6 +818,32 @@
|
|
800
818
|
return result;
|
801
819
|
}
|
802
820
|
|
821
|
+
/**
|
822
|
+
* The base implementation of `_.create` without support for assigning
|
823
|
+
* properties to the created object.
|
824
|
+
*
|
825
|
+
* @private
|
826
|
+
* @param {Object} prototype The object to inherit from.
|
827
|
+
* @returns {Object} Returns the new object.
|
828
|
+
*/
|
829
|
+
function baseCreate(prototype, properties) {
|
830
|
+
return isObject(prototype) ? nativeCreate(prototype) : {};
|
831
|
+
}
|
832
|
+
// fallback for browsers without `Object.create`
|
833
|
+
if (!nativeCreate) {
|
834
|
+
baseCreate = (function() {
|
835
|
+
function Object() {}
|
836
|
+
return function(prototype) {
|
837
|
+
if (isObject(prototype)) {
|
838
|
+
Object.prototype = prototype;
|
839
|
+
var result = new Object;
|
840
|
+
Object.prototype = null;
|
841
|
+
}
|
842
|
+
return result || context.Object();
|
843
|
+
};
|
844
|
+
}());
|
845
|
+
}
|
846
|
+
|
803
847
|
/**
|
804
848
|
* The base implementation of `_.createCallback` without support for creating
|
805
849
|
* "_.pluck" or "_.where" style callbacks.
|
@@ -814,24 +858,30 @@
|
|
814
858
|
if (typeof func != 'function') {
|
815
859
|
return identity;
|
816
860
|
}
|
817
|
-
// exit early
|
818
|
-
if (typeof thisArg == 'undefined') {
|
861
|
+
// exit early for no `thisArg` or already bound by `Function#bind`
|
862
|
+
if (typeof thisArg == 'undefined' || !('prototype' in func)) {
|
819
863
|
return func;
|
820
864
|
}
|
821
|
-
var bindData = func.__bindData__
|
865
|
+
var bindData = func.__bindData__;
|
822
866
|
if (typeof bindData == 'undefined') {
|
823
|
-
|
824
|
-
|
825
|
-
bindData = true;
|
867
|
+
if (support.funcNames) {
|
868
|
+
bindData = !func.name;
|
826
869
|
}
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
870
|
+
bindData = bindData || !support.funcDecomp;
|
871
|
+
if (!bindData) {
|
872
|
+
var source = fnToString.call(func);
|
873
|
+
if (!support.funcNames) {
|
874
|
+
bindData = !reFuncName.test(source);
|
875
|
+
}
|
876
|
+
if (!bindData) {
|
877
|
+
// checks if `func` references the `this` keyword and stores the result
|
878
|
+
bindData = reThis.test(source);
|
879
|
+
setBindData(func, bindData);
|
880
|
+
}
|
831
881
|
}
|
832
882
|
}
|
833
883
|
// exit early if there are no `this` references or `func` is bound
|
834
|
-
if (bindData
|
884
|
+
if (bindData === false || (bindData !== true && bindData[1] & 1)) {
|
835
885
|
return func;
|
836
886
|
}
|
837
887
|
switch (argCount) {
|
@@ -851,6 +901,96 @@
|
|
851
901
|
return bind(func, thisArg);
|
852
902
|
}
|
853
903
|
|
904
|
+
/**
|
905
|
+
* The base implementation of `createWrapper` that creates the wrapper and
|
906
|
+
* sets its meta data.
|
907
|
+
*
|
908
|
+
* @private
|
909
|
+
* @param {Array} bindData The bind data array.
|
910
|
+
* @returns {Function} Returns the new function.
|
911
|
+
*/
|
912
|
+
function baseCreateWrapper(bindData) {
|
913
|
+
var func = bindData[0],
|
914
|
+
bitmask = bindData[1],
|
915
|
+
partialArgs = bindData[2],
|
916
|
+
partialRightArgs = bindData[3],
|
917
|
+
thisArg = bindData[4],
|
918
|
+
arity = bindData[5];
|
919
|
+
|
920
|
+
var isBind = bitmask & 1,
|
921
|
+
isBindKey = bitmask & 2,
|
922
|
+
isCurry = bitmask & 4,
|
923
|
+
isCurryBound = bitmask & 8,
|
924
|
+
key = func;
|
925
|
+
|
926
|
+
function bound() {
|
927
|
+
var thisBinding = isBind ? thisArg : this;
|
928
|
+
if (partialArgs) {
|
929
|
+
var args = partialArgs.slice();
|
930
|
+
push.apply(args, arguments);
|
931
|
+
}
|
932
|
+
if (partialRightArgs || isCurry) {
|
933
|
+
args || (args = slice(arguments));
|
934
|
+
if (partialRightArgs) {
|
935
|
+
push.apply(args, partialRightArgs);
|
936
|
+
}
|
937
|
+
if (isCurry && args.length < arity) {
|
938
|
+
bitmask |= 16 & ~32;
|
939
|
+
return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
|
940
|
+
}
|
941
|
+
}
|
942
|
+
args || (args = arguments);
|
943
|
+
if (isBindKey) {
|
944
|
+
func = thisBinding[key];
|
945
|
+
}
|
946
|
+
if (this instanceof bound) {
|
947
|
+
thisBinding = baseCreate(func.prototype);
|
948
|
+
var result = func.apply(thisBinding, args);
|
949
|
+
return isObject(result) ? result : thisBinding;
|
950
|
+
}
|
951
|
+
return func.apply(thisBinding, args);
|
952
|
+
}
|
953
|
+
setBindData(bound, bindData);
|
954
|
+
return bound;
|
955
|
+
}
|
956
|
+
|
957
|
+
/**
|
958
|
+
* The base implementation of `_.difference` that accepts a single array
|
959
|
+
* of values to exclude.
|
960
|
+
*
|
961
|
+
* @private
|
962
|
+
* @param {Array} array The array to process.
|
963
|
+
* @param {Array} [values] The array of values to exclude.
|
964
|
+
* @returns {Array} Returns a new array of filtered values.
|
965
|
+
*/
|
966
|
+
function baseDifference(array, values) {
|
967
|
+
var index = -1,
|
968
|
+
indexOf = getIndexOf(),
|
969
|
+
length = array ? array.length : 0,
|
970
|
+
isLarge = length >= largeArraySize && indexOf === baseIndexOf,
|
971
|
+
result = [];
|
972
|
+
|
973
|
+
if (isLarge) {
|
974
|
+
var cache = createCache(values);
|
975
|
+
if (cache) {
|
976
|
+
indexOf = cacheIndexOf;
|
977
|
+
values = cache;
|
978
|
+
} else {
|
979
|
+
isLarge = false;
|
980
|
+
}
|
981
|
+
}
|
982
|
+
while (++index < length) {
|
983
|
+
var value = array[index];
|
984
|
+
if (indexOf(values, value) < 0) {
|
985
|
+
result.push(value);
|
986
|
+
}
|
987
|
+
}
|
988
|
+
if (isLarge) {
|
989
|
+
releaseObject(values);
|
990
|
+
}
|
991
|
+
return result;
|
992
|
+
}
|
993
|
+
|
854
994
|
/**
|
855
995
|
* The base implementation of `_.flatten` without support for callback
|
856
996
|
* shorthands or `thisArg` binding.
|
@@ -858,11 +998,11 @@
|
|
858
998
|
* @private
|
859
999
|
* @param {Array} array The array to flatten.
|
860
1000
|
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
|
861
|
-
* @param {boolean} [
|
1001
|
+
* @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects.
|
862
1002
|
* @param {number} [fromIndex=0] The index to start from.
|
863
1003
|
* @returns {Array} Returns a new flattened array.
|
864
1004
|
*/
|
865
|
-
function baseFlatten(array, isShallow,
|
1005
|
+
function baseFlatten(array, isShallow, isStrict, fromIndex) {
|
866
1006
|
var index = (fromIndex || 0) - 1,
|
867
1007
|
length = array ? array.length : 0,
|
868
1008
|
result = [];
|
@@ -874,7 +1014,7 @@
|
|
874
1014
|
&& (isArray(value) || isArguments(value))) {
|
875
1015
|
// recursively flatten arrays (susceptible to call stack limits)
|
876
1016
|
if (!isShallow) {
|
877
|
-
value = baseFlatten(value, isShallow,
|
1017
|
+
value = baseFlatten(value, isShallow, isStrict);
|
878
1018
|
}
|
879
1019
|
var valIndex = -1,
|
880
1020
|
valLength = value.length,
|
@@ -884,7 +1024,7 @@
|
|
884
1024
|
while (++valIndex < valLength) {
|
885
1025
|
result[resIndex++] = value[valIndex];
|
886
1026
|
}
|
887
|
-
} else if (!
|
1027
|
+
} else if (!isStrict) {
|
888
1028
|
result.push(value);
|
889
1029
|
}
|
890
1030
|
}
|
@@ -967,8 +1107,11 @@
|
|
967
1107
|
var isArr = className == arrayClass;
|
968
1108
|
if (!isArr) {
|
969
1109
|
// unwrap any `lodash` wrapped values
|
970
|
-
|
971
|
-
|
1110
|
+
var aWrapped = hasOwnProperty.call(a, '__wrapped__'),
|
1111
|
+
bWrapped = hasOwnProperty.call(b, '__wrapped__');
|
1112
|
+
|
1113
|
+
if (aWrapped || bWrapped) {
|
1114
|
+
return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB);
|
972
1115
|
}
|
973
1116
|
// exit for functions and DOM nodes
|
974
1117
|
if (className != objectClass) {
|
@@ -979,10 +1122,10 @@
|
|
979
1122
|
ctorB = b.constructor;
|
980
1123
|
|
981
1124
|
// non `Object` object instances with different constructors are not equal
|
982
|
-
if (ctorA != ctorB &&
|
983
|
-
isFunction(ctorA) && ctorA instanceof ctorA &&
|
984
|
-
|
985
|
-
)
|
1125
|
+
if (ctorA != ctorB &&
|
1126
|
+
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
|
1127
|
+
('constructor' in a && 'constructor' in b)
|
1128
|
+
) {
|
986
1129
|
return false;
|
987
1130
|
}
|
988
1131
|
}
|
@@ -1125,6 +1268,19 @@
|
|
1125
1268
|
});
|
1126
1269
|
}
|
1127
1270
|
|
1271
|
+
/**
|
1272
|
+
* The base implementation of `_.random` without argument juggling or support
|
1273
|
+
* for returning floating-point numbers.
|
1274
|
+
*
|
1275
|
+
* @private
|
1276
|
+
* @param {number} min The minimum possible value.
|
1277
|
+
* @param {number} max The maximum possible value.
|
1278
|
+
* @returns {number} Returns a random number.
|
1279
|
+
*/
|
1280
|
+
function baseRandom(min, max) {
|
1281
|
+
return min + floor(nativeRandom() * (max - min + 1));
|
1282
|
+
}
|
1283
|
+
|
1128
1284
|
/**
|
1129
1285
|
* The base implementation of `_.uniq` without support for callback shorthands
|
1130
1286
|
* or `thisArg` binding.
|
@@ -1229,16 +1385,15 @@
|
|
1229
1385
|
* provided to the new function.
|
1230
1386
|
* @param {*} [thisArg] The `this` binding of `func`.
|
1231
1387
|
* @param {number} [arity] The arity of `func`.
|
1232
|
-
* @returns {Function} Returns the new
|
1388
|
+
* @returns {Function} Returns the new function.
|
1233
1389
|
*/
|
1234
|
-
function
|
1390
|
+
function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
|
1235
1391
|
var isBind = bitmask & 1,
|
1236
1392
|
isBindKey = bitmask & 2,
|
1237
1393
|
isCurry = bitmask & 4,
|
1238
1394
|
isCurryBound = bitmask & 8,
|
1239
1395
|
isPartial = bitmask & 16,
|
1240
|
-
isPartialRight = bitmask & 32
|
1241
|
-
key = func;
|
1396
|
+
isPartialRight = bitmask & 32;
|
1242
1397
|
|
1243
1398
|
if (!isBindKey && !isFunction(func)) {
|
1244
1399
|
throw new TypeError;
|
@@ -1252,96 +1407,36 @@
|
|
1252
1407
|
isPartialRight = partialRightArgs = false;
|
1253
1408
|
}
|
1254
1409
|
var bindData = func && func.__bindData__;
|
1255
|
-
if (bindData) {
|
1410
|
+
if (bindData && bindData !== true) {
|
1411
|
+
bindData = bindData.slice();
|
1412
|
+
|
1413
|
+
// set `thisBinding` is not previously bound
|
1256
1414
|
if (isBind && !(bindData[1] & 1)) {
|
1257
1415
|
bindData[4] = thisArg;
|
1258
1416
|
}
|
1417
|
+
// set if previously bound but not currently (subsequent curried functions)
|
1259
1418
|
if (!isBind && bindData[1] & 1) {
|
1260
1419
|
bitmask |= 8;
|
1261
1420
|
}
|
1421
|
+
// set curried arity if not yet set
|
1262
1422
|
if (isCurry && !(bindData[1] & 4)) {
|
1263
1423
|
bindData[5] = arity;
|
1264
1424
|
}
|
1425
|
+
// append partial left arguments
|
1265
1426
|
if (isPartial) {
|
1266
1427
|
push.apply(bindData[2] || (bindData[2] = []), partialArgs);
|
1267
1428
|
}
|
1429
|
+
// append partial right arguments
|
1268
1430
|
if (isPartialRight) {
|
1269
1431
|
push.apply(bindData[3] || (bindData[3] = []), partialRightArgs);
|
1270
1432
|
}
|
1433
|
+
// merge flags
|
1271
1434
|
bindData[1] |= bitmask;
|
1272
|
-
return
|
1273
|
-
}
|
1274
|
-
// use `Function#bind` if it exists and is fast
|
1275
|
-
// (in V8 `Function#bind` is slower except when partially applied)
|
1276
|
-
if (isBind && !(isBindKey || isCurry || isPartialRight) &&
|
1277
|
-
(support.fastBind || (nativeBind && isPartial))) {
|
1278
|
-
if (isPartial) {
|
1279
|
-
var args = [thisArg];
|
1280
|
-
push.apply(args, partialArgs);
|
1281
|
-
}
|
1282
|
-
var bound = isPartial
|
1283
|
-
? nativeBind.apply(func, args)
|
1284
|
-
: nativeBind.call(func, thisArg);
|
1285
|
-
}
|
1286
|
-
else {
|
1287
|
-
bound = function() {
|
1288
|
-
// `Function#bind` spec
|
1289
|
-
// http://es5.github.io/#x15.3.4.5
|
1290
|
-
var args = arguments,
|
1291
|
-
thisBinding = isBind ? thisArg : this;
|
1292
|
-
|
1293
|
-
if (isCurry || isPartial || isPartialRight) {
|
1294
|
-
args = nativeSlice.call(args);
|
1295
|
-
if (isPartial) {
|
1296
|
-
unshift.apply(args, partialArgs);
|
1297
|
-
}
|
1298
|
-
if (isPartialRight) {
|
1299
|
-
push.apply(args, partialRightArgs);
|
1300
|
-
}
|
1301
|
-
if (isCurry && args.length < arity) {
|
1302
|
-
bitmask |= 16 & ~32;
|
1303
|
-
return createBound(func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity);
|
1304
|
-
}
|
1305
|
-
}
|
1306
|
-
if (isBindKey) {
|
1307
|
-
func = thisBinding[key];
|
1308
|
-
}
|
1309
|
-
if (this instanceof bound) {
|
1310
|
-
// ensure `new bound` is an instance of `func`
|
1311
|
-
thisBinding = createObject(func.prototype);
|
1312
|
-
|
1313
|
-
// mimic the constructor's `return` behavior
|
1314
|
-
// http://es5.github.io/#x13.2.2
|
1315
|
-
var result = func.apply(thisBinding, args);
|
1316
|
-
return isObject(result) ? result : thisBinding;
|
1317
|
-
}
|
1318
|
-
return func.apply(thisBinding, args);
|
1319
|
-
};
|
1435
|
+
return createWrapper.apply(null, bindData);
|
1320
1436
|
}
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
/**
|
1326
|
-
* Creates a new object with the specified `prototype`.
|
1327
|
-
*
|
1328
|
-
* @private
|
1329
|
-
* @param {Object} prototype The prototype object.
|
1330
|
-
* @returns {Object} Returns the new object.
|
1331
|
-
*/
|
1332
|
-
function createObject(prototype) {
|
1333
|
-
return isObject(prototype) ? nativeCreate(prototype) : {};
|
1334
|
-
}
|
1335
|
-
// fallback for browsers without `Object.create`
|
1336
|
-
if (!nativeCreate) {
|
1337
|
-
createObject = function(prototype) {
|
1338
|
-
if (isObject(prototype)) {
|
1339
|
-
noop.prototype = prototype;
|
1340
|
-
var result = new noop;
|
1341
|
-
noop.prototype = null;
|
1342
|
-
}
|
1343
|
-
return result || {};
|
1344
|
-
};
|
1437
|
+
// fast path for `_.bind`
|
1438
|
+
var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper;
|
1439
|
+
return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]);
|
1345
1440
|
}
|
1346
1441
|
|
1347
1442
|
/**
|
@@ -1373,7 +1468,7 @@
|
|
1373
1468
|
*
|
1374
1469
|
* @private
|
1375
1470
|
* @param {Function} func The function to set data on.
|
1376
|
-
* @param {
|
1471
|
+
* @param {Array} value The data array to set.
|
1377
1472
|
*/
|
1378
1473
|
var setBindData = !defineProperty ? noop : function(func, value) {
|
1379
1474
|
descriptor.value = value;
|
@@ -1549,16 +1644,16 @@
|
|
1549
1644
|
* @returns {Object} Returns the destination object.
|
1550
1645
|
* @example
|
1551
1646
|
*
|
1552
|
-
* _.assign({ 'name': '
|
1553
|
-
* // => { 'name': '
|
1647
|
+
* _.assign({ 'name': 'fred' }, { 'employer': 'slate' });
|
1648
|
+
* // => { 'name': 'fred', 'employer': 'slate' }
|
1554
1649
|
*
|
1555
1650
|
* var defaults = _.partialRight(_.assign, function(a, b) {
|
1556
1651
|
* return typeof a == 'undefined' ? b : a;
|
1557
1652
|
* });
|
1558
1653
|
*
|
1559
|
-
* var
|
1560
|
-
* defaults(
|
1561
|
-
* // => { 'name': '
|
1654
|
+
* var object = { 'name': 'barney' };
|
1655
|
+
* defaults(object, { 'name': 'fred', 'employer': 'slate' });
|
1656
|
+
* // => { 'name': 'barney', 'employer': 'slate' }
|
1562
1657
|
*/
|
1563
1658
|
var assign = function(object, source, guard) {
|
1564
1659
|
var index, iterable = object, result = iterable;
|
@@ -1588,7 +1683,7 @@
|
|
1588
1683
|
};
|
1589
1684
|
|
1590
1685
|
/**
|
1591
|
-
* Creates a clone of `value`. If `
|
1686
|
+
* Creates a clone of `value`. If `isDeep` is `true` nested objects will also
|
1592
1687
|
* be cloned, otherwise they will be assigned by reference. If a callback
|
1593
1688
|
* is provided it will be executed to produce the cloned values. If the
|
1594
1689
|
* callback returns `undefined` cloning will be handled by the method instead.
|
@@ -1598,23 +1693,23 @@
|
|
1598
1693
|
* @memberOf _
|
1599
1694
|
* @category Objects
|
1600
1695
|
* @param {*} value The value to clone.
|
1601
|
-
* @param {boolean} [
|
1696
|
+
* @param {boolean} [isDeep=false] Specify a deep clone.
|
1602
1697
|
* @param {Function} [callback] The function to customize cloning values.
|
1603
1698
|
* @param {*} [thisArg] The `this` binding of `callback`.
|
1604
1699
|
* @returns {*} Returns the cloned value.
|
1605
1700
|
* @example
|
1606
1701
|
*
|
1607
|
-
* var
|
1608
|
-
* { 'name': '
|
1609
|
-
* { 'name': '
|
1702
|
+
* var characters = [
|
1703
|
+
* { 'name': 'barney', 'age': 36 },
|
1704
|
+
* { 'name': 'fred', 'age': 40 }
|
1610
1705
|
* ];
|
1611
1706
|
*
|
1612
|
-
* var shallow = _.clone(
|
1613
|
-
* shallow[0] ===
|
1707
|
+
* var shallow = _.clone(characters);
|
1708
|
+
* shallow[0] === characters[0];
|
1614
1709
|
* // => true
|
1615
1710
|
*
|
1616
|
-
* var deep = _.clone(
|
1617
|
-
* deep[0] ===
|
1711
|
+
* var deep = _.clone(characters, true);
|
1712
|
+
* deep[0] === characters[0];
|
1618
1713
|
* // => false
|
1619
1714
|
*
|
1620
1715
|
* _.mixin({
|
@@ -1627,15 +1722,15 @@
|
|
1627
1722
|
* clone.childNodes.length;
|
1628
1723
|
* // => 0
|
1629
1724
|
*/
|
1630
|
-
function clone(value,
|
1725
|
+
function clone(value, isDeep, callback, thisArg) {
|
1631
1726
|
// allows working with "Collections" methods without using their `index`
|
1632
|
-
// and `collection` arguments for `
|
1633
|
-
if (typeof
|
1727
|
+
// and `collection` arguments for `isDeep` and `callback`
|
1728
|
+
if (typeof isDeep != 'boolean' && isDeep != null) {
|
1634
1729
|
thisArg = callback;
|
1635
|
-
callback =
|
1636
|
-
|
1730
|
+
callback = isDeep;
|
1731
|
+
isDeep = false;
|
1637
1732
|
}
|
1638
|
-
return baseClone(value,
|
1733
|
+
return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
|
1639
1734
|
}
|
1640
1735
|
|
1641
1736
|
/**
|
@@ -1658,13 +1753,13 @@
|
|
1658
1753
|
* @returns {*} Returns the deep cloned value.
|
1659
1754
|
* @example
|
1660
1755
|
*
|
1661
|
-
* var
|
1662
|
-
* { 'name': '
|
1663
|
-
* { 'name': '
|
1756
|
+
* var characters = [
|
1757
|
+
* { 'name': 'barney', 'age': 36 },
|
1758
|
+
* { 'name': 'fred', 'age': 40 }
|
1664
1759
|
* ];
|
1665
1760
|
*
|
1666
|
-
* var deep = _.cloneDeep(
|
1667
|
-
* deep[0] ===
|
1761
|
+
* var deep = _.cloneDeep(characters);
|
1762
|
+
* deep[0] === characters[0];
|
1668
1763
|
* // => false
|
1669
1764
|
*
|
1670
1765
|
* var view = {
|
@@ -1683,6 +1778,42 @@
|
|
1683
1778
|
return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
|
1684
1779
|
}
|
1685
1780
|
|
1781
|
+
/**
|
1782
|
+
* Creates an object that inherits from the given `prototype` object. If a
|
1783
|
+
* `properties` object is provided its own enumerable properties are assigned
|
1784
|
+
* to the created object.
|
1785
|
+
*
|
1786
|
+
* @static
|
1787
|
+
* @memberOf _
|
1788
|
+
* @category Objects
|
1789
|
+
* @param {Object} prototype The object to inherit from.
|
1790
|
+
* @param {Object} [properties] The properties to assign to the object.
|
1791
|
+
* @returns {Object} Returns the new object.
|
1792
|
+
* @example
|
1793
|
+
*
|
1794
|
+
* function Shape() {
|
1795
|
+
* this.x = 0;
|
1796
|
+
* this.y = 0;
|
1797
|
+
* }
|
1798
|
+
*
|
1799
|
+
* function Circle() {
|
1800
|
+
* Shape.call(this);
|
1801
|
+
* }
|
1802
|
+
*
|
1803
|
+
* Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
|
1804
|
+
*
|
1805
|
+
* var circle = new Circle;
|
1806
|
+
* circle instanceof Circle;
|
1807
|
+
* // => true
|
1808
|
+
*
|
1809
|
+
* circle instanceof Shape;
|
1810
|
+
* // => true
|
1811
|
+
*/
|
1812
|
+
function create(prototype, properties) {
|
1813
|
+
var result = baseCreate(prototype);
|
1814
|
+
return properties ? assign(result, properties) : result;
|
1815
|
+
}
|
1816
|
+
|
1686
1817
|
/**
|
1687
1818
|
* Assigns own enumerable properties of source object(s) to the destination
|
1688
1819
|
* object for all destination properties that resolve to `undefined`. Once a
|
@@ -1699,9 +1830,9 @@
|
|
1699
1830
|
* @returns {Object} Returns the destination object.
|
1700
1831
|
* @example
|
1701
1832
|
*
|
1702
|
-
* var
|
1703
|
-
* _.defaults(
|
1704
|
-
* // => { 'name': '
|
1833
|
+
* var object = { 'name': 'barney' };
|
1834
|
+
* _.defaults(object, { 'name': 'fred', 'employer': 'slate' });
|
1835
|
+
* // => { 'name': 'barney', 'employer': 'slate' }
|
1705
1836
|
*/
|
1706
1837
|
var defaults = function(object, source, guard) {
|
1707
1838
|
var index, iterable = object, result = iterable;
|
@@ -1729,6 +1860,13 @@
|
|
1729
1860
|
* This method is like `_.findIndex` except that it returns the key of the
|
1730
1861
|
* first element that passes the callback check, instead of the element itself.
|
1731
1862
|
*
|
1863
|
+
* If a property name is provided for `callback` the created "_.pluck" style
|
1864
|
+
* callback will return the property value of the given element.
|
1865
|
+
*
|
1866
|
+
* If an object is provided for `callback` the created "_.where" style callback
|
1867
|
+
* will return `true` for elements that have the properties of the given object,
|
1868
|
+
* else `false`.
|
1869
|
+
*
|
1732
1870
|
* @static
|
1733
1871
|
* @memberOf _
|
1734
1872
|
* @category Objects
|
@@ -1740,10 +1878,24 @@
|
|
1740
1878
|
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
|
1741
1879
|
* @example
|
1742
1880
|
*
|
1743
|
-
*
|
1744
|
-
*
|
1881
|
+
* var characters = {
|
1882
|
+
* 'barney': { 'age': 36, 'blocked': false },
|
1883
|
+
* 'fred': { 'age': 40, 'blocked': true },
|
1884
|
+
* 'pebbles': { 'age': 1, 'blocked': false }
|
1885
|
+
* };
|
1886
|
+
*
|
1887
|
+
* _.findKey(characters, function(chr) {
|
1888
|
+
* return chr.age < 40;
|
1745
1889
|
* });
|
1746
|
-
* // => '
|
1890
|
+
* // => 'barney' (property order is not guaranteed across environments)
|
1891
|
+
*
|
1892
|
+
* // using "_.where" callback shorthand
|
1893
|
+
* _.findKey(characters, { 'age': 1 });
|
1894
|
+
* // => 'pebbles'
|
1895
|
+
*
|
1896
|
+
* // using "_.pluck" callback shorthand
|
1897
|
+
* _.findKey(characters, 'blocked');
|
1898
|
+
* // => 'fred'
|
1747
1899
|
*/
|
1748
1900
|
function findKey(object, callback, thisArg) {
|
1749
1901
|
var result;
|
@@ -1761,6 +1913,13 @@
|
|
1761
1913
|
* This method is like `_.findKey` except that it iterates over elements
|
1762
1914
|
* of a `collection` in the opposite order.
|
1763
1915
|
*
|
1916
|
+
* If a property name is provided for `callback` the created "_.pluck" style
|
1917
|
+
* callback will return the property value of the given element.
|
1918
|
+
*
|
1919
|
+
* If an object is provided for `callback` the created "_.where" style callback
|
1920
|
+
* will return `true` for elements that have the properties of the given object,
|
1921
|
+
* else `false`.
|
1922
|
+
*
|
1764
1923
|
* @static
|
1765
1924
|
* @memberOf _
|
1766
1925
|
* @category Objects
|
@@ -1772,10 +1931,24 @@
|
|
1772
1931
|
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
|
1773
1932
|
* @example
|
1774
1933
|
*
|
1775
|
-
*
|
1776
|
-
*
|
1934
|
+
* var characters = {
|
1935
|
+
* 'barney': { 'age': 36, 'blocked': true },
|
1936
|
+
* 'fred': { 'age': 40, 'blocked': false },
|
1937
|
+
* 'pebbles': { 'age': 1, 'blocked': true }
|
1938
|
+
* };
|
1939
|
+
*
|
1940
|
+
* _.findLastKey(characters, function(chr) {
|
1941
|
+
* return chr.age < 40;
|
1777
1942
|
* });
|
1778
|
-
* // => returns `
|
1943
|
+
* // => returns `pebbles`, assuming `_.findKey` returns `barney`
|
1944
|
+
*
|
1945
|
+
* // using "_.where" callback shorthand
|
1946
|
+
* _.findLastKey(characters, { 'age': 40 });
|
1947
|
+
* // => 'fred'
|
1948
|
+
*
|
1949
|
+
* // using "_.pluck" callback shorthand
|
1950
|
+
* _.findLastKey(characters, 'blocked');
|
1951
|
+
* // => 'pebbles'
|
1779
1952
|
*/
|
1780
1953
|
function findLastKey(object, callback, thisArg) {
|
1781
1954
|
var result;
|
@@ -1805,18 +1978,20 @@
|
|
1805
1978
|
* @returns {Object} Returns `object`.
|
1806
1979
|
* @example
|
1807
1980
|
*
|
1808
|
-
* function
|
1809
|
-
* this.
|
1981
|
+
* function Shape() {
|
1982
|
+
* this.x = 0;
|
1983
|
+
* this.y = 0;
|
1810
1984
|
* }
|
1811
1985
|
*
|
1812
|
-
*
|
1813
|
-
*
|
1986
|
+
* Shape.prototype.move = function(x, y) {
|
1987
|
+
* this.x += x;
|
1988
|
+
* this.y += y;
|
1814
1989
|
* };
|
1815
1990
|
*
|
1816
|
-
* _.forIn(new
|
1991
|
+
* _.forIn(new Shape, function(value, key) {
|
1817
1992
|
* console.log(key);
|
1818
1993
|
* });
|
1819
|
-
* // => logs '
|
1994
|
+
* // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments)
|
1820
1995
|
*/
|
1821
1996
|
var forIn = function(collection, callback, thisArg) {
|
1822
1997
|
var index, iterable = collection, result = iterable;
|
@@ -1842,18 +2017,20 @@
|
|
1842
2017
|
* @returns {Object} Returns `object`.
|
1843
2018
|
* @example
|
1844
2019
|
*
|
1845
|
-
* function
|
1846
|
-
* this.
|
2020
|
+
* function Shape() {
|
2021
|
+
* this.x = 0;
|
2022
|
+
* this.y = 0;
|
1847
2023
|
* }
|
1848
2024
|
*
|
1849
|
-
*
|
1850
|
-
*
|
2025
|
+
* Shape.prototype.move = function(x, y) {
|
2026
|
+
* this.x += x;
|
2027
|
+
* this.y += y;
|
1851
2028
|
* };
|
1852
2029
|
*
|
1853
|
-
* _.forInRight(new
|
2030
|
+
* _.forInRight(new Shape, function(value, key) {
|
1854
2031
|
* console.log(key);
|
1855
2032
|
* });
|
1856
|
-
* // => logs '
|
2033
|
+
* // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move'
|
1857
2034
|
*/
|
1858
2035
|
function forInRight(object, callback, thisArg) {
|
1859
2036
|
var pairs = [];
|
@@ -1995,8 +2172,8 @@
|
|
1995
2172
|
* @returns {Object} Returns the created inverted object.
|
1996
2173
|
* @example
|
1997
2174
|
*
|
1998
|
-
* _.invert({ 'first': '
|
1999
|
-
* // => { '
|
2175
|
+
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
2176
|
+
* // => { 'fred': 'first', 'barney': 'second' }
|
2000
2177
|
*/
|
2001
2178
|
function invert(object) {
|
2002
2179
|
var index = -1,
|
@@ -2025,7 +2202,8 @@
|
|
2025
2202
|
* // => false
|
2026
2203
|
*/
|
2027
2204
|
function isBoolean(value) {
|
2028
|
-
return value === true || value === false ||
|
2205
|
+
return value === true || value === false ||
|
2206
|
+
value && typeof value == 'object' && toString.call(value) == boolClass || false;
|
2029
2207
|
}
|
2030
2208
|
|
2031
2209
|
/**
|
@@ -2042,7 +2220,7 @@
|
|
2042
2220
|
* // => true
|
2043
2221
|
*/
|
2044
2222
|
function isDate(value) {
|
2045
|
-
return value
|
2223
|
+
return value && typeof value == 'object' && toString.call(value) == dateClass || false;
|
2046
2224
|
}
|
2047
2225
|
|
2048
2226
|
/**
|
@@ -2059,7 +2237,7 @@
|
|
2059
2237
|
* // => true
|
2060
2238
|
*/
|
2061
2239
|
function isElement(value) {
|
2062
|
-
return value
|
2240
|
+
return value && value.nodeType === 1 || false;
|
2063
2241
|
}
|
2064
2242
|
|
2065
2243
|
/**
|
@@ -2118,13 +2296,13 @@
|
|
2118
2296
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
2119
2297
|
* @example
|
2120
2298
|
*
|
2121
|
-
* var
|
2122
|
-
* var copy = { 'name': '
|
2299
|
+
* var object = { 'name': 'fred' };
|
2300
|
+
* var copy = { 'name': 'fred' };
|
2123
2301
|
*
|
2124
|
-
*
|
2302
|
+
* object == copy;
|
2125
2303
|
* // => false
|
2126
2304
|
*
|
2127
|
-
* _.isEqual(
|
2305
|
+
* _.isEqual(object, copy);
|
2128
2306
|
* // => true
|
2129
2307
|
*
|
2130
2308
|
* var words = ['hello', 'goodbye'];
|
@@ -2287,7 +2465,8 @@
|
|
2287
2465
|
* // => true
|
2288
2466
|
*/
|
2289
2467
|
function isNumber(value) {
|
2290
|
-
return typeof value == 'number' ||
|
2468
|
+
return typeof value == 'number' ||
|
2469
|
+
value && typeof value == 'object' && toString.call(value) == numberClass || false;
|
2291
2470
|
}
|
2292
2471
|
|
2293
2472
|
/**
|
@@ -2300,18 +2479,18 @@
|
|
2300
2479
|
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
2301
2480
|
* @example
|
2302
2481
|
*
|
2303
|
-
* function
|
2304
|
-
* this.
|
2305
|
-
* this.
|
2482
|
+
* function Shape() {
|
2483
|
+
* this.x = 0;
|
2484
|
+
* this.y = 0;
|
2306
2485
|
* }
|
2307
2486
|
*
|
2308
|
-
* _.isPlainObject(new
|
2487
|
+
* _.isPlainObject(new Shape);
|
2309
2488
|
* // => false
|
2310
2489
|
*
|
2311
2490
|
* _.isPlainObject([1, 2, 3]);
|
2312
2491
|
* // => false
|
2313
2492
|
*
|
2314
|
-
* _.isPlainObject({ '
|
2493
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
2315
2494
|
* // => true
|
2316
2495
|
*/
|
2317
2496
|
var isPlainObject = function(value) {
|
@@ -2336,11 +2515,11 @@
|
|
2336
2515
|
* @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`.
|
2337
2516
|
* @example
|
2338
2517
|
*
|
2339
|
-
* _.isRegExp(/
|
2518
|
+
* _.isRegExp(/fred/);
|
2340
2519
|
* // => true
|
2341
2520
|
*/
|
2342
2521
|
function isRegExp(value) {
|
2343
|
-
return value
|
2522
|
+
return value && typeof value == 'object' && toString.call(value) == regexpClass || false;
|
2344
2523
|
}
|
2345
2524
|
|
2346
2525
|
/**
|
@@ -2353,11 +2532,12 @@
|
|
2353
2532
|
* @returns {boolean} Returns `true` if the `value` is a string, else `false`.
|
2354
2533
|
* @example
|
2355
2534
|
*
|
2356
|
-
* _.isString('
|
2535
|
+
* _.isString('fred');
|
2357
2536
|
* // => true
|
2358
2537
|
*/
|
2359
2538
|
function isString(value) {
|
2360
|
-
return typeof value == 'string' ||
|
2539
|
+
return typeof value == 'string' ||
|
2540
|
+
value && typeof value == 'object' && toString.call(value) == stringClass || false;
|
2361
2541
|
}
|
2362
2542
|
|
2363
2543
|
/**
|
@@ -2397,21 +2577,21 @@
|
|
2397
2577
|
* @example
|
2398
2578
|
*
|
2399
2579
|
* var names = {
|
2400
|
-
* '
|
2401
|
-
* { 'name': '
|
2402
|
-
* { 'name': '
|
2580
|
+
* 'characters': [
|
2581
|
+
* { 'name': 'barney' },
|
2582
|
+
* { 'name': 'fred' }
|
2403
2583
|
* ]
|
2404
2584
|
* };
|
2405
2585
|
*
|
2406
2586
|
* var ages = {
|
2407
|
-
* '
|
2408
|
-
* { 'age':
|
2409
|
-
* { 'age':
|
2587
|
+
* 'characters': [
|
2588
|
+
* { 'age': 36 },
|
2589
|
+
* { 'age': 40 }
|
2410
2590
|
* ]
|
2411
2591
|
* };
|
2412
2592
|
*
|
2413
2593
|
* _.merge(names, ages);
|
2414
|
-
* // => { '
|
2594
|
+
* // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] }
|
2415
2595
|
*
|
2416
2596
|
* var food = {
|
2417
2597
|
* 'fruits': ['apple'],
|
@@ -2435,6 +2615,7 @@
|
|
2435
2615
|
if (!isObject(object)) {
|
2436
2616
|
return object;
|
2437
2617
|
}
|
2618
|
+
|
2438
2619
|
// allows working with `_.reduce` and `_.reduceRight` without using
|
2439
2620
|
// their `index` and `collection` arguments
|
2440
2621
|
if (typeof args[2] != 'number') {
|
@@ -2445,7 +2626,7 @@
|
|
2445
2626
|
} else if (length > 2 && typeof args[length - 1] == 'function') {
|
2446
2627
|
callback = args[--length];
|
2447
2628
|
}
|
2448
|
-
var sources =
|
2629
|
+
var sources = slice(arguments, 1, length),
|
2449
2630
|
index = -1,
|
2450
2631
|
stackA = getArray(),
|
2451
2632
|
stackB = getArray();
|
@@ -2476,32 +2657,38 @@
|
|
2476
2657
|
* @returns {Object} Returns an object without the omitted properties.
|
2477
2658
|
* @example
|
2478
2659
|
*
|
2479
|
-
* _.omit({ 'name': '
|
2480
|
-
* // => { 'name': '
|
2660
|
+
* _.omit({ 'name': 'fred', 'age': 40 }, 'age');
|
2661
|
+
* // => { 'name': 'fred' }
|
2481
2662
|
*
|
2482
|
-
* _.omit({ 'name': '
|
2663
|
+
* _.omit({ 'name': 'fred', 'age': 40 }, function(value) {
|
2483
2664
|
* return typeof value == 'number';
|
2484
2665
|
* });
|
2485
|
-
* // => { 'name': '
|
2666
|
+
* // => { 'name': 'fred' }
|
2486
2667
|
*/
|
2487
2668
|
function omit(object, callback, thisArg) {
|
2488
|
-
var
|
2489
|
-
|
2490
|
-
|
2669
|
+
var result = {};
|
2670
|
+
if (typeof callback != 'function') {
|
2671
|
+
var props = [];
|
2672
|
+
forIn(object, function(value, key) {
|
2673
|
+
props.push(key);
|
2674
|
+
});
|
2675
|
+
props = baseDifference(props, baseFlatten(arguments, true, false, 1));
|
2491
2676
|
|
2492
|
-
|
2493
|
-
|
2677
|
+
var index = -1,
|
2678
|
+
length = props.length;
|
2679
|
+
|
2680
|
+
while (++index < length) {
|
2681
|
+
var key = props[index];
|
2682
|
+
result[key] = object[key];
|
2683
|
+
}
|
2494
2684
|
} else {
|
2495
|
-
|
2685
|
+
callback = lodash.createCallback(callback, thisArg, 3);
|
2686
|
+
forIn(object, function(value, key, object) {
|
2687
|
+
if (!callback(value, key, object)) {
|
2688
|
+
result[key] = value;
|
2689
|
+
}
|
2690
|
+
});
|
2496
2691
|
}
|
2497
|
-
forIn(object, function(value, key, object) {
|
2498
|
-
if (isFunc
|
2499
|
-
? !callback(value, key, object)
|
2500
|
-
: indexOf(props, key) < 0
|
2501
|
-
) {
|
2502
|
-
result[key] = value;
|
2503
|
-
}
|
2504
|
-
});
|
2505
2692
|
return result;
|
2506
2693
|
}
|
2507
2694
|
|
@@ -2516,8 +2703,8 @@
|
|
2516
2703
|
* @returns {Array} Returns new array of key-value pairs.
|
2517
2704
|
* @example
|
2518
2705
|
*
|
2519
|
-
* _.pairs({ '
|
2520
|
-
* // => [['
|
2706
|
+
* _.pairs({ 'barney': 36, 'fred': 40 });
|
2707
|
+
* // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments)
|
2521
2708
|
*/
|
2522
2709
|
function pairs(object) {
|
2523
2710
|
var index = -1,
|
@@ -2551,13 +2738,13 @@
|
|
2551
2738
|
* @returns {Object} Returns an object composed of the picked properties.
|
2552
2739
|
* @example
|
2553
2740
|
*
|
2554
|
-
* _.pick({ 'name': '
|
2555
|
-
* // => { 'name': '
|
2741
|
+
* _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name');
|
2742
|
+
* // => { 'name': 'fred' }
|
2556
2743
|
*
|
2557
|
-
* _.pick({ 'name': '
|
2744
|
+
* _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) {
|
2558
2745
|
* return key.charAt(0) != '_';
|
2559
2746
|
* });
|
2560
|
-
* // => { 'name': '
|
2747
|
+
* // => { 'name': 'fred' }
|
2561
2748
|
*/
|
2562
2749
|
function pick(object, callback, thisArg) {
|
2563
2750
|
var result = {};
|
@@ -2594,7 +2781,7 @@
|
|
2594
2781
|
* @static
|
2595
2782
|
* @memberOf _
|
2596
2783
|
* @category Objects
|
2597
|
-
* @param {Array|Object}
|
2784
|
+
* @param {Array|Object} object The object to iterate over.
|
2598
2785
|
* @param {Function} [callback=identity] The function called per iteration.
|
2599
2786
|
* @param {*} [accumulator] The custom accumulator value.
|
2600
2787
|
* @param {*} [thisArg] The `this` binding of `callback`.
|
@@ -2616,8 +2803,6 @@
|
|
2616
2803
|
*/
|
2617
2804
|
function transform(object, callback, accumulator, thisArg) {
|
2618
2805
|
var isArr = isArray(object);
|
2619
|
-
callback = baseCreateCallback(callback, thisArg, 4);
|
2620
|
-
|
2621
2806
|
if (accumulator == null) {
|
2622
2807
|
if (isArr) {
|
2623
2808
|
accumulator = [];
|
@@ -2625,12 +2810,15 @@
|
|
2625
2810
|
var ctor = object && object.constructor,
|
2626
2811
|
proto = ctor && ctor.prototype;
|
2627
2812
|
|
2628
|
-
accumulator =
|
2813
|
+
accumulator = baseCreate(proto);
|
2629
2814
|
}
|
2630
2815
|
}
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2816
|
+
if (callback) {
|
2817
|
+
callback = lodash.createCallback(callback, thisArg, 4);
|
2818
|
+
(isArr ? forEach : forOwn)(object, function(value, index, object) {
|
2819
|
+
return callback(accumulator, value, index, object);
|
2820
|
+
});
|
2821
|
+
}
|
2634
2822
|
return accumulator;
|
2635
2823
|
}
|
2636
2824
|
|
@@ -2679,8 +2867,8 @@
|
|
2679
2867
|
* _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]);
|
2680
2868
|
* // => ['a', 'c', 'e']
|
2681
2869
|
*
|
2682
|
-
* _.at(['
|
2683
|
-
* // => ['
|
2870
|
+
* _.at(['fred', 'barney', 'pebbles'], 0, 2);
|
2871
|
+
* // => ['fred', 'pebbles']
|
2684
2872
|
*/
|
2685
2873
|
function at(collection) {
|
2686
2874
|
var args = arguments,
|
@@ -2716,10 +2904,10 @@
|
|
2716
2904
|
* _.contains([1, 2, 3], 1, 2);
|
2717
2905
|
* // => false
|
2718
2906
|
*
|
2719
|
-
* _.contains({ 'name': '
|
2907
|
+
* _.contains({ 'name': 'fred', 'age': 40 }, 'fred');
|
2720
2908
|
* // => true
|
2721
2909
|
*
|
2722
|
-
* _.contains('
|
2910
|
+
* _.contains('pebbles', 'eb');
|
2723
2911
|
* // => true
|
2724
2912
|
*/
|
2725
2913
|
function contains(collection, target, fromIndex) {
|
@@ -2806,20 +2994,20 @@
|
|
2806
2994
|
* else `false`.
|
2807
2995
|
* @example
|
2808
2996
|
*
|
2809
|
-
* _.every([true, 1, null, 'yes']
|
2997
|
+
* _.every([true, 1, null, 'yes']);
|
2810
2998
|
* // => false
|
2811
2999
|
*
|
2812
|
-
* var
|
2813
|
-
* { 'name': '
|
2814
|
-
* { 'name': '
|
3000
|
+
* var characters = [
|
3001
|
+
* { 'name': 'barney', 'age': 36 },
|
3002
|
+
* { 'name': 'fred', 'age': 40 }
|
2815
3003
|
* ];
|
2816
3004
|
*
|
2817
3005
|
* // using "_.pluck" callback shorthand
|
2818
|
-
* _.every(
|
3006
|
+
* _.every(characters, 'age');
|
2819
3007
|
* // => true
|
2820
3008
|
*
|
2821
3009
|
* // using "_.where" callback shorthand
|
2822
|
-
* _.every(
|
3010
|
+
* _.every(characters, { 'age': 36 });
|
2823
3011
|
* // => false
|
2824
3012
|
*/
|
2825
3013
|
function every(collection, callback, thisArg) {
|
@@ -2870,18 +3058,18 @@
|
|
2870
3058
|
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
2871
3059
|
* // => [2, 4, 6]
|
2872
3060
|
*
|
2873
|
-
* var
|
2874
|
-
* { 'name': '
|
2875
|
-
* { 'name': '
|
3061
|
+
* var characters = [
|
3062
|
+
* { 'name': 'barney', 'age': 36, 'blocked': false },
|
3063
|
+
* { 'name': 'fred', 'age': 40, 'blocked': true }
|
2876
3064
|
* ];
|
2877
3065
|
*
|
2878
3066
|
* // using "_.pluck" callback shorthand
|
2879
|
-
* _.filter(
|
2880
|
-
* // => [{ 'name': '
|
3067
|
+
* _.filter(characters, 'blocked');
|
3068
|
+
* // => [{ 'name': 'fred', 'age': 40, 'blocked': true }]
|
2881
3069
|
*
|
2882
3070
|
* // using "_.where" callback shorthand
|
2883
|
-
* _.filter(
|
2884
|
-
* // => [{ 'name': '
|
3071
|
+
* _.filter(characters, { 'age': 36 });
|
3072
|
+
* // => [{ 'name': 'barney', 'age': 36, 'blocked': false }]
|
2885
3073
|
*/
|
2886
3074
|
function filter(collection, callback, thisArg) {
|
2887
3075
|
var result = [];
|
@@ -2931,24 +3119,24 @@
|
|
2931
3119
|
* @returns {*} Returns the found element, else `undefined`.
|
2932
3120
|
* @example
|
2933
3121
|
*
|
2934
|
-
*
|
2935
|
-
*
|
2936
|
-
* }
|
2937
|
-
*
|
2938
|
-
*
|
2939
|
-
* var food = [
|
2940
|
-
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
2941
|
-
* { 'name': 'banana', 'organic': true, 'type': 'fruit' },
|
2942
|
-
* { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
3122
|
+
* var characters = [
|
3123
|
+
* { 'name': 'barney', 'age': 36, 'blocked': false },
|
3124
|
+
* { 'name': 'fred', 'age': 40, 'blocked': true },
|
3125
|
+
* { 'name': 'pebbles', 'age': 1, 'blocked': false }
|
2943
3126
|
* ];
|
2944
3127
|
*
|
3128
|
+
* _.find(characters, function(chr) {
|
3129
|
+
* return chr.age < 40;
|
3130
|
+
* });
|
3131
|
+
* // => { 'name': 'barney', 'age': 36, 'blocked': false }
|
3132
|
+
*
|
2945
3133
|
* // using "_.where" callback shorthand
|
2946
|
-
* _.find(
|
2947
|
-
* // =>
|
3134
|
+
* _.find(characters, { 'age': 1 });
|
3135
|
+
* // => { 'name': 'pebbles', 'age': 1, 'blocked': false }
|
2948
3136
|
*
|
2949
3137
|
* // using "_.pluck" callback shorthand
|
2950
|
-
* _.find(
|
2951
|
-
* // => { 'name': '
|
3138
|
+
* _.find(characters, 'blocked');
|
3139
|
+
* // => { 'name': 'fred', 'age': 40, 'blocked': true }
|
2952
3140
|
*/
|
2953
3141
|
function find(collection, callback, thisArg) {
|
2954
3142
|
callback = lodash.createCallback(callback, thisArg, 3);
|
@@ -3013,6 +3201,10 @@
|
|
3013
3201
|
* (value, index|key, collection). Callbacks may exit iteration early by
|
3014
3202
|
* explicitly returning `false`.
|
3015
3203
|
*
|
3204
|
+
* Note: As with other "Collections" methods, objects with a `length` property
|
3205
|
+
* are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
|
3206
|
+
* may be used for object iteration.
|
3207
|
+
*
|
3016
3208
|
* @static
|
3017
3209
|
* @memberOf _
|
3018
3210
|
* @alias each
|
@@ -3158,7 +3350,7 @@
|
|
3158
3350
|
* _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
|
3159
3351
|
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
|
3160
3352
|
*
|
3161
|
-
* _.indexBy(
|
3353
|
+
* _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String);
|
3162
3354
|
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
|
3163
3355
|
*/
|
3164
3356
|
var indexBy = createAggregator(function(result, value, key) {
|
@@ -3188,7 +3380,7 @@
|
|
3188
3380
|
* // => [['1', '2', '3'], ['4', '5', '6']]
|
3189
3381
|
*/
|
3190
3382
|
function invoke(collection, methodName) {
|
3191
|
-
var args =
|
3383
|
+
var args = slice(arguments, 2),
|
3192
3384
|
index = -1,
|
3193
3385
|
isFunc = typeof methodName == 'function',
|
3194
3386
|
length = collection ? collection.length : 0,
|
@@ -3230,14 +3422,14 @@
|
|
3230
3422
|
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
3231
3423
|
* // => [3, 6, 9] (property order is not guaranteed across environments)
|
3232
3424
|
*
|
3233
|
-
* var
|
3234
|
-
* { 'name': '
|
3235
|
-
* { 'name': '
|
3425
|
+
* var characters = [
|
3426
|
+
* { 'name': 'barney', 'age': 36 },
|
3427
|
+
* { 'name': 'fred', 'age': 40 }
|
3236
3428
|
* ];
|
3237
3429
|
*
|
3238
3430
|
* // using "_.pluck" callback shorthand
|
3239
|
-
* _.map(
|
3240
|
-
* // => ['
|
3431
|
+
* _.map(characters, 'name');
|
3432
|
+
* // => ['barney', 'fred']
|
3241
3433
|
*/
|
3242
3434
|
function map(collection, callback, thisArg) {
|
3243
3435
|
var index = -1,
|
@@ -3286,23 +3478,28 @@
|
|
3286
3478
|
* _.max([4, 2, 8, 6]);
|
3287
3479
|
* // => 8
|
3288
3480
|
*
|
3289
|
-
* var
|
3290
|
-
* { 'name': '
|
3291
|
-
* { 'name': '
|
3481
|
+
* var characters = [
|
3482
|
+
* { 'name': 'barney', 'age': 36 },
|
3483
|
+
* { 'name': 'fred', 'age': 40 }
|
3292
3484
|
* ];
|
3293
3485
|
*
|
3294
|
-
* _.max(
|
3295
|
-
* // => { 'name': '
|
3486
|
+
* _.max(characters, function(chr) { return chr.age; });
|
3487
|
+
* // => { 'name': 'fred', 'age': 40 };
|
3296
3488
|
*
|
3297
3489
|
* // using "_.pluck" callback shorthand
|
3298
|
-
* _.max(
|
3299
|
-
* // => { 'name': '
|
3490
|
+
* _.max(characters, 'age');
|
3491
|
+
* // => { 'name': 'fred', 'age': 40 };
|
3300
3492
|
*/
|
3301
3493
|
function max(collection, callback, thisArg) {
|
3302
3494
|
var computed = -Infinity,
|
3303
3495
|
result = computed;
|
3304
3496
|
|
3305
|
-
|
3497
|
+
// allows working with functions like `_.map` without using
|
3498
|
+
// their `index` argument as a callback
|
3499
|
+
if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) {
|
3500
|
+
callback = null;
|
3501
|
+
}
|
3502
|
+
if (callback == null && isArray(collection)) {
|
3306
3503
|
var index = -1,
|
3307
3504
|
length = collection.length;
|
3308
3505
|
|
@@ -3313,7 +3510,7 @@
|
|
3313
3510
|
}
|
3314
3511
|
}
|
3315
3512
|
} else {
|
3316
|
-
callback = (
|
3513
|
+
callback = (callback == null && isString(collection))
|
3317
3514
|
? charAtCallback
|
3318
3515
|
: lodash.createCallback(callback, thisArg, 3);
|
3319
3516
|
|
@@ -3356,23 +3553,28 @@
|
|
3356
3553
|
* _.min([4, 2, 8, 6]);
|
3357
3554
|
* // => 2
|
3358
3555
|
*
|
3359
|
-
* var
|
3360
|
-
* { 'name': '
|
3361
|
-
* { 'name': '
|
3556
|
+
* var characters = [
|
3557
|
+
* { 'name': 'barney', 'age': 36 },
|
3558
|
+
* { 'name': 'fred', 'age': 40 }
|
3362
3559
|
* ];
|
3363
3560
|
*
|
3364
|
-
* _.min(
|
3365
|
-
* // => { 'name': '
|
3561
|
+
* _.min(characters, function(chr) { return chr.age; });
|
3562
|
+
* // => { 'name': 'barney', 'age': 36 };
|
3366
3563
|
*
|
3367
3564
|
* // using "_.pluck" callback shorthand
|
3368
|
-
* _.min(
|
3369
|
-
* // => { 'name': '
|
3565
|
+
* _.min(characters, 'age');
|
3566
|
+
* // => { 'name': 'barney', 'age': 36 };
|
3370
3567
|
*/
|
3371
3568
|
function min(collection, callback, thisArg) {
|
3372
3569
|
var computed = Infinity,
|
3373
3570
|
result = computed;
|
3374
3571
|
|
3375
|
-
|
3572
|
+
// allows working with functions like `_.map` without using
|
3573
|
+
// their `index` argument as a callback
|
3574
|
+
if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) {
|
3575
|
+
callback = null;
|
3576
|
+
}
|
3577
|
+
if (callback == null && isArray(collection)) {
|
3376
3578
|
var index = -1,
|
3377
3579
|
length = collection.length;
|
3378
3580
|
|
@@ -3383,7 +3585,7 @@
|
|
3383
3585
|
}
|
3384
3586
|
}
|
3385
3587
|
} else {
|
3386
|
-
callback = (
|
3588
|
+
callback = (callback == null && isString(collection))
|
3387
3589
|
? charAtCallback
|
3388
3590
|
: lodash.createCallback(callback, thisArg, 3);
|
3389
3591
|
|
@@ -3399,7 +3601,7 @@
|
|
3399
3601
|
}
|
3400
3602
|
|
3401
3603
|
/**
|
3402
|
-
* Retrieves the value of a specified property from all elements in the
|
3604
|
+
* Retrieves the value of a specified property from all elements in the collection.
|
3403
3605
|
*
|
3404
3606
|
* @static
|
3405
3607
|
* @memberOf _
|
@@ -3410,13 +3612,13 @@
|
|
3410
3612
|
* @returns {Array} Returns a new array of property values.
|
3411
3613
|
* @example
|
3412
3614
|
*
|
3413
|
-
* var
|
3414
|
-
* { 'name': '
|
3415
|
-
* { 'name': '
|
3615
|
+
* var characters = [
|
3616
|
+
* { 'name': 'barney', 'age': 36 },
|
3617
|
+
* { 'name': 'fred', 'age': 40 }
|
3416
3618
|
* ];
|
3417
3619
|
*
|
3418
|
-
* _.pluck(
|
3419
|
-
* // => ['
|
3620
|
+
* _.pluck(characters, 'name');
|
3621
|
+
* // => ['barney', 'fred']
|
3420
3622
|
*/
|
3421
3623
|
function pluck(collection, property) {
|
3422
3624
|
var index = -1,
|
@@ -3464,7 +3666,7 @@
|
|
3464
3666
|
function reduce(collection, callback, accumulator, thisArg) {
|
3465
3667
|
if (!collection) return accumulator;
|
3466
3668
|
var noaccum = arguments.length < 3;
|
3467
|
-
callback =
|
3669
|
+
callback = lodash.createCallback(callback, thisArg, 4);
|
3468
3670
|
|
3469
3671
|
var index = -1,
|
3470
3672
|
length = collection.length;
|
@@ -3507,7 +3709,7 @@
|
|
3507
3709
|
*/
|
3508
3710
|
function reduceRight(collection, callback, accumulator, thisArg) {
|
3509
3711
|
var noaccum = arguments.length < 3;
|
3510
|
-
callback =
|
3712
|
+
callback = lodash.createCallback(callback, thisArg, 4);
|
3511
3713
|
forEachRight(collection, function(value, index, collection) {
|
3512
3714
|
accumulator = noaccum
|
3513
3715
|
? (noaccum = false, value)
|
@@ -3541,18 +3743,18 @@
|
|
3541
3743
|
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
3542
3744
|
* // => [1, 3, 5]
|
3543
3745
|
*
|
3544
|
-
* var
|
3545
|
-
* { 'name': '
|
3546
|
-
* { 'name': '
|
3746
|
+
* var characters = [
|
3747
|
+
* { 'name': 'barney', 'age': 36, 'blocked': false },
|
3748
|
+
* { 'name': 'fred', 'age': 40, 'blocked': true }
|
3547
3749
|
* ];
|
3548
3750
|
*
|
3549
3751
|
* // using "_.pluck" callback shorthand
|
3550
|
-
* _.reject(
|
3551
|
-
* // => [{ 'name': '
|
3752
|
+
* _.reject(characters, 'blocked');
|
3753
|
+
* // => [{ 'name': 'barney', 'age': 36, 'blocked': false }]
|
3552
3754
|
*
|
3553
3755
|
* // using "_.where" callback shorthand
|
3554
|
-
* _.reject(
|
3555
|
-
* // => [{ 'name': '
|
3756
|
+
* _.reject(characters, { 'age': 36 });
|
3757
|
+
* // => [{ 'name': 'fred', 'age': 40, 'blocked': true }]
|
3556
3758
|
*/
|
3557
3759
|
function reject(collection, callback, thisArg) {
|
3558
3760
|
callback = lodash.createCallback(callback, thisArg, 3);
|
@@ -3569,8 +3771,8 @@
|
|
3569
3771
|
* @category Collections
|
3570
3772
|
* @param {Array|Object|string} collection The collection to sample.
|
3571
3773
|
* @param {number} [n] The number of elements to sample.
|
3572
|
-
* @param- {Object} [guard] Allows working with functions
|
3573
|
-
* without using their `
|
3774
|
+
* @param- {Object} [guard] Allows working with functions like `_.map`
|
3775
|
+
* without using their `index` arguments as `n`.
|
3574
3776
|
* @returns {Array} Returns the random sample(s) of `collection`.
|
3575
3777
|
* @example
|
3576
3778
|
*
|
@@ -3581,12 +3783,11 @@
|
|
3581
3783
|
* // => [3, 1]
|
3582
3784
|
*/
|
3583
3785
|
function sample(collection, n, guard) {
|
3584
|
-
|
3585
|
-
if (typeof length != 'number') {
|
3786
|
+
if (collection && typeof collection.length != 'number') {
|
3586
3787
|
collection = values(collection);
|
3587
3788
|
}
|
3588
3789
|
if (n == null || guard) {
|
3589
|
-
return collection ? collection[
|
3790
|
+
return collection ? collection[baseRandom(0, collection.length - 1)] : undefined;
|
3590
3791
|
}
|
3591
3792
|
var result = shuffle(collection);
|
3592
3793
|
result.length = nativeMin(nativeMax(0, n), result.length);
|
@@ -3613,7 +3814,7 @@
|
|
3613
3814
|
result = Array(typeof length == 'number' ? length : 0);
|
3614
3815
|
|
3615
3816
|
forEach(collection, function(value) {
|
3616
|
-
var rand =
|
3817
|
+
var rand = baseRandom(0, ++index);
|
3617
3818
|
result[index] = result[rand];
|
3618
3819
|
result[rand] = value;
|
3619
3820
|
});
|
@@ -3637,7 +3838,7 @@
|
|
3637
3838
|
* _.size({ 'one': 1, 'two': 2, 'three': 3 });
|
3638
3839
|
* // => 3
|
3639
3840
|
*
|
3640
|
-
* _.size('
|
3841
|
+
* _.size('pebbles');
|
3641
3842
|
* // => 5
|
3642
3843
|
*/
|
3643
3844
|
function size(collection) {
|
@@ -3674,17 +3875,17 @@
|
|
3674
3875
|
* _.some([null, 0, 'yes', false], Boolean);
|
3675
3876
|
* // => true
|
3676
3877
|
*
|
3677
|
-
* var
|
3678
|
-
* { 'name': '
|
3679
|
-
* { 'name': '
|
3878
|
+
* var characters = [
|
3879
|
+
* { 'name': 'barney', 'age': 36, 'blocked': false },
|
3880
|
+
* { 'name': 'fred', 'age': 40, 'blocked': true }
|
3680
3881
|
* ];
|
3681
3882
|
*
|
3682
3883
|
* // using "_.pluck" callback shorthand
|
3683
|
-
* _.some(
|
3884
|
+
* _.some(characters, 'blocked');
|
3684
3885
|
* // => true
|
3685
3886
|
*
|
3686
3887
|
* // using "_.where" callback shorthand
|
3687
|
-
* _.some(
|
3888
|
+
* _.some(characters, { 'age': 1 });
|
3688
3889
|
* // => false
|
3689
3890
|
*/
|
3690
3891
|
function some(collection, callback, thisArg) {
|
@@ -3800,16 +4001,16 @@
|
|
3800
4001
|
* @returns {Array} Returns a new array of elements that have the given properties.
|
3801
4002
|
* @example
|
3802
4003
|
*
|
3803
|
-
* var
|
3804
|
-
* { 'name': '
|
3805
|
-
* { 'name': '
|
4004
|
+
* var characters = [
|
4005
|
+
* { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] },
|
4006
|
+
* { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
|
3806
4007
|
* ];
|
3807
4008
|
*
|
3808
|
-
* _.where(
|
3809
|
-
* // => [{ 'name': '
|
4009
|
+
* _.where(characters, { 'age': 36 });
|
4010
|
+
* // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
|
3810
4011
|
*
|
3811
|
-
* _.where(
|
3812
|
-
* // => [{ 'name': '
|
4012
|
+
* _.where(characters, { 'pets': ['dino'] });
|
4013
|
+
* // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }]
|
3813
4014
|
*/
|
3814
4015
|
var where = filter;
|
3815
4016
|
|
@@ -3851,7 +4052,7 @@
|
|
3851
4052
|
* @memberOf _
|
3852
4053
|
* @category Arrays
|
3853
4054
|
* @param {Array} array The array to process.
|
3854
|
-
* @param {...Array} [
|
4055
|
+
* @param {...Array} [values] The arrays of values to exclude.
|
3855
4056
|
* @returns {Array} Returns a new array of filtered values.
|
3856
4057
|
* @example
|
3857
4058
|
*
|
@@ -3859,39 +4060,20 @@
|
|
3859
4060
|
* // => [1, 3, 4]
|
3860
4061
|
*/
|
3861
4062
|
function difference(array) {
|
3862
|
-
|
3863
|
-
indexOf = getIndexOf(),
|
3864
|
-
length = array ? array.length : 0,
|
3865
|
-
seen = baseFlatten(arguments, true, true, 1),
|
3866
|
-
result = [];
|
3867
|
-
|
3868
|
-
var isLarge = length >= largeArraySize && indexOf === baseIndexOf;
|
3869
|
-
|
3870
|
-
if (isLarge) {
|
3871
|
-
var cache = createCache(seen);
|
3872
|
-
if (cache) {
|
3873
|
-
indexOf = cacheIndexOf;
|
3874
|
-
seen = cache;
|
3875
|
-
} else {
|
3876
|
-
isLarge = false;
|
3877
|
-
}
|
3878
|
-
}
|
3879
|
-
while (++index < length) {
|
3880
|
-
var value = array[index];
|
3881
|
-
if (indexOf(seen, value) < 0) {
|
3882
|
-
result.push(value);
|
3883
|
-
}
|
3884
|
-
}
|
3885
|
-
if (isLarge) {
|
3886
|
-
releaseObject(seen);
|
3887
|
-
}
|
3888
|
-
return result;
|
4063
|
+
return baseDifference(array, baseFlatten(arguments, true, true, 1));
|
3889
4064
|
}
|
3890
4065
|
|
3891
4066
|
/**
|
3892
4067
|
* This method is like `_.find` except that it returns the index of the first
|
3893
4068
|
* element that passes the callback check, instead of the element itself.
|
3894
4069
|
*
|
4070
|
+
* If a property name is provided for `callback` the created "_.pluck" style
|
4071
|
+
* callback will return the property value of the given element.
|
4072
|
+
*
|
4073
|
+
* If an object is provided for `callback` the created "_.where" style callback
|
4074
|
+
* will return `true` for elements that have the properties of the given object,
|
4075
|
+
* else `false`.
|
4076
|
+
*
|
3895
4077
|
* @static
|
3896
4078
|
* @memberOf _
|
3897
4079
|
* @category Arrays
|
@@ -3903,9 +4085,23 @@
|
|
3903
4085
|
* @returns {number} Returns the index of the found element, else `-1`.
|
3904
4086
|
* @example
|
3905
4087
|
*
|
3906
|
-
*
|
3907
|
-
*
|
4088
|
+
* var characters = [
|
4089
|
+
* { 'name': 'barney', 'age': 36, 'blocked': false },
|
4090
|
+
* { 'name': 'fred', 'age': 40, 'blocked': true },
|
4091
|
+
* { 'name': 'pebbles', 'age': 1, 'blocked': false }
|
4092
|
+
* ];
|
4093
|
+
*
|
4094
|
+
* _.findIndex(characters, function(chr) {
|
4095
|
+
* return chr.age < 20;
|
3908
4096
|
* });
|
4097
|
+
* // => 2
|
4098
|
+
*
|
4099
|
+
* // using "_.where" callback shorthand
|
4100
|
+
* _.findIndex(characters, { 'age': 36 });
|
4101
|
+
* // => 0
|
4102
|
+
*
|
4103
|
+
* // using "_.pluck" callback shorthand
|
4104
|
+
* _.findIndex(characters, 'blocked');
|
3909
4105
|
* // => 1
|
3910
4106
|
*/
|
3911
4107
|
function findIndex(array, callback, thisArg) {
|
@@ -3925,6 +4121,13 @@
|
|
3925
4121
|
* This method is like `_.findIndex` except that it iterates over elements
|
3926
4122
|
* of a `collection` from right to left.
|
3927
4123
|
*
|
4124
|
+
* If a property name is provided for `callback` the created "_.pluck" style
|
4125
|
+
* callback will return the property value of the given element.
|
4126
|
+
*
|
4127
|
+
* If an object is provided for `callback` the created "_.where" style callback
|
4128
|
+
* will return `true` for elements that have the properties of the given object,
|
4129
|
+
* else `false`.
|
4130
|
+
*
|
3928
4131
|
* @static
|
3929
4132
|
* @memberOf _
|
3930
4133
|
* @category Arrays
|
@@ -3936,9 +4139,23 @@
|
|
3936
4139
|
* @returns {number} Returns the index of the found element, else `-1`.
|
3937
4140
|
* @example
|
3938
4141
|
*
|
3939
|
-
*
|
3940
|
-
*
|
4142
|
+
* var characters = [
|
4143
|
+
* { 'name': 'barney', 'age': 36, 'blocked': true },
|
4144
|
+
* { 'name': 'fred', 'age': 40, 'blocked': false },
|
4145
|
+
* { 'name': 'pebbles', 'age': 1, 'blocked': true }
|
4146
|
+
* ];
|
4147
|
+
*
|
4148
|
+
* _.findLastIndex(characters, function(chr) {
|
4149
|
+
* return chr.age > 30;
|
3941
4150
|
* });
|
4151
|
+
* // => 1
|
4152
|
+
*
|
4153
|
+
* // using "_.where" callback shorthand
|
4154
|
+
* _.findLastIndex(characters, { 'age': 36 });
|
4155
|
+
* // => 0
|
4156
|
+
*
|
4157
|
+
* // using "_.pluck" callback shorthand
|
4158
|
+
* _.findLastIndex(characters, 'blocked');
|
3942
4159
|
* // => 2
|
3943
4160
|
*/
|
3944
4161
|
function findLastIndex(array, callback, thisArg) {
|
@@ -3989,24 +4206,19 @@
|
|
3989
4206
|
* });
|
3990
4207
|
* // => [1, 2]
|
3991
4208
|
*
|
3992
|
-
* var
|
3993
|
-
* { 'name': '
|
3994
|
-
* { 'name': '
|
4209
|
+
* var characters = [
|
4210
|
+
* { 'name': 'barney', 'blocked': true, 'employer': 'slate' },
|
4211
|
+
* { 'name': 'fred', 'blocked': false, 'employer': 'slate' },
|
4212
|
+
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
|
3995
4213
|
* ];
|
3996
4214
|
*
|
3997
4215
|
* // using "_.pluck" callback shorthand
|
3998
|
-
* _.first(
|
3999
|
-
* // => [{ 'name': '
|
4000
|
-
*
|
4001
|
-
* var food = [
|
4002
|
-
* { 'name': 'apple', 'type': 'fruit' },
|
4003
|
-
* { 'name': 'banana', 'type': 'fruit' },
|
4004
|
-
* { 'name': 'beet', 'type': 'vegetable' }
|
4005
|
-
* ];
|
4216
|
+
* _.first(characters, 'blocked');
|
4217
|
+
* // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }]
|
4006
4218
|
*
|
4007
4219
|
* // using "_.where" callback shorthand
|
4008
|
-
* _.first(
|
4009
|
-
* // => [
|
4220
|
+
* _.pluck(_.first(characters, { 'employer': 'slate' }), 'name');
|
4221
|
+
* // => ['barney', 'fred']
|
4010
4222
|
*/
|
4011
4223
|
function first(array, callback, thisArg) {
|
4012
4224
|
var n = 0,
|
@@ -4059,20 +4271,20 @@
|
|
4059
4271
|
* _.flatten([1, [2], [3, [[4]]]], true);
|
4060
4272
|
* // => [1, 2, 3, [[4]]];
|
4061
4273
|
*
|
4062
|
-
* var
|
4063
|
-
* { 'name': '
|
4064
|
-
* { 'name': '
|
4274
|
+
* var characters = [
|
4275
|
+
* { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] },
|
4276
|
+
* { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
|
4065
4277
|
* ];
|
4066
4278
|
*
|
4067
4279
|
* // using "_.pluck" callback shorthand
|
4068
|
-
* _.flatten(
|
4069
|
-
* // => ['
|
4280
|
+
* _.flatten(characters, 'pets');
|
4281
|
+
* // => ['hoppy', 'baby puss', 'dino']
|
4070
4282
|
*/
|
4071
4283
|
function flatten(array, isShallow, callback, thisArg) {
|
4072
4284
|
// juggle arguments
|
4073
4285
|
if (typeof isShallow != 'boolean' && isShallow != null) {
|
4074
4286
|
thisArg = callback;
|
4075
|
-
callback =
|
4287
|
+
callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow;
|
4076
4288
|
isShallow = false;
|
4077
4289
|
}
|
4078
4290
|
if (callback != null) {
|
@@ -4152,24 +4364,19 @@
|
|
4152
4364
|
* });
|
4153
4365
|
* // => [1]
|
4154
4366
|
*
|
4155
|
-
* var
|
4156
|
-
* { 'name': '
|
4157
|
-
* { 'name': '
|
4367
|
+
* var characters = [
|
4368
|
+
* { 'name': 'barney', 'blocked': false, 'employer': 'slate' },
|
4369
|
+
* { 'name': 'fred', 'blocked': true, 'employer': 'slate' },
|
4370
|
+
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
|
4158
4371
|
* ];
|
4159
4372
|
*
|
4160
4373
|
* // using "_.pluck" callback shorthand
|
4161
|
-
* _.initial(
|
4162
|
-
* // => [{ 'name': '
|
4163
|
-
*
|
4164
|
-
* var food = [
|
4165
|
-
* { 'name': 'banana', 'type': 'fruit' },
|
4166
|
-
* { 'name': 'beet', 'type': 'vegetable' },
|
4167
|
-
* { 'name': 'carrot', 'type': 'vegetable' }
|
4168
|
-
* ];
|
4374
|
+
* _.initial(characters, 'blocked');
|
4375
|
+
* // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }]
|
4169
4376
|
*
|
4170
4377
|
* // using "_.where" callback shorthand
|
4171
|
-
* _.initial(
|
4172
|
-
* // => [
|
4378
|
+
* _.pluck(_.initial(characters, { 'employer': 'na' }), 'name');
|
4379
|
+
* // => ['barney', 'fred']
|
4173
4380
|
*/
|
4174
4381
|
function initial(array, callback, thisArg) {
|
4175
4382
|
var n = 0,
|
@@ -4282,24 +4489,19 @@
|
|
4282
4489
|
* });
|
4283
4490
|
* // => [2, 3]
|
4284
4491
|
*
|
4285
|
-
* var
|
4286
|
-
* { 'name': '
|
4287
|
-
* { 'name': '
|
4492
|
+
* var characters = [
|
4493
|
+
* { 'name': 'barney', 'blocked': false, 'employer': 'slate' },
|
4494
|
+
* { 'name': 'fred', 'blocked': true, 'employer': 'slate' },
|
4495
|
+
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
|
4288
4496
|
* ];
|
4289
4497
|
*
|
4290
4498
|
* // using "_.pluck" callback shorthand
|
4291
|
-
* _.last(
|
4292
|
-
* // => [
|
4293
|
-
*
|
4294
|
-
* var food = [
|
4295
|
-
* { 'name': 'banana', 'type': 'fruit' },
|
4296
|
-
* { 'name': 'beet', 'type': 'vegetable' },
|
4297
|
-
* { 'name': 'carrot', 'type': 'vegetable' }
|
4298
|
-
* ];
|
4499
|
+
* _.pluck(_.last(characters, 'blocked'), 'name');
|
4500
|
+
* // => ['fred', 'pebbles']
|
4299
4501
|
*
|
4300
4502
|
* // using "_.where" callback shorthand
|
4301
|
-
* _.last(
|
4302
|
-
* // => [{ 'name': '
|
4503
|
+
* _.last(characters, { 'employer': 'na' });
|
4504
|
+
* // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }]
|
4303
4505
|
*/
|
4304
4506
|
function last(array, callback, thisArg) {
|
4305
4507
|
var n = 0,
|
@@ -4325,6 +4527,13 @@
|
|
4325
4527
|
* equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
|
4326
4528
|
* as the offset from the end of the collection.
|
4327
4529
|
*
|
4530
|
+
* If a property name is provided for `callback` the created "_.pluck" style
|
4531
|
+
* callback will return the property value of the given element.
|
4532
|
+
*
|
4533
|
+
* If an object is provided for `callback` the created "_.where" style callback
|
4534
|
+
* will return `true` for elements that have the properties of the given object,
|
4535
|
+
* else `false`.
|
4536
|
+
*
|
4328
4537
|
* @static
|
4329
4538
|
* @memberOf _
|
4330
4539
|
* @category Arrays
|
@@ -4403,17 +4612,17 @@
|
|
4403
4612
|
* @returns {Array} Returns a new range array.
|
4404
4613
|
* @example
|
4405
4614
|
*
|
4406
|
-
* _.range(
|
4407
|
-
* // => [0, 1, 2, 3
|
4615
|
+
* _.range(4);
|
4616
|
+
* // => [0, 1, 2, 3]
|
4408
4617
|
*
|
4409
|
-
* _.range(1,
|
4410
|
-
* // => [1, 2, 3, 4
|
4618
|
+
* _.range(1, 5);
|
4619
|
+
* // => [1, 2, 3, 4]
|
4411
4620
|
*
|
4412
|
-
* _.range(0,
|
4413
|
-
* // => [0, 5, 10, 15
|
4621
|
+
* _.range(0, 20, 5);
|
4622
|
+
* // => [0, 5, 10, 15]
|
4414
4623
|
*
|
4415
|
-
* _.range(0, -
|
4416
|
-
* // => [0, -1, -2, -3
|
4624
|
+
* _.range(0, -4, -1);
|
4625
|
+
* // => [0, -1, -2, -3]
|
4417
4626
|
*
|
4418
4627
|
* _.range(1, 4, 0);
|
4419
4628
|
* // => [1, 1, 1]
|
@@ -4429,7 +4638,7 @@
|
|
4429
4638
|
end = start;
|
4430
4639
|
start = 0;
|
4431
4640
|
}
|
4432
|
-
// use `Array(length)` so engines
|
4641
|
+
// use `Array(length)` so engines like Chakra and V8 avoid slower modes
|
4433
4642
|
// http://youtu.be/XAqIpGU8ZZk#t=17m25s
|
4434
4643
|
var index = -1,
|
4435
4644
|
length = nativeMax(0, ceil((end - start) / (step || 1))),
|
@@ -4529,24 +4738,19 @@
|
|
4529
4738
|
* });
|
4530
4739
|
* // => [3]
|
4531
4740
|
*
|
4532
|
-
* var
|
4533
|
-
* { 'name': '
|
4534
|
-
* { 'name': '
|
4741
|
+
* var characters = [
|
4742
|
+
* { 'name': 'barney', 'blocked': true, 'employer': 'slate' },
|
4743
|
+
* { 'name': 'fred', 'blocked': false, 'employer': 'slate' },
|
4744
|
+
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
|
4535
4745
|
* ];
|
4536
4746
|
*
|
4537
4747
|
* // using "_.pluck" callback shorthand
|
4538
|
-
* _.rest(
|
4539
|
-
* // => [
|
4540
|
-
*
|
4541
|
-
* var food = [
|
4542
|
-
* { 'name': 'apple', 'type': 'fruit' },
|
4543
|
-
* { 'name': 'banana', 'type': 'fruit' },
|
4544
|
-
* { 'name': 'beet', 'type': 'vegetable' }
|
4545
|
-
* ];
|
4748
|
+
* _.pluck(_.rest(characters, 'blocked'), 'name');
|
4749
|
+
* // => ['fred', 'pebbles']
|
4546
4750
|
*
|
4547
4751
|
* // using "_.where" callback shorthand
|
4548
|
-
* _.rest(
|
4549
|
-
* // => [{ 'name': '
|
4752
|
+
* _.rest(characters, { 'employer': 'slate' });
|
4753
|
+
* // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }]
|
4550
4754
|
*/
|
4551
4755
|
function rest(array, callback, thisArg) {
|
4552
4756
|
if (typeof callback != 'number' && callback != null) {
|
@@ -4695,7 +4899,7 @@
|
|
4695
4899
|
// juggle arguments
|
4696
4900
|
if (typeof isSorted != 'boolean' && isSorted != null) {
|
4697
4901
|
thisArg = callback;
|
4698
|
-
callback =
|
4902
|
+
callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted;
|
4699
4903
|
isSorted = false;
|
4700
4904
|
}
|
4701
4905
|
if (callback != null) {
|
@@ -4720,7 +4924,7 @@
|
|
4720
4924
|
* // => [2, 3, 4]
|
4721
4925
|
*/
|
4722
4926
|
function without(array) {
|
4723
|
-
return
|
4927
|
+
return baseDifference(array, slice(arguments, 1));
|
4724
4928
|
}
|
4725
4929
|
|
4726
4930
|
/**
|
@@ -4736,8 +4940,8 @@
|
|
4736
4940
|
* @returns {Array} Returns a new array of grouped elements.
|
4737
4941
|
* @example
|
4738
4942
|
*
|
4739
|
-
* _.zip(['
|
4740
|
-
* // => [['
|
4943
|
+
* _.zip(['fred', 'barney'], [30, 40], [true, false]);
|
4944
|
+
* // => [['fred', 30, true], ['barney', 40, false]]
|
4741
4945
|
*/
|
4742
4946
|
function zip() {
|
4743
4947
|
var array = arguments.length > 1 ? arguments : arguments[0],
|
@@ -4766,8 +4970,8 @@
|
|
4766
4970
|
* corresponding values.
|
4767
4971
|
* @example
|
4768
4972
|
*
|
4769
|
-
* _.zipObject(['
|
4770
|
-
* // => { '
|
4973
|
+
* _.zipObject(['fred', 'barney'], [30, 40]);
|
4974
|
+
* // => { 'fred': 30, 'barney': 40 }
|
4771
4975
|
*/
|
4772
4976
|
function zipObject(keys, values) {
|
4773
4977
|
var index = -1,
|
@@ -4840,14 +5044,14 @@
|
|
4840
5044
|
* return greeting + ' ' + this.name;
|
4841
5045
|
* };
|
4842
5046
|
*
|
4843
|
-
* func = _.bind(func, { 'name': '
|
5047
|
+
* func = _.bind(func, { 'name': 'fred' }, 'hi');
|
4844
5048
|
* func();
|
4845
|
-
* // => 'hi
|
5049
|
+
* // => 'hi fred'
|
4846
5050
|
*/
|
4847
5051
|
function bind(func, thisArg) {
|
4848
5052
|
return arguments.length > 2
|
4849
|
-
?
|
4850
|
-
:
|
5053
|
+
? createWrapper(func, 17, slice(arguments, 2), null, thisArg)
|
5054
|
+
: createWrapper(func, 1, null, null, thisArg);
|
4851
5055
|
}
|
4852
5056
|
|
4853
5057
|
/**
|
@@ -4881,7 +5085,7 @@
|
|
4881
5085
|
|
4882
5086
|
while (++index < length) {
|
4883
5087
|
var key = funcs[index];
|
4884
|
-
object[key] =
|
5088
|
+
object[key] = createWrapper(object[key], 1, null, null, object);
|
4885
5089
|
}
|
4886
5090
|
return object;
|
4887
5091
|
}
|
@@ -4903,7 +5107,7 @@
|
|
4903
5107
|
* @example
|
4904
5108
|
*
|
4905
5109
|
* var object = {
|
4906
|
-
* 'name': '
|
5110
|
+
* 'name': 'fred',
|
4907
5111
|
* 'greet': function(greeting) {
|
4908
5112
|
* return greeting + ' ' + this.name;
|
4909
5113
|
* }
|
@@ -4911,19 +5115,19 @@
|
|
4911
5115
|
*
|
4912
5116
|
* var func = _.bindKey(object, 'greet', 'hi');
|
4913
5117
|
* func();
|
4914
|
-
* // => 'hi
|
5118
|
+
* // => 'hi fred'
|
4915
5119
|
*
|
4916
5120
|
* object.greet = function(greeting) {
|
4917
|
-
* return greeting + '
|
5121
|
+
* return greeting + 'ya ' + this.name + '!';
|
4918
5122
|
* };
|
4919
5123
|
*
|
4920
5124
|
* func();
|
4921
|
-
* // => '
|
5125
|
+
* // => 'hiya fred!'
|
4922
5126
|
*/
|
4923
5127
|
function bindKey(object, key) {
|
4924
5128
|
return arguments.length > 2
|
4925
|
-
?
|
4926
|
-
:
|
5129
|
+
? createWrapper(key, 19, slice(arguments, 2), null, object)
|
5130
|
+
: createWrapper(key, 3, null, null, object);
|
4927
5131
|
}
|
4928
5132
|
|
4929
5133
|
/**
|
@@ -4940,7 +5144,7 @@
|
|
4940
5144
|
* @example
|
4941
5145
|
*
|
4942
5146
|
* var realNameMap = {
|
4943
|
-
* '
|
5147
|
+
* 'pebbles': 'penelope'
|
4944
5148
|
* };
|
4945
5149
|
*
|
4946
5150
|
* var format = function(name) {
|
@@ -4953,8 +5157,8 @@
|
|
4953
5157
|
* };
|
4954
5158
|
*
|
4955
5159
|
* var welcome = _.compose(greet, format);
|
4956
|
-
* welcome('
|
4957
|
-
* // => 'Hiya
|
5160
|
+
* welcome('pebbles');
|
5161
|
+
* // => 'Hiya Penelope!'
|
4958
5162
|
*/
|
4959
5163
|
function compose() {
|
4960
5164
|
var funcs = arguments,
|
@@ -4991,9 +5195,9 @@
|
|
4991
5195
|
* @returns {Function} Returns a callback function.
|
4992
5196
|
* @example
|
4993
5197
|
*
|
4994
|
-
* var
|
4995
|
-
* { 'name': '
|
4996
|
-
* { 'name': '
|
5198
|
+
* var characters = [
|
5199
|
+
* { 'name': 'barney', 'age': 36 },
|
5200
|
+
* { 'name': 'fred', 'age': 40 }
|
4997
5201
|
* ];
|
4998
5202
|
*
|
4999
5203
|
* // wrap to create custom callback shorthands
|
@@ -5004,8 +5208,8 @@
|
|
5004
5208
|
* };
|
5005
5209
|
* });
|
5006
5210
|
*
|
5007
|
-
* _.filter(
|
5008
|
-
* // => [{ 'name': '
|
5211
|
+
* _.filter(characters, 'age__gt38');
|
5212
|
+
* // => [{ 'name': 'fred', 'age': 40 }]
|
5009
5213
|
*/
|
5010
5214
|
function createCallback(func, thisArg, argCount) {
|
5011
5215
|
var type = typeof func;
|
@@ -5074,7 +5278,7 @@
|
|
5074
5278
|
*/
|
5075
5279
|
function curry(func, arity) {
|
5076
5280
|
arity = typeof arity == 'number' ? arity : (+arity || func.length);
|
5077
|
-
return
|
5281
|
+
return createWrapper(func, 4, null, null, null, arity);
|
5078
5282
|
}
|
5079
5283
|
|
5080
5284
|
/**
|
@@ -5151,6 +5355,9 @@
|
|
5151
5355
|
if (isCalled) {
|
5152
5356
|
lastCalled = now();
|
5153
5357
|
result = func.apply(thisArg, args);
|
5358
|
+
if (!timeoutId && !maxTimeoutId) {
|
5359
|
+
args = thisArg = null;
|
5360
|
+
}
|
5154
5361
|
}
|
5155
5362
|
} else {
|
5156
5363
|
timeoutId = setTimeout(delayed, remaining);
|
@@ -5165,6 +5372,9 @@
|
|
5165
5372
|
if (trailing || (maxWait !== wait)) {
|
5166
5373
|
lastCalled = now();
|
5167
5374
|
result = func.apply(thisArg, args);
|
5375
|
+
if (!timeoutId && !maxTimeoutId) {
|
5376
|
+
args = thisArg = null;
|
5377
|
+
}
|
5168
5378
|
}
|
5169
5379
|
};
|
5170
5380
|
|
@@ -5180,8 +5390,10 @@
|
|
5180
5390
|
if (!maxTimeoutId && !leading) {
|
5181
5391
|
lastCalled = stamp;
|
5182
5392
|
}
|
5183
|
-
var remaining = maxWait - (stamp - lastCalled)
|
5184
|
-
|
5393
|
+
var remaining = maxWait - (stamp - lastCalled),
|
5394
|
+
isCalled = remaining <= 0;
|
5395
|
+
|
5396
|
+
if (isCalled) {
|
5185
5397
|
if (maxTimeoutId) {
|
5186
5398
|
maxTimeoutId = clearTimeout(maxTimeoutId);
|
5187
5399
|
}
|
@@ -5192,12 +5404,19 @@
|
|
5192
5404
|
maxTimeoutId = setTimeout(maxDelayed, remaining);
|
5193
5405
|
}
|
5194
5406
|
}
|
5195
|
-
if (
|
5407
|
+
if (isCalled && timeoutId) {
|
5408
|
+
timeoutId = clearTimeout(timeoutId);
|
5409
|
+
}
|
5410
|
+
else if (!timeoutId && wait !== maxWait) {
|
5196
5411
|
timeoutId = setTimeout(delayed, wait);
|
5197
5412
|
}
|
5198
5413
|
if (leadingCall) {
|
5414
|
+
isCalled = true;
|
5199
5415
|
result = func.apply(thisArg, args);
|
5200
5416
|
}
|
5417
|
+
if (isCalled && !timeoutId && !maxTimeoutId) {
|
5418
|
+
args = thisArg = null;
|
5419
|
+
}
|
5201
5420
|
return result;
|
5202
5421
|
};
|
5203
5422
|
}
|
@@ -5221,11 +5440,11 @@
|
|
5221
5440
|
if (!isFunction(func)) {
|
5222
5441
|
throw new TypeError;
|
5223
5442
|
}
|
5224
|
-
var args =
|
5443
|
+
var args = slice(arguments, 1);
|
5225
5444
|
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
5226
5445
|
}
|
5227
5446
|
// use `setImmediate` if available in Node.js
|
5228
|
-
if (
|
5447
|
+
if (setImmediate) {
|
5229
5448
|
defer = function(func) {
|
5230
5449
|
if (!isFunction(func)) {
|
5231
5450
|
throw new TypeError;
|
@@ -5255,7 +5474,7 @@
|
|
5255
5474
|
if (!isFunction(func)) {
|
5256
5475
|
throw new TypeError;
|
5257
5476
|
}
|
5258
|
-
var args =
|
5477
|
+
var args = slice(arguments, 2);
|
5259
5478
|
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
5260
5479
|
}
|
5261
5480
|
|
@@ -5279,19 +5498,22 @@
|
|
5279
5498
|
* return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
|
5280
5499
|
* });
|
5281
5500
|
*
|
5501
|
+
* fibonacci(9)
|
5502
|
+
* // => 34
|
5503
|
+
*
|
5282
5504
|
* var data = {
|
5283
|
-
* '
|
5284
|
-
* '
|
5505
|
+
* 'fred': { 'name': 'fred', 'age': 40 },
|
5506
|
+
* 'pebbles': { 'name': 'pebbles', 'age': 1 }
|
5285
5507
|
* };
|
5286
5508
|
*
|
5287
5509
|
* // modifying the result cache
|
5288
|
-
* var
|
5289
|
-
*
|
5290
|
-
* // => { 'name': '
|
5510
|
+
* var get = _.memoize(function(name) { return data[name]; }, _.identity);
|
5511
|
+
* get('pebbles');
|
5512
|
+
* // => { 'name': 'pebbles', 'age': 1 }
|
5291
5513
|
*
|
5292
|
-
*
|
5293
|
-
*
|
5294
|
-
* // => { 'name': '
|
5514
|
+
* get.cache.pebbles.name = 'penelope';
|
5515
|
+
* get('pebbles');
|
5516
|
+
* // => { 'name': 'penelope', 'age': 1 }
|
5295
5517
|
*/
|
5296
5518
|
function memoize(func, resolver) {
|
5297
5519
|
if (!isFunction(func)) {
|
@@ -5361,11 +5583,11 @@
|
|
5361
5583
|
*
|
5362
5584
|
* var greet = function(greeting, name) { return greeting + ' ' + name; };
|
5363
5585
|
* var hi = _.partial(greet, 'hi');
|
5364
|
-
* hi('
|
5365
|
-
* // => 'hi
|
5586
|
+
* hi('fred');
|
5587
|
+
* // => 'hi fred'
|
5366
5588
|
*/
|
5367
5589
|
function partial(func) {
|
5368
|
-
return
|
5590
|
+
return createWrapper(func, 16, slice(arguments, 1));
|
5369
5591
|
}
|
5370
5592
|
|
5371
5593
|
/**
|
@@ -5396,7 +5618,7 @@
|
|
5396
5618
|
* // => { '_': _, 'jq': $ }
|
5397
5619
|
*/
|
5398
5620
|
function partialRight(func) {
|
5399
|
-
return
|
5621
|
+
return createWrapper(func, 32, null, slice(arguments, 1));
|
5400
5622
|
}
|
5401
5623
|
|
5402
5624
|
/**
|
@@ -5447,8 +5669,7 @@
|
|
5447
5669
|
debounceOptions.maxWait = wait;
|
5448
5670
|
debounceOptions.trailing = trailing;
|
5449
5671
|
|
5450
|
-
|
5451
|
-
return result;
|
5672
|
+
return debounce(func, wait, debounceOptions);
|
5452
5673
|
}
|
5453
5674
|
|
5454
5675
|
/**
|
@@ -5465,22 +5686,15 @@
|
|
5465
5686
|
* @returns {Function} Returns the new function.
|
5466
5687
|
* @example
|
5467
5688
|
*
|
5468
|
-
* var
|
5469
|
-
*
|
5470
|
-
* return 'before, ' + func('moe') + ', after';
|
5689
|
+
* var p = _.wrap(_.escape, function(func, text) {
|
5690
|
+
* return '<p>' + func(text) + '</p>';
|
5471
5691
|
* });
|
5472
|
-
*
|
5473
|
-
*
|
5692
|
+
*
|
5693
|
+
* p('Fred, Wilma, & Pebbles');
|
5694
|
+
* // => '<p>Fred, Wilma, & Pebbles</p>'
|
5474
5695
|
*/
|
5475
5696
|
function wrap(value, wrapper) {
|
5476
|
-
|
5477
|
-
throw new TypeError;
|
5478
|
-
}
|
5479
|
-
return function() {
|
5480
|
-
var args = [value];
|
5481
|
-
push.apply(args, arguments);
|
5482
|
-
return wrapper.apply(this, args);
|
5483
|
-
};
|
5697
|
+
return createWrapper(wrapper, 16, [value]);
|
5484
5698
|
}
|
5485
5699
|
|
5486
5700
|
/*--------------------------------------------------------------------------*/
|
@@ -5496,8 +5710,8 @@
|
|
5496
5710
|
* @returns {string} Returns the escaped string.
|
5497
5711
|
* @example
|
5498
5712
|
*
|
5499
|
-
* _.escape('
|
5500
|
-
* // => '
|
5713
|
+
* _.escape('Fred, Wilma, & Pebbles');
|
5714
|
+
* // => 'Fred, Wilma, & Pebbles'
|
5501
5715
|
*/
|
5502
5716
|
function escape(string) {
|
5503
5717
|
return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar);
|
@@ -5513,8 +5727,8 @@
|
|
5513
5727
|
* @returns {*} Returns `value`.
|
5514
5728
|
* @example
|
5515
5729
|
*
|
5516
|
-
* var
|
5517
|
-
*
|
5730
|
+
* var object = { 'name': 'fred' };
|
5731
|
+
* _.identity(object) === object;
|
5518
5732
|
* // => true
|
5519
5733
|
*/
|
5520
5734
|
function identity(value) {
|
@@ -5538,11 +5752,11 @@
|
|
5538
5752
|
* }
|
5539
5753
|
* });
|
5540
5754
|
*
|
5541
|
-
* _.capitalize('
|
5542
|
-
* // => '
|
5755
|
+
* _.capitalize('fred');
|
5756
|
+
* // => 'Fred'
|
5543
5757
|
*
|
5544
|
-
* _('
|
5545
|
-
* // => '
|
5758
|
+
* _('fred').capitalize();
|
5759
|
+
* // => 'Fred'
|
5546
5760
|
*/
|
5547
5761
|
function mixin(object, source) {
|
5548
5762
|
var ctor = object,
|
@@ -5590,6 +5804,22 @@
|
|
5590
5804
|
return this;
|
5591
5805
|
}
|
5592
5806
|
|
5807
|
+
/**
|
5808
|
+
* A no-operation function.
|
5809
|
+
*
|
5810
|
+
* @static
|
5811
|
+
* @memberOf _
|
5812
|
+
* @category Utilities
|
5813
|
+
* @example
|
5814
|
+
*
|
5815
|
+
* var object = { 'name': 'fred' };
|
5816
|
+
* _.noop(object) === undefined;
|
5817
|
+
* // => true
|
5818
|
+
*/
|
5819
|
+
function noop() {
|
5820
|
+
// no operation performed
|
5821
|
+
}
|
5822
|
+
|
5593
5823
|
/**
|
5594
5824
|
* Converts the given value into an integer of the specified radix.
|
5595
5825
|
* If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
|
@@ -5610,7 +5840,7 @@
|
|
5610
5840
|
* // => 8
|
5611
5841
|
*/
|
5612
5842
|
var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) {
|
5613
|
-
// Firefox and Opera
|
5843
|
+
// Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt`
|
5614
5844
|
return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
|
5615
5845
|
};
|
5616
5846
|
|
@@ -5665,10 +5895,11 @@
|
|
5665
5895
|
} else {
|
5666
5896
|
max = +max || 0;
|
5667
5897
|
}
|
5668
|
-
|
5669
|
-
|
5670
|
-
|
5671
|
-
|
5898
|
+
if (floating || min % 1 || max % 1) {
|
5899
|
+
var rand = nativeRandom();
|
5900
|
+
return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max);
|
5901
|
+
}
|
5902
|
+
return baseRandom(min, max);
|
5672
5903
|
}
|
5673
5904
|
|
5674
5905
|
/**
|
@@ -5713,7 +5944,7 @@
|
|
5713
5944
|
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
|
5714
5945
|
*
|
5715
5946
|
* For more information on precompiling templates see:
|
5716
|
-
* http://lodash.com
|
5947
|
+
* http://lodash.com/custom-builds
|
5717
5948
|
*
|
5718
5949
|
* For more information on Chrome extension sandboxes see:
|
5719
5950
|
* http://developer.chrome.com/stable/extensions/sandboxingEval.html
|
@@ -5736,8 +5967,8 @@
|
|
5736
5967
|
*
|
5737
5968
|
* // using the "interpolate" delimiter to create a compiled template
|
5738
5969
|
* var compiled = _.template('hello <%= name %>');
|
5739
|
-
* compiled({ 'name': '
|
5740
|
-
* // => 'hello
|
5970
|
+
* compiled({ 'name': 'fred' });
|
5971
|
+
* // => 'hello fred'
|
5741
5972
|
*
|
5742
5973
|
* // using the "escape" delimiter to escape HTML in data property values
|
5743
5974
|
* _.template('<b><%- value %></b>', { 'value': '<script>' });
|
@@ -5745,16 +5976,16 @@
|
|
5745
5976
|
*
|
5746
5977
|
* // using the "evaluate" delimiter to generate HTML
|
5747
5978
|
* var list = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>';
|
5748
|
-
* _.template(list, { 'people': ['
|
5749
|
-
* // => '<li>
|
5979
|
+
* _.template(list, { 'people': ['fred', 'barney'] });
|
5980
|
+
* // => '<li>fred</li><li>barney</li>'
|
5750
5981
|
*
|
5751
5982
|
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
|
5752
|
-
* _.template('hello ${ name }', { 'name': '
|
5753
|
-
* // => 'hello
|
5983
|
+
* _.template('hello ${ name }', { 'name': 'pebbles' });
|
5984
|
+
* // => 'hello pebbles'
|
5754
5985
|
*
|
5755
5986
|
* // using the internal `print` function in "evaluate" delimiters
|
5756
|
-
* _.template('<% print("hello " + name); %>!', { 'name': '
|
5757
|
-
* // => 'hello
|
5987
|
+
* _.template('<% print("hello " + name); %>!', { 'name': 'barney' });
|
5988
|
+
* // => 'hello barney!'
|
5758
5989
|
*
|
5759
5990
|
* // using a custom template delimiters
|
5760
5991
|
* _.templateSettings = {
|
@@ -5766,8 +5997,8 @@
|
|
5766
5997
|
*
|
5767
5998
|
* // using the `imports` option to import jQuery
|
5768
5999
|
* var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
5769
|
-
* _.template(list, { 'people': ['
|
5770
|
-
* // => '<li>
|
6000
|
+
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
|
6001
|
+
* // => '<li>fred</li><li>barney</li>'
|
5771
6002
|
*
|
5772
6003
|
* // using the `sourceURL` option to specify a custom sourceURL for the template
|
5773
6004
|
* var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
|
@@ -5797,7 +6028,7 @@
|
|
5797
6028
|
// and Laura Doktorova's doT.js
|
5798
6029
|
// https://github.com/olado/doT
|
5799
6030
|
var settings = lodash.templateSettings;
|
5800
|
-
text
|
6031
|
+
text = String(text || '');
|
5801
6032
|
|
5802
6033
|
// avoid missing dependencies when `iteratorTemplate` is not defined
|
5803
6034
|
options = defaults({}, options, settings);
|
@@ -5938,8 +6169,8 @@
|
|
5938
6169
|
* @returns {string} Returns the unescaped string.
|
5939
6170
|
* @example
|
5940
6171
|
*
|
5941
|
-
* _.unescape('
|
5942
|
-
* // => '
|
6172
|
+
* _.unescape('Fred, Barney & Pebbles');
|
6173
|
+
* // => 'Fred, Barney & Pebbles'
|
5943
6174
|
*/
|
5944
6175
|
function unescape(string) {
|
5945
6176
|
return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);
|
@@ -5979,18 +6210,18 @@
|
|
5979
6210
|
* @returns {Object} Returns the wrapper object.
|
5980
6211
|
* @example
|
5981
6212
|
*
|
5982
|
-
* var
|
5983
|
-
* { 'name': '
|
5984
|
-
* { 'name': '
|
5985
|
-
* { 'name': '
|
6213
|
+
* var characters = [
|
6214
|
+
* { 'name': 'barney', 'age': 36 },
|
6215
|
+
* { 'name': 'fred', 'age': 40 },
|
6216
|
+
* { 'name': 'pebbles', 'age': 1 }
|
5986
6217
|
* ];
|
5987
6218
|
*
|
5988
|
-
* var youngest = _.chain(
|
6219
|
+
* var youngest = _.chain(characters)
|
5989
6220
|
* .sortBy('age')
|
5990
|
-
* .map(function(
|
6221
|
+
* .map(function(chr) { return chr.name + ' is ' + chr.age; })
|
5991
6222
|
* .first()
|
5992
6223
|
* .value();
|
5993
|
-
* // => '
|
6224
|
+
* // => 'pebbles is 1'
|
5994
6225
|
*/
|
5995
6226
|
function chain(value) {
|
5996
6227
|
value = new lodashWrapper(value);
|
@@ -6013,12 +6244,10 @@
|
|
6013
6244
|
* @example
|
6014
6245
|
*
|
6015
6246
|
* _([1, 2, 3, 4])
|
6016
|
-
* .
|
6017
|
-
* .
|
6018
|
-
* .map(function(num) { return num * num; })
|
6247
|
+
* .tap(function(array) { array.pop(); })
|
6248
|
+
* .reverse()
|
6019
6249
|
* .value();
|
6020
|
-
* // =>
|
6021
|
-
* // => [4, 16]
|
6250
|
+
* // => [3, 2, 1]
|
6022
6251
|
*/
|
6023
6252
|
function tap(value, interceptor) {
|
6024
6253
|
interceptor(value);
|
@@ -6034,21 +6263,21 @@
|
|
6034
6263
|
* @returns {*} Returns the wrapper object.
|
6035
6264
|
* @example
|
6036
6265
|
*
|
6037
|
-
* var
|
6038
|
-
* { 'name': '
|
6039
|
-
* { 'name': '
|
6266
|
+
* var characters = [
|
6267
|
+
* { 'name': 'barney', 'age': 36 },
|
6268
|
+
* { 'name': 'fred', 'age': 40 }
|
6040
6269
|
* ];
|
6041
6270
|
*
|
6042
6271
|
* // without explicit chaining
|
6043
|
-
* _(
|
6044
|
-
* // => { 'name': '
|
6272
|
+
* _(characters).first();
|
6273
|
+
* // => { 'name': 'barney', 'age': 36 }
|
6045
6274
|
*
|
6046
6275
|
* // with explicit chaining
|
6047
|
-
* _(
|
6276
|
+
* _(characters).chain()
|
6048
6277
|
* .first()
|
6049
6278
|
* .pick('age')
|
6050
6279
|
* .value()
|
6051
|
-
* // => { 'age':
|
6280
|
+
* // => { 'age': 36 }
|
6052
6281
|
*/
|
6053
6282
|
function wrapperChain() {
|
6054
6283
|
this.__chain__ = true;
|
@@ -6101,6 +6330,7 @@
|
|
6101
6330
|
lodash.compact = compact;
|
6102
6331
|
lodash.compose = compose;
|
6103
6332
|
lodash.countBy = countBy;
|
6333
|
+
lodash.create = create;
|
6104
6334
|
lodash.createCallback = createCallback;
|
6105
6335
|
lodash.curry = curry;
|
6106
6336
|
lodash.debounce = debounce;
|
@@ -6210,6 +6440,7 @@
|
|
6210
6440
|
lodash.lastIndexOf = lastIndexOf;
|
6211
6441
|
lodash.mixin = mixin;
|
6212
6442
|
lodash.noConflict = noConflict;
|
6443
|
+
lodash.noop = noop;
|
6213
6444
|
lodash.parseInt = parseInt;
|
6214
6445
|
lodash.random = random;
|
6215
6446
|
lodash.reduce = reduce;
|
@@ -6282,7 +6513,7 @@
|
|
6282
6513
|
* @memberOf _
|
6283
6514
|
* @type string
|
6284
6515
|
*/
|
6285
|
-
lodash.VERSION = '2.
|
6516
|
+
lodash.VERSION = '2.3.0';
|
6286
6517
|
|
6287
6518
|
// add "Chaining" functions to the wrapper
|
6288
6519
|
lodash.prototype.chain = wrapperChain;
|
@@ -6328,7 +6559,7 @@
|
|
6328
6559
|
// expose Lo-Dash
|
6329
6560
|
var _ = runInContext();
|
6330
6561
|
|
6331
|
-
// some AMD build optimizers
|
6562
|
+
// some AMD build optimizers like r.js check for condition patterns like the following:
|
6332
6563
|
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
|
6333
6564
|
// Expose Lo-Dash to the global object even when an AMD loader is present in
|
6334
6565
|
// case Lo-Dash was injected by a third-party script and not intended to be
|