lodash-rails 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.compat.js +1003 -800
- data/vendor/assets/javascripts/lodash.compat.min.js +89 -88
- data/vendor/assets/javascripts/lodash.js +1000 -796
- data/vendor/assets/javascripts/lodash.min.js +85 -85
- metadata +2 -2
@@ -1,92 +1,93 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
|
-
* lodash 3.
|
3
|
+
* lodash 3.6.0 (Custom Build) lodash.com/license | Underscore.js 1.8.2 underscorejs.org/LICENSE
|
4
4
|
* Build: `lodash compat -o ./lodash.js`
|
5
5
|
*/
|
6
|
-
;(function(){function n(n,t){if(n!==t){var r=n===n,e=t===t;if(n>t||!r||typeof n=="undefined"&&e)return 1;if(n<t||!e||typeof t=="undefined"&&r)return-1}return 0}function t(n,t,r){if(t!==t)return
|
7
|
-
}function a(t,r){return n(t.a,r.a)||t.b-r.b}function
|
8
|
-
return o}function
|
9
|
-
}function Lt(){this.__data__={}}function $t(n){var t=n?n.length:0;for(this.data={hash:
|
10
|
-
t(i,r,n)&&(o[++u]=i)}return o}function Yt(n,t){for(var r=-1,e=n.length,u=
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
n
|
15
|
-
}function
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
return
|
22
|
-
f?(
|
23
|
-
(
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}}
|
29
|
-
|
30
|
-
}return
|
31
|
-
|
32
|
-
}function
|
33
|
-
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
return e
|
39
|
-
|
40
|
-
}function
|
41
|
-
}}function
|
42
|
-
|
43
|
-
|
44
|
-
return
|
45
|
-
}function
|
46
|
-
for(var l in n)c&&"prototype"==l||
|
47
|
-
}function
|
48
|
-
|
49
|
-
|
50
|
-
}catch(r){}return t}(),
|
51
|
-
var Oo={};Oo[
|
52
|
-
try{
|
53
|
-
o.set(new
|
54
|
-
}),
|
55
|
-
|
56
|
-
})
|
57
|
-
|
58
|
-
},
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
},Ut.
|
63
|
-
|
64
|
-
return
|
65
|
-
}
|
66
|
-
|
67
|
-
},Ut.
|
68
|
-
|
69
|
-
},Ut.
|
70
|
-
},Ut.
|
71
|
-
|
72
|
-
},Ut.
|
73
|
-
},Ut.
|
74
|
-
},Ut.isDate=function(n){return
|
75
|
-
if(e=t[i],
|
76
|
-
else if(r)return u=
|
77
|
-
var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=
|
78
|
-
return
|
79
|
-
var o,i,
|
80
|
-
}),t.source=
|
81
|
-
if(t=n.slice(0,
|
82
|
-
return
|
83
|
-
}}),
|
84
|
-
Nt.prototype[n]=function(){return this[r](1).value()[0]}}),
|
85
|
-
return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},Nt.prototype.toArray=function(){return this.drop(0)},
|
86
|
-
}}),
|
87
|
-
})}}),Nt.prototype.clone=function(){var n=this.__actions__,t=this.__iteratees__,r=this.__views__,e=new Nt(this.__wrapped__);return e.__actions__=n?Bt(n):null,e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=t?Bt(t):null,e.__takeCount__=this.__takeCount__,e.__views__=r?Bt(r):null,e},Nt.prototype.reverse=function(){if(this.__filtered__){var n=new Nt(this);
|
88
|
-
if(!
|
89
|
-
}else if(p=h(s),_==
|
90
|
-
})},Ut.prototype.toString=function(){return this.value()+""},Ut.prototype.run=Ut.prototype.toJSON=Ut.prototype.valueOf=Ut.prototype.value=function(){return
|
91
|
-
|
92
|
-
|
6
|
+
;(function(){function n(n,t){if(n!==t){var r=n===n,e=t===t;if(n>t||!r||typeof n=="undefined"&&e)return 1;if(n<t||!e||typeof t=="undefined"&&r)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return typeof n=="function"||false}function u(n){return typeof n=="string"?n:null==n?"":n+""}function o(n){return n.charCodeAt(0)}function i(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););return r
|
7
|
+
}function f(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function a(t,r){return n(t.a,r.a)||t.b-r.b}function c(n){return Ut[n]}function l(n){return Ft[n]}function s(n){return"\\"+Lt[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n)}function g(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=P,o[++u]=r);
|
8
|
+
return o}function v(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Wt[n]}function m(_){function Ut(n){if(h(n)&&!(yi(n)||n instanceof Nt)){if(n instanceof Wt)return n;if(Pu.call(n,"__chain__")&&Pu.call(n,"__wrapped__"))return ke(n)}return new Wt(n)}function Ft(){}function Wt(n,t,r){this.__wrapped__=n,this.__actions__=r||[],this.__chain__=!!t}function Nt(n){this.__wrapped__=n,this.__actions__=null,this.__dir__=1,this.__filtered__=false,this.__iteratees__=null,this.__takeCount__=go,this.__views__=null
|
9
|
+
}function Lt(){this.__data__={}}function $t(n){var t=n?n.length:0;for(this.data={hash:oo(null),set:new Hu};t--;)this.push(n[t])}function Pt(n,t){var r=n.data;return(typeof t=="string"||nu(t)?r.set.has(t):r.hash[t])?0:-1}function Bt(n,t){var r=-1,e=n.length;for(t||(t=xu(e));++r<e;)t[r]=n[r];return t}function zt(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););return n}function Kt(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Vt(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];
|
10
|
+
t(i,r,n)&&(o[++u]=i)}return o}function Yt(n,t){for(var r=-1,e=n.length,u=xu(e);++r<e;)u[r]=t(n[r],r,n);return u}function Zt(n){for(var t=-1,r=n.length,e=_o;++t<r;){var u=n[t];u>e&&(e=u)}return e}function Gt(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;return false}function Jt(n,t){return typeof n=="undefined"?t:n}function Xt(n,t,r,e){return typeof n!="undefined"&&Pu.call(e,r)?n:t}function Ht(n,t,r){var e=Ri(t);if(!r)return nr(t,n,e);for(var u=-1,o=e.length;++u<o;){var i=e[u],f=n[i],a=r(f,t[i],i,n,t);
|
11
|
+
(a===a?a===f:f!==f)&&(typeof f!="undefined"||i in n)||(n[i]=a)}return n}function Qt(n,t){for(var r=-1,e=n.length,u=we(e),o=t.length,i=xu(o);++r<o;){var f=t[r];u?(f=parseFloat(f),i[r]=ye(f,e)?n[f]:w):i[r]=n[f]}return i}function nr(n,t,r){r||(r=t,t={});for(var e=-1,u=r.length;++e<u;){var o=r[e];t[o]=n[o]}return t}function tr(n,t,r){var e=typeof n;return"function"==e?typeof t=="undefined"?n:Fr(n,t,r):null==n?du:"object"==e?yr(n):typeof t=="undefined"?wr(n+""):dr(n+"",t)}function rr(n,t,r,e,u,o,i){var f;
|
12
|
+
if(r&&(f=u?r(n,e,u):r(n)),typeof f!="undefined")return f;if(!nu(n))return n;if(e=yi(n)){if(f=_e(n),!t)return Bt(n,f)}else{var a=zu.call(n),c=a==K;if(a!=Y&&a!=B&&(!c||u))return Ct[a]?ve(n,a,t):u?n:{};if(Dt(n))return u?n:{};if(f=ge(c?{}:n),!t)return nr(n,f,Ri(n))}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(f),(e?zt:lr)(n,function(e,u){f[u]=rr(e,t,r,u,n,o,i)}),f}function er(n,t,r){if(typeof n!="function")throw new Cu($);return Qu(function(){n.apply(w,r)},t)
|
13
|
+
}function ur(n,t){var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=he(),f=i==r,a=f&&200<=t.length?Uo(t):null,c=t.length;a&&(i=Pt,f=false,t=a);n:for(;++o<e;)if(a=n[o],f&&a===a){for(var l=c;l--;)if(t[l]===a)continue n;u.push(a)}else 0>i(t,a,0)&&u.push(a);return u}function or(n,t){var r=true;return ko(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ir(n,t){var r=[];return ko(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function fr(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0
|
14
|
+
}),u}function ar(n,t,r){for(var e=-1,u=n.length,o=-1,i=[];++e<u;){var f=n[e];if(h(f)&&we(f.length)&&(yi(f)||Xe(f))){t&&(f=ar(f,t,r));var a=-1,c=f.length;for(i.length+=c;++a<c;)i[++o]=f[a]}else r||(i[++o]=f)}return i}function cr(n,t){So(n,t,au)}function lr(n,t){return So(n,t,Ri)}function sr(n,t){return Co(n,t,Ri)}function pr(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];mi(n[i])&&(o[++u]=i)}return o}function hr(n,t,r,e,u,o){if(n===t)return 0!==n||1/n==1/t;var i=typeof n,f=typeof t;return"function"!=i&&"object"!=i&&"function"!=f&&"object"!=f||null==n||null==t?n!==n&&t!==t:_r(n,t,hr,r,e,u,o)
|
15
|
+
}function _r(n,t,r,e,u,o,i){var f=yi(n),a=yi(t),c=z,l=z;f||(c=zu.call(n),c==B?c=Y:c!=Y&&(f=ou(n))),a||(l=zu.call(t),l==B?l=Y:l!=Y&&ou(t));var s=(c==Y||u&&c==K)&&!Dt(n),a=(l==Y||u&&l==K)&&!Dt(t);if((l=c==l)&&!f&&!s)return ce(n,t,c);if(u){if(!(l||s&&a))return false}else{if(c=s&&Pu.call(n,"__wrapped__"),a=a&&Pu.call(t,"__wrapped__"),c||a)return r(c?n.value():n,a?t.value():t,e,u,o,i);if(!l)return false}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c]==t;return o.push(n),i.push(t),n=(f?ae:le)(n,t,r,e,u,o,i),o.pop(),i.pop(),n
|
16
|
+
}function gr(n,t,r,e,u){for(var o=-1,i=t.length,f=!u;++o<i;)if(f&&e[o]?r[o]!==n[t[o]]:!(t[o]in n))return false;for(o=-1;++o<i;){var a=t[o],c=n[a],l=r[o];if(f&&e[o]?a=typeof c!="undefined"||a in n:(a=u?u(c,l,a):w,typeof a=="undefined"&&(a=hr(l,c,u,true))),!a)return false}return true}function vr(n,t){var r=[];return ko(n,function(n,e,u){r.push(t(n,e,u))}),r}function yr(n){var t=Ri(n),r=t.length;if(!r)return yu(true);if(1==r){var e=t[0],u=n[e];if(be(u))return function(n){return null!=n&&n[e]===u&&(typeof u!="undefined"||e in Ie(n))
|
17
|
+
}}for(var o=xu(r),i=xu(r);r--;)u=n[t[r]],o[r]=u,i[r]=be(u);return function(n){return null!=n&&gr(Ie(n),t,o,i)}}function dr(n,t){return be(t)?function(r){return null!=r&&r[n]===t&&(typeof t!="undefined"||n in Ie(r))}:function(r){return null!=r&&hr(t,r[n],null,true)}}function mr(n,t,r,e,u){if(!nu(n))return n;var o=we(t.length)&&(yi(t)||ou(t));return(o?zt:lr)(t,function(t,i,f){if(h(t)){e||(e=[]),u||(u=[]);n:{t=e;for(var a=u,c=t.length,l=f[i];c--;)if(t[c]==l){n[i]=a[c],i=void 0;break n}c=n[i],f=r?r(c,l,i,n,f):w;
|
18
|
+
var s=typeof f=="undefined";s&&(f=l,we(l.length)&&(yi(l)||ou(l))?f=yi(c)?c:c&&c.length?Bt(c):[]:wi(l)||Xe(l)?f=Xe(c)?iu(c):wi(c)?c:{}:s=false),t.push(l),a.push(f),s?n[i]=mr(f,l,r,t,a):(f===f?f!==c:c===c)&&(n[i]=f),i=void 0}return i}a=n[i],f=r?r(a,t,i,n,f):w,(l=typeof f=="undefined")&&(f=t),!o&&typeof f=="undefined"||!l&&(f===f?f===a:a!==a)||(n[i]=f)}),n}function wr(n){return function(t){return null==t?w:t[n]}}function br(n,t){return n+Zu(ho()*(t-n+1))}function xr(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)
|
19
|
+
}),r}function Ar(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r=typeof r=="undefined"||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=xu(u);++e<u;)r[e]=n[e+t];return r}function jr(n,t){var r;return ko(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function Or(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function Er(t,r,e){var u=-1,o=t.length,i=we(o)?xu(o):[];return ko(t,function(n){for(var t=r.length,e=xu(t);t--;)e[t]=null==n?w:n[r[t]];i[++u]={a:e,b:u,c:n}}),Or(i,function(t,r){var u;
|
20
|
+
n:{u=-1;for(var o=t.a,i=r.a,f=o.length,a=e.length;++u<f;){var c=n(o[u],i[u]);if(c){u=u<a?c*(e[u]?1:-1):c;break n}}u=t.b-r.b}return u})}function Ir(n,t){var r=0;return ko(n,function(n,e,u){r+=+t(n,e,u)||0}),r}function kr(n,t){var e=-1,u=he(),o=n.length,i=u==r,f=i&&200<=o,a=f?Uo():null,c=[];a?(u=Pt,i=false):(f=false,a=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=a.length;p--;)if(a[p]===s)continue n;t&&a.push(s),c.push(l)}else 0>u(a,s,0)&&((t||f)&&a.push(s),c.push(l))}return c}function Rr(n,t){for(var r=-1,e=t.length,u=xu(e);++r<e;)u[r]=n[t[r]];
|
21
|
+
return u}function Sr(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););return r?Ar(n,e?0:o,e?o+1:u):Ar(n,e?o+1:0,e?u:o)}function Cr(n,t){var r=n;r instanceof Nt&&(r=r.value());for(var e=-1,u=t.length;++e<u;){var r=[r],o=t[e];Ju.apply(r,o.args),r=o.func.apply(o.thisArg,r)}return r}function Tr(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=mo){for(;e<u;){var o=e+u>>>1,i=n[o];(r?i<=t:i<t)?e=o+1:u=o}return u}return Ur(n,t,du,r)}function Ur(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=typeof t=="undefined";u<o;){var a=Zu((u+o)/2),c=r(n[a]),l=c===c;
|
22
|
+
(i?l||e:f?l&&(e||typeof c!="undefined"):e?c<=t:c<t)?u=a+1:o=a}return co(o,yo)}function Fr(n,t,r){if(typeof n!="function")return du;if(typeof t=="undefined")return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o)};case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function Wr(n){return Ku.call(n,0)}function Nr(n,t,r){for(var e=r.length,u=-1,o=ao(n.length-e,0),i=-1,f=t.length,a=xu(o+f);++i<f;)a[i]=t[i];
|
23
|
+
for(;++u<e;)a[r[u]]=n[u];for(;o--;)a[i++]=n[u++];return a}function Lr(n,t,r){for(var e=-1,u=r.length,o=-1,i=ao(n.length-u,0),f=-1,a=t.length,c=xu(i+a);++o<i;)c[o]=n[o];for(i=o;++f<a;)c[i+f]=t[f];for(;++e<u;)c[i+r[e]]=n[o++];return c}function $r(n,t){return function(r,e,u){var o=t?t():{};if(e=pe(e,u,3),yi(r)){u=-1;for(var i=r.length;++u<i;){var f=r[u];n(o,f,e(f,u,r),r)}}else ko(r,function(t,r,u){n(o,t,e(t,r,u),u)});return o}}function Pr(n){return function(){var t=arguments,r=t.length,e=t[0];if(2>r||null==e)return e;
|
24
|
+
var u=t[r-2],o=t[r-1],i=t[3];for(3<r&&typeof u=="function"?(u=Fr(u,o,5),r-=2):(u=2<r&&typeof o=="function"?o:null,r-=u?1:0),i&&de(t[1],t[2],i)&&(u=3==r?null:u,r=2),o=0;++o<r;)(i=t[o])&&n(e,i,u);return e}}function Br(n,t){return function(r,e){var u=r?r.length:0;if(!we(u))return n(r,e);for(var o=t?u:-1,i=Ie(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}function zr(n){return function(t,r,e){var u=Ie(t);e=e(t);for(var o=e.length,i=n?o:-1;n?i--:++i<o;){var f=e[i];if(false===r(u[f],f,u))break}return t}}function Mr(n,t){function r(){return(this&&this!==Mt&&this instanceof r?e:n).apply(t,arguments)
|
25
|
+
}var e=qr(n);return r}function Dr(n){return function(t){var r=-1;t=gu(lu(t));for(var e=t.length,u="";++r<e;)u=n(u,t[r],r);return u}}function qr(n){return function(){var t=Io(n.prototype),r=n.apply(t,arguments);return nu(r)?r:t}}function Kr(n){function t(r,e,u){return u&&de(r,e,u)&&(e=null),r=fe(r,n,null,null,null,null,null,e),r.placeholder=t.placeholder,r}return t}function Vr(n,t){return function(r,e,u){u&&de(r,e,u)&&(e=null);var i=pe(),f=null==e;if(i===tr&&f||(f=false,e=i(e,u,3)),f){if(e=yi(r),e||!uu(r))return n(e?r:Ee(r));
|
26
|
+
e=o}return se(r,e,t)}}function Yr(n,r){return function(e,u,o){return u=pe(u,o,3),yi(e)?(u=t(e,u,r),-1<u?e[u]:w):fr(e,u,n)}}function Zr(n){return function(r,e,u){return r&&r.length?(e=pe(e,u,3),t(r,e,n)):-1}}function Gr(n){return function(t,r,e){return r=pe(r,e,3),fr(t,r,n,true)}}function Jr(n){return function(){var t=arguments.length;if(!t)return function(){return arguments[0]};for(var r,e=n?t:-1,u=0,o=xu(t);n?e--:++e<t;){var i=o[u++]=arguments[e];if(typeof i!="function")throw new Cu($);var f=r?"":Wo(i);
|
27
|
+
r="wrapper"==f?new Wt([]):r}for(e=r?-1:t;++e<t;)i=o[e],f=Wo(i),r=(u="wrapper"==f?Fo(i):null)&&me(u[0])?r[Wo(u[0])].apply(r,u[3]):1==i.length&&me(i)?r[f]():r.thru(i);return function(){var n=arguments;if(r&&1==n.length&&yi(n[0]))return r.plant(n[0]).value();for(var e=0,n=o[e].apply(this,n);++e<t;)n=o[e].call(this,n);return n}}}function Xr(n,t){return function(r,e,u){return typeof e=="function"&&typeof u=="undefined"&&yi(r)?n(r,e):t(r,Fr(e,u,3))}}function Hr(n){return function(t,r,e){return(typeof r!="function"||typeof e!="undefined")&&(r=Fr(r,e,3)),n(t,r,au)
|
28
|
+
}}function Qr(n){return function(t,r,e){return(typeof r!="function"||typeof e!="undefined")&&(r=Fr(r,e,3)),n(t,r)}}function ne(n){return function(t,r,e){return(t=u(t))&&(n?t:"")+ue(t,r,e)+(n?"":t)}}function te(n){var t=Je(function(r,e){var u=g(e,t.placeholder);return fe(r,n,null,e,u)});return t}function re(n,t){return function(r,e,u,o){var i=3>arguments.length;return typeof e=="function"&&typeof o=="undefined"&&yi(r)?n(r,e,u,i):xr(r,pe(e,o,4),u,i,t)}}function ee(n,t,r,e,u,o,i,f,a,c){function l(){for(var b=arguments.length,j=b,O=xu(b);j--;)O[j]=arguments[j];
|
29
|
+
if(e&&(O=Nr(O,e,u)),o&&(O=Lr(O,o,i)),_||y){var j=l.placeholder,E=g(O,j),b=b-E.length;if(b<c){var R=f?Bt(f):null,b=ao(c-b,0),S=_?E:null,E=_?null:E,C=_?O:null,O=_?null:O;return t|=_?I:k,t&=~(_?k:I),v||(t&=~(x|A)),O=[n,t,r,C,S,O,E,R,a,b],R=ee.apply(w,O),me(n)&&No(R,O),R.placeholder=j,R}}if(j=p?r:this,h&&(n=j[m]),f)for(R=O.length,b=co(f.length,R),S=Bt(O);b--;)E=f[b],O[b]=ye(E,R)?S[E]:w;return s&&a<O.length&&(O.length=a),(this&&this!==Mt&&this instanceof l?d||qr(n):n).apply(j,O)}var s=t&R,p=t&x,h=t&A,_=t&O,v=t&j,y=t&E,d=!h&&qr(n),m=n;
|
30
|
+
return l}function ue(n,t,r){return n=n.length,t=+t,n<t&&io(t)?(t-=n,r=null==r?" ":r+"",hu(r,Vu(t/r.length)).slice(0,t)):""}function oe(n,t,r,e){function u(){for(var t=-1,f=arguments.length,a=-1,c=e.length,l=xu(f+c);++a<c;)l[a]=e[a];for(;f--;)l[a++]=arguments[++t];return(this&&this!==Mt&&this instanceof u?i:n).apply(o?r:this,l)}var o=t&x,i=qr(n);return u}function ie(n){return function(t,r,e,u){var o=pe(e);return o===tr&&null==e?Tr(t,r,n):Ur(t,r,o(e,u,1),n)}}function fe(n,t,r,e,u,o,i,f){var a=t&A;if(!a&&typeof n!="function")throw new Cu($);
|
31
|
+
var c=e?e.length:0;if(c||(t&=~(I|k),e=u=null),c-=u?u.length:0,t&k){var l=e,s=u;e=u=null}var p=a?null:Fo(n);return r=[n,t,r,e,u,l,s,o,i,f],p&&(e=r[1],t=p[1],f=e|t,u=t==R&&e==O||t==R&&e==S&&r[7].length<=p[8]||t==(R|S)&&e==O,(f<R||u)&&(t&x&&(r[2]=p[2],f|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Nr(u,e,p[4]):Bt(e),r[4]=u?g(r[3],P):Bt(p[4])),(e=p[5])&&(u=r[5],r[5]=u?Lr(u,e,p[6]):Bt(e),r[6]=u?g(r[5],P):Bt(p[6])),(e=p[7])&&(r[7]=Bt(e)),t&R&&(r[8]=null==r[8]?p[8]:co(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=f),t=r[1],f=r[9]),r[9]=null==f?a?0:n.length:ao(f-c,0)||0,(p?To:No)(t==x?Mr(r[0],r[2]):t!=I&&t!=(x|I)||r[4].length?ee.apply(w,r):oe.apply(w,r),r)
|
32
|
+
}function ae(n,t,r,e,u,o,i){var f=-1,a=n.length,c=t.length,l=true;if(a!=c&&(!u||c<=a))return false;for(;l&&++f<a;){var s=n[f],p=t[f],l=w;if(e&&(l=u?e(p,s,f):e(s,p,f)),typeof l=="undefined")if(u)for(var h=c;h--&&(p=t[h],!(l=s&&s===p||r(s,p,e,u,o,i))););else l=s&&s===p||r(s,p,e,u,o,i)}return!!l}function ce(n,t,r){switch(r){case M:case D:return+n==+t;case q:return n.name==t.name&&n.message==t.message;case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Z:case G:return n==t+""}return false}function le(n,t,r,e,u,o,i){var f=Ri(n),a=f.length,c=Ri(t).length;
|
33
|
+
if(a!=c&&!u)return false;for(var c=u,l=-1;++l<a;){var s=f[l],p=u?s in t:Pu.call(t,s);if(p){var h=n[s],_=t[s],p=w;e&&(p=u?e(_,h,s):e(h,_,s)),typeof p=="undefined"&&(p=h&&h===_||r(h,_,e,u,o,i))}if(!p)return false;c||(c="constructor"==s)}return c||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function se(n,t,r){var e=r?go:_o,u=e,o=u;return ko(n,function(n,i,f){i=t(n,i,f),((r?i<u:i>u)||i===e&&i===o)&&(u=i,o=n)
|
34
|
+
}),o}function pe(n,t,r){var e=Ut.callback||vu,e=e===vu?tr:e;return r?e(n,t,r):e}function he(n,t,e){var u=Ut.indexOf||Te,u=u===Te?r:u;return n?u(n,t,e):u}function _e(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Pu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function ge(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=ku),new n}function ve(n,t,r){var e=n.constructor;switch(t){case J:return Wr(n);case M:case D:return new e(+n);case X:case H:case Q:case nt:case tt:case rt:case et:case ut:case ot:return e instanceof e&&(e=jo[t]),t=n.buffer,new e(r?Wr(t):t,n.byteOffset,n.length);
|
35
|
+
case V:case G:return new e(n);case Z:var u=new e(n.source,dt.exec(n));u.lastIndex=n.lastIndex}return u}function ye(n,t){return n=+n,t=null==t?bo:t,-1<n&&0==n%1&&n<t}function de(n,t,r){if(!nu(r))return false;var e=typeof t;return"number"==e?(e=r.length,e=we(e)&&ye(t,e)):e="string"==e&&t in r,e?(t=r[t],n===n?n===t:t!==t):false}function me(n){var t=Wo(n);return!!t&&n===Ut[t]&&t in Nt.prototype}function we(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=bo}function be(n){return n===n&&(0===n?0<1/n:!nu(n))}function xe(n,t){n=Ie(n);
|
36
|
+
for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u}function Ae(n,t){var r={};return cr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function je(n){var t,r=Ut.support;if(!h(n)||zu.call(n)!=Y||Dt(n)||!(Pu.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t))||!r.argsTag&&Xe(n))return false;var e;return r.ownLast?(cr(n,function(n,t,r){return e=Pu.call(r,t),false}),false!==e):(cr(n,function(n,t){e=t}),typeof e=="undefined"||Pu.call(n,e))}function Oe(n){for(var t=au(n),r=t.length,e=r&&n.length,u=Ut.support,u=e&&we(e)&&(yi(n)||u.nonEnumStrings&&uu(n)||u.nonEnumArgs&&Xe(n)),o=-1,i=[];++o<r;){var f=t[o];
|
37
|
+
(u&&ye(f,e)||Pu.call(n,f))&&i.push(f)}return i}function Ee(n){return null==n?[]:we(n.length)?Ut.support.unindexedChars&&uu(n)?n.split(""):nu(n)?n:ku(n):cu(n)}function Ie(n){if(Ut.support.unindexedChars&&uu(n)){for(var t=-1,r=n.length,e=ku(n);++t<r;)e[t]=n.charAt(t);return e}return nu(n)?n:ku(n)}function ke(n){return n instanceof Nt?n.clone():new Wt(n.__wrapped__,n.__chain__,Bt(n.__actions__))}function Re(n,t,r){return n&&n.length?((r?de(n,t,r):null==t)&&(t=1),Ar(n,0>t?0:t)):[]}function Se(n,t,r){var e=n?n.length:0;
|
38
|
+
return e?((r?de(n,t,r):null==t)&&(t=1),t=e-(+t||0),Ar(n,0,0>t?0:t)):[]}function Ce(n){return n?n[0]:w}function Te(n,t,e){var u=n?n.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?ao(u+e,0):e;else if(e)return e=Tr(n,t),n=n[e],(t===t?t===n:n!==n)?e:-1;return r(n,t,e||0)}function Ue(n){var t=n?n.length:0;return t?n[t-1]:w}function Fe(n){return Re(n,1)}function We(n,t,e,u){if(!n||!n.length)return[];null!=t&&typeof t!="boolean"&&(u=e,e=de(n,t,u)?null:t,t=false);var o=pe();if((o!==tr||null!=e)&&(e=o(e,u,3)),t&&he()==r){t=e;
|
39
|
+
var i;e=-1,u=n.length;for(var o=-1,f=[];++e<u;){var a=n[e],c=t?t(a,e,n):a;e&&i===c||(i=c,f[++o]=a)}n=f}else n=kr(n,e);return n}function Ne(n){for(var t=-1,r=(n&&n.length&&Zt(Yt(n,$u)))>>>0,e=xu(r);++t<r;)e[t]=Yt(n,wr(t));return e}function Le(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||yi(n[0])||(t=[]);++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function $e(n){return n=Ut(n),n.__chain__=true,n}function Pe(n,t,r){return t.call(r,n)}function Be(n,t,r){var e=yi(n)?Kt:or;return r&&de(n,t,r)&&(t=null),(typeof t!="function"||typeof r!="undefined")&&(t=pe(t,r,3)),e(n,t)
|
40
|
+
}function ze(n,t,r){var e=yi(n)?Vt:ir;return t=pe(t,r,3),e(n,t)}function Me(n,t,r,e){var u=n?n.length:0;return we(u)||(n=cu(n),u=n.length),u?(r=typeof r!="number"||e&&de(t,r,e)?0:0>r?ao(u+r,0):r||0,typeof n=="string"||!yi(n)&&uu(n)?r<u&&-1<n.indexOf(t,r):-1<he(n,t,r)):false}function De(n,t,r){var e=yi(n)?Yt:vr;return t=pe(t,r,3),e(n,t)}function qe(n,t,r){return(r?de(n,t,r):null==t)?(n=Ee(n),t=n.length,0<t?n[br(0,t-1)]:w):(n=Ke(n),n.length=co(0>t?0:+t||0,n.length),n)}function Ke(n){n=Ee(n);for(var t=-1,r=n.length,e=xu(r);++t<r;){var u=br(0,t);
|
41
|
+
t!=u&&(e[t]=e[u]),e[u]=n[t]}return e}function Ve(n,t,r){var e=yi(n)?Gt:jr;return r&&de(n,t,r)&&(t=null),(typeof t!="function"||typeof r!="undefined")&&(t=pe(t,r,3)),e(n,t)}function Ye(n,t){var r;if(typeof t!="function"){if(typeof n!="function")throw new Cu($);var e=n;n=t,t=e}return function(){return 0<--n?r=t.apply(this,arguments):t=null,r}}function Ze(n,t,r){function e(){var r=t-(ui()-c);0>=r||r>t?(f&&Yu(f),r=p,f=s=p=w,r&&(h=ui(),a=n.apply(l,i),s||f||(i=l=null))):s=Qu(e,r)}function u(){s&&Yu(s),f=s=p=w,(g||_!==t)&&(h=ui(),a=n.apply(l,i),s||f||(i=l=null))
|
42
|
+
}function o(){if(i=arguments,c=ui(),l=this,p=g&&(s||!v),false===_)var r=v&&!s;else{f||v||(h=c);var o=_-(c-h),y=0>=o||o>_;y?(f&&(f=Yu(f)),h=c,a=n.apply(l,i)):f||(f=Qu(u,o))}return y&&s?s=Yu(s):s||t===_||(s=Qu(e,t)),r&&(y=true,a=n.apply(l,i)),!y||s||f||(i=l=null),a}var i,f,a,c,l,s,p,h=0,_=false,g=true;if(typeof n!="function")throw new Cu($);if(t=0>t?0:+t||0,true===r)var v=true,g=false;else nu(r)&&(v=r.leading,_="maxWait"in r&&ao(+r.maxWait||0,t),g="trailing"in r?r.trailing:g);return o.cancel=function(){s&&Yu(s),f&&Yu(f),f=s=p=w
|
43
|
+
},o}function Ge(n,t){function r(){var e=arguments,u=r.cache,o=t?t.apply(this,e):e[0];return u.has(o)?u.get(o):(e=n.apply(this,e),u.set(o,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new Cu($);return r.cache=new Ge.Cache,r}function Je(n,t){if(typeof n!="function")throw new Cu($);return t=ao(typeof t=="undefined"?n.length-1:+t||0,0),function(){for(var r=arguments,e=-1,u=ao(r.length-t,0),o=xu(u);++e<u;)o[e]=r[t+e];switch(t){case 0:return n.call(this,o);case 1:return n.call(this,r[0],o);
|
44
|
+
case 2:return n.call(this,r[0],r[1],o)}for(u=xu(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function Xe(n){return we(h(n)?n.length:w)&&zu.call(n)==B}function He(n){return!!n&&1===n.nodeType&&h(n)&&(Ut.support.nodeTag?-1<zu.call(n).indexOf("Element"):Dt(n))}function Qe(n){return h(n)&&typeof n.message=="string"&&zu.call(n)==q}function nu(n){var t=typeof n;return"function"==t||!!n&&"object"==t}function tu(n){return null==n?false:zu.call(n)==K?Du.test(Lu.call(n)):h(n)&&(Dt(n)?Du:wt).test(n)
|
45
|
+
}function ru(n){return typeof n=="number"||h(n)&&zu.call(n)==V}function eu(n){return nu(n)&&zu.call(n)==Z}function uu(n){return typeof n=="string"||h(n)&&zu.call(n)==G}function ou(n){return h(n)&&we(n.length)&&!!St[zu.call(n)]}function iu(n){return nr(n,au(n))}function fu(n){return pr(n,au(n))}function au(n){if(null==n)return[];nu(n)||(n=ku(n));for(var t=n.length,r=Ut.support,t=t&&we(t)&&(yi(n)||r.nonEnumStrings&&uu(n)||r.nonEnumArgs&&Xe(n))&&t||0,e=n.constructor,u=-1,e=mi(e)&&e.prototype||Fu,o=e===n,i=xu(t),f=0<t,a=r.enumErrorProps&&(n===Uu||n instanceof ju),c=r.enumPrototypes&&mi(n);++u<t;)i[u]=u+"";
|
46
|
+
for(var l in n)c&&"prototype"==l||a&&("message"==l||"name"==l)||f&&ye(l,t)||"constructor"==l&&(o||!Pu.call(n,l))||i.push(l);if(r.nonEnumShadows&&n!==Fu)for(t=n===Wu?G:n===Uu?q:zu.call(n),r=Oo[t]||Oo[Y],t==Y&&(e=Fu),t=Rt.length;t--;)l=Rt[t],u=r[l],o&&u||(u?!Pu.call(n,l):n[l]===e[l])||i.push(l);return i}function cu(n){return Rr(n,Ri(n))}function lu(n){return(n=u(n))&&n.replace(bt,c).replace(vt,"")}function su(n){return(n=u(n))&&jt.test(n)?n.replace(At,"\\$&"):n}function pu(n,t,r){return r&&de(n,t,r)&&(t=0),po(n,t)
|
47
|
+
}function hu(n,t){var r="";if(n=u(n),t=+t,1>t||!n||!io(t))return r;do t%2&&(r+=n),t=Zu(t/2),n+=n;while(t);return r}function _u(n,t,r){var e=n;return(n=u(n))?(r?de(e,t,r):null==t)?n.slice(v(n),y(n)+1):(t+="",n.slice(i(n,t),f(n,t)+1)):n}function gu(n,t,r){return r&&de(n,t,r)&&(t=null),n=u(n),n.match(t||Et)||[]}function vu(n,t,r){return r&&de(n,t,r)&&(t=null),h(n)?mu(n):tr(n,t)}function yu(n){return function(){return n}}function du(n){return n}function mu(n){return yr(rr(n,true))}function wu(n,t,r){if(null==r){var e=nu(t),u=e&&Ri(t);
|
48
|
+
((u=u&&u.length&&pr(t,u))?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=pr(t,Ri(t)));var o=true,e=-1,i=mi(n),f=u.length;false===r?o=false:nu(r)&&"chain"in r&&(o=r.chain);for(;++e<f;){r=u[e];var a=t[r];n[r]=a,i&&(n.prototype[r]=function(t){return function(){var r=this.__chain__;if(o||r){var e=n(this.__wrapped__);return(e.__actions__=Bt(this.__actions__)).push({func:t,args:arguments,thisArg:n}),e.__chain__=r,e}return r=[this.value()],Ju.apply(r,arguments),t.apply(n,r)}}(a))}return n}function bu(){}_=_?qt.defaults(Mt.Object(),_,qt.pick(Mt,kt)):Mt;
|
49
|
+
var xu=_.Array,Au=_.Date,ju=_.Error,Ou=_.Function,Eu=_.Math,Iu=_.Number,ku=_.Object,Ru=_.RegExp,Su=_.String,Cu=_.TypeError,Tu=xu.prototype,Uu=ju.prototype,Fu=ku.prototype,Wu=Su.prototype,Nu=(Nu=_.window)&&Nu.document,Lu=Ou.prototype.toString,$u=wr("length"),Pu=Fu.hasOwnProperty,Bu=0,zu=Fu.toString,Mu=_._,Du=Ru("^"+su(zu).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qu=tu(qu=_.ArrayBuffer)&&qu,Ku=tu(Ku=qu&&new qu(0).slice)&&Ku,Vu=Eu.ceil,Yu=_.clearTimeout,Zu=Eu.floor,Gu=tu(Gu=ku.getPrototypeOf)&&Gu,Ju=Tu.push,Xu=Fu.propertyIsEnumerable,Hu=tu(Hu=_.Set)&&Hu,Qu=_.setTimeout,no=Tu.splice,to=tu(to=_.Uint8Array)&&to,ro=tu(ro=_.WeakMap)&&ro,eo=function(){try{var n=tu(n=_.Float64Array)&&n,t=new n(new qu(10),0,1)&&n
|
50
|
+
}catch(r){}return t}(),uo=tu(uo=xu.isArray)&&uo,oo=tu(oo=ku.create)&&oo,io=_.isFinite,fo=tu(fo=ku.keys)&&fo,ao=Eu.max,co=Eu.min,lo=tu(lo=Au.now)&&lo,so=tu(so=Iu.isFinite)&&so,po=_.parseInt,ho=Eu.random,_o=Iu.NEGATIVE_INFINITY,go=Iu.POSITIVE_INFINITY,vo=Eu.pow(2,32)-1,yo=vo-1,mo=vo>>>1,wo=eo?eo.BYTES_PER_ELEMENT:0,bo=Eu.pow(2,53)-1,xo=ro&&new ro,Ao={},jo={};jo[X]=_.Float32Array,jo[H]=_.Float64Array,jo[Q]=_.Int8Array,jo[nt]=_.Int16Array,jo[tt]=_.Int32Array,jo[rt]=_.Uint8Array,jo[et]=_.Uint8ClampedArray,jo[ut]=_.Uint16Array,jo[ot]=_.Uint32Array;
|
51
|
+
var Oo={};Oo[z]=Oo[D]=Oo[V]={constructor:true,toLocaleString:true,toString:true,valueOf:true},Oo[M]=Oo[G]={constructor:true,toString:true,valueOf:true},Oo[q]=Oo[K]=Oo[Z]={constructor:true,toString:true},Oo[Y]={constructor:true},zt(Rt,function(n){for(var t in Oo)if(Pu.call(Oo,t)){var r=Oo[t];r[n]=Pu.call(r,n)}});var Eo=Ut.support={};!function(n){function t(){this.x=1}var r={0:1,length:1},e=[];t.prototype={valueOf:1,y:1};for(var u in new t)e.push(u);Eo.argsTag=zu.call(arguments)==B,Eo.enumErrorProps=Xu.call(Uu,"message")||Xu.call(Uu,"name"),Eo.enumPrototypes=Xu.call(t,"prototype"),Eo.funcDecomp=/\bthis\b/.test(function(){return this
|
52
|
+
}),Eo.funcNames=typeof Ou.name=="string",Eo.nodeTag=zu.call(Nu)!=Y,Eo.nonEnumStrings=!Xu.call("x",0),Eo.nonEnumShadows=!/valueOf/.test(e),Eo.ownLast="x"!=e[0],Eo.spliceObjects=(no.call(r,0,1),!r[0]),Eo.unindexedChars="xx"!="x"[0]+ku("x")[0];try{Eo.dom=11===Nu.createDocumentFragment().nodeType}catch(o){Eo.dom=false}try{Eo.nonEnumArgs=!Xu.call(arguments,1)}catch(i){Eo.nonEnumArgs=true}}(0,0),Ut.templateSettings={escape:ht,evaluate:_t,interpolate:gt,variable:"",imports:{_:Ut}};var Io=function(){function n(){}return function(t){if(nu(t)){n.prototype=t;
|
53
|
+
var r=new n;n.prototype=null}return r||_.Object()}}(),ko=Br(lr),Ro=Br(sr,true),So=zr(),Co=zr(true),To=xo?function(n,t){return xo.set(n,t),n}:du;Ku||(Wr=qu&&to?function(n){var t=n.byteLength,r=eo?Zu(t/wo):0,e=r*wo,u=new qu(t);if(r){var o=new eo(u,0,r);o.set(new eo(n,0,r))}return t!=e&&(o=new to(u,e),o.set(new to(n,e))),u}:yu(null));var Uo=oo&&Hu?function(n){return new $t(n)}:yu(null),Fo=xo?function(n){return xo.get(n)}:bu,Wo=function(){return Eo.funcNames?"constant"==yu.name?wr("name"):function(n){for(var t=n.name,r=Ao[t],e=r?r.length:0;e--;){var u=r[e],o=u.func;
|
54
|
+
if(null==o||o==n)return u.name}return t}:yu("")}(),No=function(){var n=0,t=0;return function(r,e){var u=ui(),o=F-(u-t);if(t=u,0<o){if(++n>=U)return r}else n=0;return To(r,e)}}(),Lo=Je(function(n,t){return yi(n)||Xe(n)?ur(n,ar(t,false,true)):[]}),$o=Zr(),Po=Zr(true),Bo=Je(function(t,r){t||(t=[]),r=ar(r);var e=r.length,u=Qt(t,r);for(r.sort(n);e--;){var o=parseFloat(r[e]);if(o!=i&&ye(o)){var i=o;no.call(t,o,1)}}return u}),zo=ie(),Mo=ie(true),Do=Je(function(n){return kr(ar(n,false,true))}),qo=Je(function(n,t){return yi(n)||Xe(n)?ur(n,t):[]
|
55
|
+
}),Ko=Je(Ne),Vo=Je(function(n,t){return we(n?n.length:0)&&(n=Ee(n)),Qt(n,ar(t))}),Yo=$r(function(n,t,r){Pu.call(n,r)?++n[r]:n[r]=1}),Zo=Yr(ko),Go=Yr(Ro,true),Jo=Xr(zt,ko),Xo=Xr(function(n,t){for(var r=n.length;r--&&false!==t(n[r],r,n););return n},Ro),Ho=$r(function(n,t,r){Pu.call(n,r)?n[r].push(t):n[r]=[t]}),Qo=$r(function(n,t,r){n[r]=t}),ni=Je(function(n,t,r){var e=-1,u=typeof t=="function",o=n?n.length:0,i=we(o)?xu(o):[];return ko(n,function(n){var o=u?t:null!=n&&n[t];i[++e]=o?o.apply(n,r):w}),i}),ti=$r(function(n,t,r){n[r?0:1].push(t)
|
56
|
+
},function(){return[[],[]]}),ri=re(function(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r},ko),ei=re(function(n,t,r,e){var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r},Ro),ui=lo||function(){return(new Au).getTime()},oi=Je(function(n,t,r){var e=x;if(r.length)var u=g(r,oi.placeholder),e=e|I;return fe(n,e,t,r,u)}),ii=Je(function(n,t){t=t.length?ar(t):fu(n);for(var r=-1,e=t.length;++r<e;){var u=t[r];n[u]=fe(n[u],x,n)}return n}),fi=Je(function(n,t,r){var e=x|A;
|
57
|
+
if(r.length)var u=g(r,fi.placeholder),e=e|I;return fe(t,e,n,r,u)}),ai=Kr(O),ci=Kr(E),li=Je(function(n,t){return er(n,1,t)}),si=Je(function(n,t,r){return er(n,t,r)}),pi=Jr(),hi=Jr(true),_i=te(I),gi=te(k),vi=Je(function(n,t){return fe(n,S,null,null,null,ar(t))});Eo.argsTag||(Xe=function(n){return we(h(n)?n.length:w)&&Pu.call(n,"callee")&&!Xu.call(n,"callee")});var yi=uo||function(n){return h(n)&&we(n.length)&&zu.call(n)==z};Eo.dom||(He=function(n){return!!n&&1===n.nodeType&&h(n)&&!wi(n)});var di=so||function(n){return typeof n=="number"&&io(n)
|
58
|
+
},mi=e(/x/)||to&&!e(to)?function(n){return zu.call(n)==K}:e,wi=Gu?function(n){if(!n||zu.call(n)!=Y||!Ut.support.argsTag&&Xe(n))return false;var t=n.valueOf,r=tu(t)&&(r=Gu(t))&&Gu(r);return r?n==r||Gu(n)==r:je(n)}:je,bi=Pr(Ht),xi=Je(function(n){var t=n[0];return null==t?t:(n.push(Jt),bi.apply(w,n))}),Ai=Gr(lr),ji=Gr(sr),Oi=Hr(So),Ei=Hr(Co),Ii=Qr(lr),ki=Qr(sr),Ri=fo?function(n){if(n)var t=n.constructor,r=n.length;return typeof t=="function"&&t.prototype===n||(typeof n=="function"?Ut.support.enumPrototypes:r&&we(r))?Oe(n):nu(n)?fo(n):[]
|
59
|
+
}:Oe,Si=Pr(mr),Ci=Je(function(n,t){if(null==n)return{};if("function"!=typeof t[0])return t=Yt(ar(t),Su),xe(n,ur(au(n),t));var r=Fr(t[0],t[1],3);return Ae(n,function(n,t,e){return!r(n,t,e)})}),Ti=Je(function(n,t){return null==n?{}:"function"==typeof t[0]?Ae(n,Fr(t[0],t[1],3)):xe(n,ar(t))}),Ui=Dr(function(n,t,r){return t=t.toLowerCase(),n+(r?t.charAt(0).toUpperCase()+t.slice(1):t)}),Fi=Dr(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Wi=ne(),Ni=ne(true);8!=po(It+"08")&&(pu=function(n,t,r){return(r?de(n,t,r):null==t)?t=0:t&&(t=+t),n=_u(n),po(n,t||(mt.test(n)?16:10))
|
60
|
+
});var Li=Dr(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),$i=Dr(function(n,t,r){return n+(r?" ":"")+(t.charAt(0).toUpperCase()+t.slice(1))}),Pi=Je(function(n,t){try{return n.apply(w,t)}catch(r){return Qe(r)?r:new ju(r)}}),Bi=Vr(Zt),zi=Vr(function(n){for(var t=-1,r=n.length,e=go;++t<r;){var u=n[t];u<e&&(e=u)}return e},true);return Ut.prototype=Ft.prototype,Wt.prototype=Io(Ft.prototype),Wt.prototype.constructor=Wt,Nt.prototype=Io(Ft.prototype),Nt.prototype.constructor=Nt,Lt.prototype["delete"]=function(n){return this.has(n)&&delete this.__data__[n]
|
61
|
+
},Lt.prototype.get=function(n){return"__proto__"==n?w:this.__data__[n]},Lt.prototype.has=function(n){return"__proto__"!=n&&Pu.call(this.__data__,n)},Lt.prototype.set=function(n,t){return"__proto__"!=n&&(this.__data__[n]=t),this},$t.prototype.push=function(n){var t=this.data;typeof n=="string"||nu(n)?t.set.add(n):t.hash[n]=true},Ge.Cache=Lt,Ut.after=function(n,t){if(typeof t!="function"){if(typeof n!="function")throw new Cu($);var r=n;n=t,t=r}return n=io(n=+n)?n:0,function(){return 1>--n?t.apply(this,arguments):void 0
|
62
|
+
}},Ut.ary=function(n,t,r){return r&&de(n,t,r)&&(t=null),t=n&&null==t?n.length:ao(+t||0,0),fe(n,R,null,null,null,null,t)},Ut.assign=bi,Ut.at=Vo,Ut.before=Ye,Ut.bind=oi,Ut.bindAll=ii,Ut.bindKey=fi,Ut.callback=vu,Ut.chain=$e,Ut.chunk=function(n,t,r){t=(r?de(n,t,r):null==t)?1:ao(+t||1,1),r=0;for(var e=n?n.length:0,u=-1,o=xu(Vu(e/t));r<e;)o[++u]=Ar(n,r,r+=t);return o},Ut.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t];o&&(u[++e]=o)}return u},Ut.constant=yu,Ut.countBy=Yo,Ut.create=function(n,t,r){var e=Io(n);
|
63
|
+
return r&&de(n,t,r)&&(t=null),t?nr(t,e,Ri(t)):e},Ut.curry=ai,Ut.curryRight=ci,Ut.debounce=Ze,Ut.defaults=xi,Ut.defer=li,Ut.delay=si,Ut.difference=Lo,Ut.drop=Re,Ut.dropRight=Se,Ut.dropRightWhile=function(n,t,r){return n&&n.length?Sr(n,pe(t,r,3),true,true):[]},Ut.dropWhile=function(n,t,r){return n&&n.length?Sr(n,pe(t,r,3),true):[]},Ut.fill=function(n,t,r,e){var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&de(n,t,r)&&(r=0,e=u),u=n.length,r=null==r?0:+r||0,0>r&&(r=-r>u?0:u+r),e=typeof e=="undefined"||e>u?u:+e||0,0>e&&(e+=u),u=r>e?0:e>>>0,r>>>=0;r<u;)n[r++]=t;
|
64
|
+
return n},Ut.filter=ze,Ut.flatten=function(n,t,r){var e=n?n.length:0;return r&&de(n,t,r)&&(t=false),e?ar(n,t):[]},Ut.flattenDeep=function(n){return n&&n.length?ar(n,true):[]},Ut.flow=pi,Ut.flowRight=hi,Ut.forEach=Jo,Ut.forEachRight=Xo,Ut.forIn=Oi,Ut.forInRight=Ei,Ut.forOwn=Ii,Ut.forOwnRight=ki,Ut.functions=fu,Ut.groupBy=Ho,Ut.indexBy=Qo,Ut.initial=function(n){return Se(n,1)},Ut.intersection=function(){for(var n=[],t=-1,e=arguments.length,u=[],o=he(),i=o==r;++t<e;){var f=arguments[t];(yi(f)||Xe(f))&&(n.push(f),u.push(i&&120<=f.length?Uo(t&&f):null))
|
65
|
+
}var e=n.length,i=n[0],a=-1,c=i?i.length:0,l=[],s=u[0];n:for(;++a<c;)if(f=i[a],0>(s?Pt(s,f):o(l,f,0))){for(t=e;--t;){var p=u[t];if(0>(p?Pt(p,f):o(n[t],f,0)))continue n}s&&s.push(f),l.push(f)}return l},Ut.invert=function(n,t,r){r&&de(n,t,r)&&(t=null),r=-1;for(var e=Ri(n),u=e.length,o={};++r<u;){var i=e[r],f=n[i];t?Pu.call(o,f)?o[f].push(i):o[f]=[i]:o[f]=i}return o},Ut.invoke=ni,Ut.keys=Ri,Ut.keysIn=au,Ut.map=De,Ut.mapValues=function(n,t,r){var e={};return t=pe(t,r,3),lr(n,function(n,r,u){e[r]=t(n,r,u)
|
66
|
+
}),e},Ut.matches=mu,Ut.matchesProperty=function(n,t){return dr(n+"",rr(t,true))},Ut.memoize=Ge,Ut.merge=Si,Ut.mixin=wu,Ut.negate=function(n){if(typeof n!="function")throw new Cu($);return function(){return!n.apply(this,arguments)}},Ut.omit=Ci,Ut.once=function(n){return Ye(n,2)},Ut.pairs=function(n){for(var t=-1,r=Ri(n),e=r.length,u=xu(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},Ut.partial=_i,Ut.partialRight=gi,Ut.partition=ti,Ut.pick=Ti,Ut.pluck=function(n,t){return De(n,wr(t))},Ut.property=function(n){return wr(n+"")
|
67
|
+
},Ut.propertyOf=function(n){return function(t){return null==n?w:n[t]}},Ut.pull=function(){var n=arguments,t=n[0];if(!t||!t.length)return t;for(var r=0,e=he(),u=n.length;++r<u;)for(var o=0,i=n[r];-1<(o=e(t,i,o));)no.call(t,o,1);return t},Ut.pullAt=Bo,Ut.range=function(n,t,r){r&&de(n,t,r)&&(t=r=null),n=+n||0,r=null==r?1:+r||0,null==t?(t=n,n=0):t=+t||0;var e=-1;t=ao(Vu((t-n)/(r||1)),0);for(var u=xu(t);++e<t;)u[e]=n,n+=r;return u},Ut.rearg=vi,Ut.reject=function(n,t,r){var e=yi(n)?Vt:ir;return t=pe(t,r,3),e(n,function(n,r,e){return!t(n,r,e)
|
68
|
+
})},Ut.remove=function(n,t,r){var e=-1,u=n?n.length:0,o=[];for(t=pe(t,r,3);++e<u;)r=n[e],t(r,e,n)&&(o.push(r),no.call(n,e--,1),u--);return o},Ut.rest=Fe,Ut.restParam=Je,Ut.shuffle=Ke,Ut.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&de(n,t,r)&&(t=0,r=e),Ar(n,t,r)):[]},Ut.sortBy=function(n,t,r){if(null==n)return[];var e=-1,u=n.length,o=we(u)?xu(u):[];return r&&de(n,t,r)&&(t=null),t=pe(t,r,3),ko(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),Or(o,a)},Ut.sortByAll=function(){var n=arguments,t=n[0],r=n[3],e=0,u=n.length-1;
|
69
|
+
if(null==t)return[];for(var o=xu(u);e<u;)o[e]=n[++e];return r&&de(n[1],n[2],r)&&(o=n[1]),Er(t,ar(o),[])},Ut.sortByOrder=function(n,t,r,e){return null==n?[]:(e&&de(t,r,e)&&(r=null),yi(t)||(t=null==t?[]:[t]),yi(r)||(r=null==r?[]:[r]),Er(n,t,r))},Ut.spread=function(n){if(typeof n!="function")throw new Cu($);return function(t){return n.apply(this,t)}},Ut.take=function(n,t,r){return n&&n.length?((r?de(n,t,r):null==t)&&(t=1),Ar(n,0,0>t?0:t)):[]},Ut.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?de(n,t,r):null==t)&&(t=1),t=e-(+t||0),Ar(n,0>t?0:t)):[]
|
70
|
+
},Ut.takeRightWhile=function(n,t,r){return n&&n.length?Sr(n,pe(t,r,3),false,true):[]},Ut.takeWhile=function(n,t,r){return n&&n.length?Sr(n,pe(t,r,3)):[]},Ut.tap=function(n,t,r){return t.call(r,n),n},Ut.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new Cu($);return false===r?e=false:nu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Tt.leading=e,Tt.maxWait=+t,Tt.trailing=u,Ze(n,t,Tt)},Ut.thru=Pe,Ut.times=function(n,t,r){if(n=+n,1>n||!io(n))return[];var e=-1,u=xu(co(n,vo));
|
71
|
+
for(t=Fr(t,r,1);++e<n;)e<vo?u[e]=t(e):t(e);return u},Ut.toArray=function(n){var t=n?n.length:0;return we(t)?t?Ut.support.unindexedChars&&uu(n)?n.split(""):Bt(n):[]:cu(n)},Ut.toPlainObject=iu,Ut.transform=function(n,t,r,e){var u=yi(n)||ou(n);return t=pe(t,e,4),null==r&&(u||nu(n)?(e=n.constructor,r=u?yi(n)?new e:[]:Io(mi(e)&&e.prototype)):r={}),(u?zt:lr)(n,function(n,e,u){return t(r,n,e,u)}),r},Ut.union=Do,Ut.uniq=We,Ut.unzip=Ne,Ut.values=cu,Ut.valuesIn=function(n){return Rr(n,au(n))},Ut.where=function(n,t){return ze(n,yr(t))
|
72
|
+
},Ut.without=qo,Ut.wrap=function(n,t){return t=null==t?du:t,fe(t,I,null,[n],[])},Ut.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var r=arguments[n];if(yi(r)||Xe(r))var e=e?ur(e,r).concat(ur(r,e)):r}return e?kr(e):[]},Ut.zip=Ko,Ut.zipObject=Le,Ut.backflow=hi,Ut.collect=De,Ut.compose=hi,Ut.each=Jo,Ut.eachRight=Xo,Ut.extend=bi,Ut.iteratee=vu,Ut.methods=fu,Ut.object=Le,Ut.select=ze,Ut.tail=Fe,Ut.unique=We,wu(Ut,Ut),Ut.add=function(n,t){return n+t},Ut.attempt=Pi,Ut.camelCase=Ui,Ut.capitalize=function(n){return(n=u(n))&&n.charAt(0).toUpperCase()+n.slice(1)
|
73
|
+
},Ut.clone=function(n,t,r,e){return t&&typeof t!="boolean"&&de(n,t,r)?t=false:typeof t=="function"&&(e=r,r=t,t=false),r=typeof r=="function"&&Fr(r,e,1),rr(n,t,r)},Ut.cloneDeep=function(n,t,r){return t=typeof t=="function"&&Fr(t,r,1),rr(n,true,t)},Ut.deburr=lu,Ut.endsWith=function(n,t,r){n=u(n),t+="";var e=n.length;return r=typeof r=="undefined"?e:co(0>r?0:+r||0,e),r-=t.length,0<=r&&n.indexOf(t,r)==r},Ut.escape=function(n){return(n=u(n))&&pt.test(n)?n.replace(lt,l):n},Ut.escapeRegExp=su,Ut.every=Be,Ut.find=Zo,Ut.findIndex=$o,Ut.findKey=Ai,Ut.findLast=Go,Ut.findLastIndex=Po,Ut.findLastKey=ji,Ut.findWhere=function(n,t){return Zo(n,yr(t))
|
74
|
+
},Ut.first=Ce,Ut.has=function(n,t){return n?Pu.call(n,t):false},Ut.identity=du,Ut.includes=Me,Ut.indexOf=Te,Ut.inRange=function(n,t,r){return t=+t||0,"undefined"===typeof r?(r=t,t=0):r=+r||0,n>=t&&n<r},Ut.isArguments=Xe,Ut.isArray=yi,Ut.isBoolean=function(n){return true===n||false===n||h(n)&&zu.call(n)==M},Ut.isDate=function(n){return h(n)&&zu.call(n)==D},Ut.isElement=He,Ut.isEmpty=function(n){if(null==n)return true;var t=n.length;return we(t)&&(yi(n)||uu(n)||Xe(n)||h(n)&&mi(n.splice))?!t:!Ri(n).length},Ut.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Fr(r,e,3),!r&&be(n)&&be(t)?n===t:(e=r?r(n,t):w,typeof e=="undefined"?hr(n,t,r):!!e)
|
75
|
+
},Ut.isError=Qe,Ut.isFinite=di,Ut.isFunction=mi,Ut.isMatch=function(n,t,r,e){var u=Ri(t),o=u.length;if(!o)return true;if(null==n)return false;if(r=typeof r=="function"&&Fr(r,e,3),!r&&1==o){var i=u[0];if(e=t[i],be(e))return e===n[i]&&(typeof e!="undefined"||i in Ie(n))}for(var i=xu(o),f=xu(o);o--;)e=i[o]=t[u[o]],f[o]=be(e);return gr(Ie(n),u,i,f,r)},Ut.isNaN=function(n){return ru(n)&&n!=+n},Ut.isNative=tu,Ut.isNull=function(n){return null===n},Ut.isNumber=ru,Ut.isObject=nu,Ut.isPlainObject=wi,Ut.isRegExp=eu,Ut.isString=uu,Ut.isTypedArray=ou,Ut.isUndefined=function(n){return typeof n=="undefined"
|
76
|
+
},Ut.kebabCase=Fi,Ut.last=Ue,Ut.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?ao(e+r,0):co(r||0,e-1))+1;else if(r)return u=Tr(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Ut.max=Bi,Ut.min=zi,Ut.noConflict=function(){return _._=Mu,this},Ut.noop=bu,Ut.now=ui,Ut.pad=function(n,t,r){n=u(n),t=+t;var e=n.length;return e<t&&io(t)?(e=(t-e)/2,t=Zu(e),e=Vu(e),r=ue("",e,r),r.slice(0,t)+n+r):n
|
77
|
+
},Ut.padLeft=Wi,Ut.padRight=Ni,Ut.parseInt=pu,Ut.random=function(n,t,r){r&&de(n,t,r)&&(t=r=null);var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ho(),co(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):br(n,t)},Ut.reduce=ri,Ut.reduceRight=ei,Ut.repeat=hu,Ut.result=function(n,t,r){return t=null==n?w:n[t],typeof t=="undefined"&&(t=r),mi(t)?t.call(n):t},Ut.runInContext=m,Ut.size=function(n){var t=n?n.length:0;
|
78
|
+
return we(t)?t:Ri(n).length},Ut.snakeCase=Li,Ut.some=Ve,Ut.sortedIndex=zo,Ut.sortedLastIndex=Mo,Ut.startCase=$i,Ut.startsWith=function(n,t,r){return n=u(n),r=null==r?0:co(0>r?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Ut.sum=function(n,t,r){r&&de(n,t,r)&&(t=null);var e=pe(),u=null==t;if(e===tr&&u||(u=false,t=e(t,r,3)),u){for(n=yi(n)?n:Ee(n),t=n.length,r=0;t--;)r+=+n[t]||0;n=r}else n=Ir(n,t);return n},Ut.template=function(n,t,r){var e=Ut.templateSettings;r&&de(n,t,r)&&(t=r=null),n=u(n),t=Ht(Ht({},r||t),e,Xt),r=Ht(Ht({},t.imports),e.imports,Xt);
|
79
|
+
var o,i,f=Ri(r),a=Rr(r,f),c=0;r=t.interpolate||xt;var l="__p+='";r=Ru((t.escape||xt).source+"|"+r.source+"|"+(r===gt?yt:xt).source+"|"+(t.evaluate||xt).source+"|$","g");var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,f,a){return e||(e=u),l+=n.slice(c,a).replace(Ot,s),r&&(o=true,l+="'+__e("+r+")+'"),f&&(i=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=a+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(it,""):l).replace(ft,"$1").replace(at,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Pi(function(){return Ou(f,p+"return "+l).apply(w,a)
|
80
|
+
}),t.source=l,Qe(t))throw t;return t},Ut.trim=_u,Ut.trimLeft=function(n,t,r){var e=n;return(n=u(n))?n.slice((r?de(e,t,r):null==t)?v(n):i(n,t+"")):n},Ut.trimRight=function(n,t,r){var e=n;return(n=u(n))?(r?de(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,f(n,t+"")+1):n},Ut.trunc=function(n,t,r){r&&de(n,t,r)&&(t=null);var e=C;if(r=T,null!=t)if(nu(t)){var o="separator"in t?t.separator:o,e="length"in t?+t.length||0:e;r="omission"in t?u(t.omission):r}else e=+t||0;if(n=u(n),e>=n.length)return n;if(e-=r.length,1>e)return r;
|
81
|
+
if(t=n.slice(0,e),null==o)return t+r;if(eu(o)){if(n.slice(e).search(o)){var i,f=n.slice(0,e);for(o.global||(o=Ru(o.source,(dt.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(f);)i=n.index;t=t.slice(0,null==i?e:i)}}else n.indexOf(o,e)!=e&&(o=t.lastIndexOf(o),-1<o&&(t=t.slice(0,o)));return t+r},Ut.unescape=function(n){return(n=u(n))&&st.test(n)?n.replace(ct,d):n},Ut.uniqueId=function(n){var t=++Bu;return u(n)+t},Ut.words=gu,Ut.all=Be,Ut.any=Ve,Ut.contains=Me,Ut.detect=Zo,Ut.foldl=ri,Ut.foldr=ei,Ut.head=Ce,Ut.include=Me,Ut.inject=ri,wu(Ut,function(){var n={};
|
82
|
+
return lr(Ut,function(t,r){Ut.prototype[r]||(n[r]=t)}),n}(),false),Ut.sample=qe,Ut.prototype.sample=function(n){return this.__chain__||null!=n?this.thru(function(t){return qe(t,n)}):qe(this.value())},Ut.VERSION=b,zt("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Ut[n].placeholder=Ut}),zt(["dropWhile","filter","map","takeWhile"],function(n,t){var r=t!=L,e=t==W;Nt.prototype[n]=function(n,u){var o=this.__filtered__,i=o&&e?new Nt(this):this.clone();return(i.__iteratees__||(i.__iteratees__=[])).push({done:false,count:0,index:0,iteratee:pe(n,u,1),limit:-1,type:t}),i.__filtered__=o||r,i
|
83
|
+
}}),zt(["drop","take"],function(n,t){var r=n+"While";Nt.prototype[n]=function(r){var e=this.__filtered__,u=e&&!t?this.dropWhile():this.clone();return r=null==r?1:ao(Zu(r)||0,0),e?t?u.__takeCount__=co(u.__takeCount__,r):Ue(u.__iteratees__).limit=r:(u.__views__||(u.__views__=[])).push({size:r,type:n+(0>u.__dir__?"Right":"")}),u},Nt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},Nt.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[r](n,t).reverse()}}),zt(["first","last"],function(n,t){var r="take"+(t?"Right":"");
|
84
|
+
Nt.prototype[n]=function(){return this[r](1).value()[0]}}),zt(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");Nt.prototype[n]=function(){return this[r](1)}}),zt(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?yr:wr;Nt.prototype[n]=function(n){return this[r](e(n))}}),Nt.prototype.compact=function(){return this.filter(du)},Nt.prototype.reject=function(n,t){return n=pe(n,t,1),this.filter(function(t){return!n(t)})},Nt.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=0>n?this.takeRight(-n):this.drop(n);
|
85
|
+
return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},Nt.prototype.toArray=function(){return this.drop(0)},lr(Nt.prototype,function(n,t){var r=Ut[t];if(r){var e=/^(?:filter|map|reject)|While$/.test(t),u=/^(?:first|last)$/.test(t);Ut.prototype[t]=function(){function t(n){return n=[n],Ju.apply(n,o),r.apply(Ut,n)}var o=arguments,i=this.__chain__,f=this.__wrapped__,a=!!this.__actions__.length,c=f instanceof Nt,l=o[0],s=c||yi(f);return s&&e&&typeof l=="function"&&1!=l.length&&(c=s=false),c=c&&!a,u&&!i?c?n.call(f):r.call(Ut,this.value()):s?(f=n.apply(c?f:new Nt(this),o),u||!a&&!f.__actions__||(f.__actions__||(f.__actions__=[])).push({func:Pe,args:[t],thisArg:Ut}),new Wt(f,i)):this.thru(t)
|
86
|
+
}}}),zt("concat join pop push replace shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?Wu:Tu)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n),u=Eo.spliceObjects||!/^(?:pop|shift|splice)$/.test(n)?t:function(){var n=t.apply(this,arguments);return 0===this.length&&delete this[0],n};Ut.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?u.apply(this.value(),n):this[r](function(t){return u.apply(t,n)
|
87
|
+
})}}),lr(Nt.prototype,function(n,t){var r=Ut[t];if(r){var e=r.name;(Ao[e]||(Ao[e]=[])).push({name:t,func:r})}}),Ao[ee(null,A).name]=[{name:"wrapper",func:null}],Nt.prototype.clone=function(){var n=this.__actions__,t=this.__iteratees__,r=this.__views__,e=new Nt(this.__wrapped__);return e.__actions__=n?Bt(n):null,e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=t?Bt(t):null,e.__takeCount__=this.__takeCount__,e.__views__=r?Bt(r):null,e},Nt.prototype.reverse=function(){if(this.__filtered__){var n=new Nt(this);
|
88
|
+
n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},Nt.prototype.value=function(){var n=this.__wrapped__.value();if(!yi(n))return Cr(n,this.__actions__);var t,r=this.__dir__,e=0>r;t=n.length;for(var u=this.__views__,o=0,i=-1,f=u?u.length:0;++i<f;){var a=u[i],c=a.size;switch(a.type){case"drop":o+=c;break;case"dropRight":t-=c;break;case"take":t=co(t,o+c);break;case"takeRight":o=ao(o,t-c)}}t={start:o,end:t},u=t.start,o=t.end,t=o-u,u=e?o:u-1,o=co(t,this.__takeCount__),f=(i=this.__iteratees__)?i.length:0,a=0,c=[];
|
89
|
+
n:for(;t--&&a<o;){for(var u=u+r,l=-1,s=n[u];++l<f;){var p=i[l],h=p.iteratee,_=p.type;if(_==W){if(p.done&&(e?u>p.index:u<p.index)&&(p.count=0,p.done=false),p.index=u,!(p.done||(_=p.limit,p.done=-1<_?p.count++>=_:!h(s))))continue n}else if(p=h(s),_==L)s=p;else if(!p){if(_==N)continue n;break n}}c[a++]=s}return c},Ut.prototype.chain=function(){return $e(this)},Ut.prototype.commit=function(){return new Wt(this.value(),this.__chain__)},Ut.prototype.plant=function(n){for(var t,r=this;r instanceof Ft;){var e=ke(r);
|
90
|
+
t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},Ut.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Nt?(this.__actions__.length&&(n=new Nt(this)),new Wt(n.reverse(),this.__chain__)):this.thru(function(n){return n.reverse()})},Ut.prototype.toString=function(){return this.value()+""},Ut.prototype.run=Ut.prototype.toJSON=Ut.prototype.valueOf=Ut.prototype.value=function(){return Cr(this.__wrapped__,this.__actions__)},Ut.prototype.collect=Ut.prototype.map,Ut.prototype.head=Ut.prototype.first,Ut.prototype.select=Ut.prototype.filter,Ut.prototype.tail=Ut.prototype.rest,Ut
|
91
|
+
}var w,b="3.6.0",x=1,A=2,j=4,O=8,E=16,I=32,k=64,R=128,S=256,C=30,T="...",U=150,F=16,W=0,N=1,L=2,$="Expected a function",P="__lodash_placeholder__",B="[object Arguments]",z="[object Array]",M="[object Boolean]",D="[object Date]",q="[object Error]",K="[object Function]",V="[object Number]",Y="[object Object]",Z="[object RegExp]",G="[object String]",J="[object ArrayBuffer]",X="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",nt="[object Int16Array]",tt="[object Int32Array]",rt="[object Uint8Array]",et="[object Uint8ClampedArray]",ut="[object Uint16Array]",ot="[object Uint32Array]",it=/\b__p\+='';/g,ft=/\b(__p\+=)''\+/g,at=/(__e\(.*?\)|\b__t\))\+'';/g,ct=/&(?:amp|lt|gt|quot|#39|#96);/g,lt=/[&<>"'`]/g,st=RegExp(ct.source),pt=RegExp(lt.source),ht=/<%-([\s\S]+?)%>/g,_t=/<%([\s\S]+?)%>/g,gt=/<%=([\s\S]+?)%>/g,vt=/[\u0300-\u036f\ufe20-\ufe23]/g,yt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,mt=/^0[xX]/,wt=/^\[object .+?Constructor\]$/,bt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xt=/($^)/,At=/[.*+?^${}()|[\]\/\\]/g,jt=RegExp(At.source),Ot=/['\n\r\u2028\u2029\\]/g,Et=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),It=" \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",kt="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window".split(" "),Rt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),St={};
|
92
|
+
St[X]=St[H]=St[Q]=St[nt]=St[tt]=St[rt]=St[et]=St[ut]=St[ot]=true,St[B]=St[z]=St[J]=St[M]=St[D]=St[q]=St[K]=St["[object Map]"]=St[V]=St[Y]=St[Z]=St["[object Set]"]=St[G]=St["[object WeakMap]"]=false;var Ct={};Ct[B]=Ct[z]=Ct[J]=Ct[M]=Ct[D]=Ct[X]=Ct[H]=Ct[Q]=Ct[nt]=Ct[tt]=Ct[V]=Ct[Y]=Ct[Z]=Ct[G]=Ct[rt]=Ct[et]=Ct[ut]=Ct[ot]=true,Ct[q]=Ct[K]=Ct["[object Map]"]=Ct["[object Set]"]=Ct["[object WeakMap]"]=false;var Tt={leading:false,maxWait:0,trailing:false},Ut={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ft={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Wt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Nt={"function":true,object:true},Lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=Nt[typeof exports]&&exports&&!exports.nodeType&&exports,Pt=Nt[typeof module]&&module&&!module.nodeType&&module,Bt=Nt[typeof self]&&self&&self.Object&&self,Nt=Nt[typeof window]&&window&&window.Object&&window,zt=Pt&&Pt.exports===$t&&$t,Mt=$t&&Pt&&typeof global=="object"&&global||Nt!==(this&&this.window)&&Nt||Bt||this,Dt=function(){try{Object({toString:0}+"")
|
93
|
+
}catch(n){return function(){return false}}return function(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}}(),qt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Mt._=qt, define(function(){return qt})):$t&&Pt?zt?(Pt.exports=qt)._=qt:$t._=qt:Mt._=qt}).call(this);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
|
-
* lodash 3.
|
3
|
+
* lodash 3.6.0 (Custom Build) <https://lodash.com/>
|
4
4
|
* Build: `lodash modern -o ./lodash.js`
|
5
5
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
6
6
|
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
var undefined;
|
14
14
|
|
15
15
|
/** Used as the semantic version number. */
|
16
|
-
var VERSION = '3.
|
16
|
+
var VERSION = '3.6.0';
|
17
17
|
|
18
18
|
/** Used to compose bitmasks for wrapper metadata. */
|
19
19
|
var BIND_FLAG = 1,
|
@@ -23,8 +23,8 @@
|
|
23
23
|
CURRY_RIGHT_FLAG = 16,
|
24
24
|
PARTIAL_FLAG = 32,
|
25
25
|
PARTIAL_RIGHT_FLAG = 64,
|
26
|
-
|
27
|
-
|
26
|
+
ARY_FLAG = 128,
|
27
|
+
REARG_FLAG = 256;
|
28
28
|
|
29
29
|
/** Used as default options for `_.trunc`. */
|
30
30
|
var DEFAULT_TRUNC_LENGTH = 30,
|
@@ -88,18 +88,18 @@
|
|
88
88
|
reInterpolate = /<%=([\s\S]+?)%>/g;
|
89
89
|
|
90
90
|
/**
|
91
|
-
* Used to match
|
92
|
-
|
93
|
-
|
91
|
+
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
92
|
+
*/
|
93
|
+
var reComboMarks = /[\u0300-\u036f\ufe20-\ufe23]/g;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Used to match [ES template delimiters](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components).
|
94
97
|
*/
|
95
98
|
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
96
99
|
|
97
100
|
/** Used to match `RegExp` flags from their coerced string values. */
|
98
101
|
var reFlags = /\w*$/;
|
99
102
|
|
100
|
-
/** Used to detect named functions. */
|
101
|
-
var reFuncName = /^\s*function[ \n\r\t]+\w/;
|
102
|
-
|
103
103
|
/** Used to detect hexadecimal string values. */
|
104
104
|
var reHexPrefix = /^0[xX]/;
|
105
105
|
|
@@ -113,16 +113,13 @@
|
|
113
113
|
var reNoMatch = /($^)/;
|
114
114
|
|
115
115
|
/**
|
116
|
-
* Used to match `RegExp` special characters.
|
117
|
-
*
|
118
|
-
*
|
116
|
+
* Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
|
117
|
+
* In addition to special characters the forward slash is escaped to allow for
|
118
|
+
* easier `eval` use and `Function` compilation.
|
119
119
|
*/
|
120
120
|
var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
|
121
121
|
reHasRegExpChars = RegExp(reRegExpChars.source);
|
122
122
|
|
123
|
-
/** Used to detect functions containing a `this` reference. */
|
124
|
-
var reThis = /\bthis\b/;
|
125
|
-
|
126
123
|
/** Used to match unescaped characters in compiled string literals. */
|
127
124
|
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
|
128
125
|
|
@@ -153,7 +150,7 @@
|
|
153
150
|
'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document',
|
154
151
|
'isFinite', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
|
155
152
|
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
|
156
|
-
'window'
|
153
|
+
'window'
|
157
154
|
];
|
158
155
|
|
159
156
|
/** Used to make template sourceURLs easier to identify. */
|
@@ -262,8 +259,11 @@
|
|
262
259
|
/** Detect free variable `global` from Node.js. */
|
263
260
|
var freeGlobal = freeExports && freeModule && typeof global == 'object' && global;
|
264
261
|
|
262
|
+
/** Detect free variable `self`. */
|
263
|
+
var freeSelf = objectTypes[typeof self] && self && self.Object && self;
|
264
|
+
|
265
265
|
/** Detect free variable `window`. */
|
266
|
-
var freeWindow = objectTypes[typeof window] && window;
|
266
|
+
var freeWindow = objectTypes[typeof window] && window && window.Object && window;
|
267
267
|
|
268
268
|
/** Detect the popular CommonJS extension `module.exports`. */
|
269
269
|
var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
|
@@ -274,7 +274,7 @@
|
|
274
274
|
* The `this` value is used if it is the global object to avoid Greasemonkey's
|
275
275
|
* restricted `window` object, otherwise the `window` object is used.
|
276
276
|
*/
|
277
|
-
var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || this;
|
277
|
+
var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
|
278
278
|
|
279
279
|
/*--------------------------------------------------------------------------*/
|
280
280
|
|
@@ -302,6 +302,28 @@
|
|
302
302
|
return 0;
|
303
303
|
}
|
304
304
|
|
305
|
+
/**
|
306
|
+
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
307
|
+
* support for callback shorthands and `this` binding.
|
308
|
+
*
|
309
|
+
* @private
|
310
|
+
* @param {Array} array The array to search.
|
311
|
+
* @param {Function} predicate The function invoked per iteration.
|
312
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
313
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
314
|
+
*/
|
315
|
+
function baseFindIndex(array, predicate, fromRight) {
|
316
|
+
var length = array.length,
|
317
|
+
index = fromRight ? length : -1;
|
318
|
+
|
319
|
+
while ((fromRight ? index-- : ++index < length)) {
|
320
|
+
if (predicate(array[index], index, array)) {
|
321
|
+
return index;
|
322
|
+
}
|
323
|
+
}
|
324
|
+
return -1;
|
325
|
+
}
|
326
|
+
|
305
327
|
/**
|
306
328
|
* The base implementation of `_.indexOf` without support for binary searches.
|
307
329
|
*
|
@@ -488,7 +510,6 @@
|
|
488
510
|
|
489
511
|
/**
|
490
512
|
* Gets the index at which the first occurrence of `NaN` is found in `array`.
|
491
|
-
* If `fromRight` is provided elements of `array` are iterated from right to left.
|
492
513
|
*
|
493
514
|
* @private
|
494
515
|
* @param {Array} array The array to search.
|
@@ -517,7 +538,7 @@
|
|
517
538
|
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
518
539
|
*/
|
519
540
|
function isObjectLike(value) {
|
520
|
-
return
|
541
|
+
return !!value && typeof value == 'object';
|
521
542
|
}
|
522
543
|
|
523
544
|
/**
|
@@ -639,19 +660,19 @@
|
|
639
660
|
* @returns {Function} Returns a new `lodash` function.
|
640
661
|
* @example
|
641
662
|
*
|
642
|
-
* _.mixin({ '
|
663
|
+
* _.mixin({ 'foo': _.constant('foo') });
|
643
664
|
*
|
644
665
|
* var lodash = _.runInContext();
|
645
|
-
* lodash.mixin({ '
|
666
|
+
* lodash.mixin({ 'bar': lodash.constant('bar') });
|
646
667
|
*
|
647
|
-
* _.isFunction(_.
|
668
|
+
* _.isFunction(_.foo);
|
648
669
|
* // => true
|
649
|
-
* _.isFunction(_.
|
670
|
+
* _.isFunction(_.bar);
|
650
671
|
* // => false
|
651
672
|
*
|
652
|
-
* lodash.isFunction(lodash.
|
673
|
+
* lodash.isFunction(lodash.foo);
|
653
674
|
* // => false
|
654
|
-
* lodash.isFunction(lodash.
|
675
|
+
* lodash.isFunction(lodash.bar);
|
655
676
|
* // => true
|
656
677
|
*
|
657
678
|
* // using `context` to mock `Date#getTime` use in `_.now`
|
@@ -704,9 +725,8 @@
|
|
704
725
|
var idCounter = 0;
|
705
726
|
|
706
727
|
/**
|
707
|
-
* Used to resolve the `toStringTag`
|
708
|
-
*
|
709
|
-
* for more details.
|
728
|
+
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
|
729
|
+
* of values.
|
710
730
|
*/
|
711
731
|
var objToString = objectProto.toString;
|
712
732
|
|
@@ -771,15 +791,17 @@
|
|
771
791
|
var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0;
|
772
792
|
|
773
793
|
/**
|
774
|
-
* Used as the maximum length
|
775
|
-
*
|
776
|
-
* for more details.
|
794
|
+
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
|
795
|
+
* of an array-like value.
|
777
796
|
*/
|
778
797
|
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
|
779
798
|
|
780
799
|
/** Used to store function metadata. */
|
781
800
|
var metaMap = WeakMap && new WeakMap;
|
782
801
|
|
802
|
+
/** Used to lookup unminified function names. */
|
803
|
+
var realNames = {};
|
804
|
+
|
783
805
|
/*------------------------------------------------------------------------*/
|
784
806
|
|
785
807
|
/**
|
@@ -929,7 +951,7 @@
|
|
929
951
|
* @memberOf _.support
|
930
952
|
* @type boolean
|
931
953
|
*/
|
932
|
-
support.funcDecomp =
|
954
|
+
support.funcDecomp = /\bthis\b/.test(function() { return this; });
|
933
955
|
|
934
956
|
/**
|
935
957
|
* Detect if `Function#name` is supported (all but IE).
|
@@ -1305,7 +1327,7 @@
|
|
1305
1327
|
|
1306
1328
|
/**
|
1307
1329
|
* A specialized version of `_.forEach` for arrays without support for callback
|
1308
|
-
* shorthands
|
1330
|
+
* shorthands and `this` binding.
|
1309
1331
|
*
|
1310
1332
|
* @private
|
1311
1333
|
* @param {Array} array The array to iterate over.
|
@@ -1326,7 +1348,7 @@
|
|
1326
1348
|
|
1327
1349
|
/**
|
1328
1350
|
* A specialized version of `_.forEachRight` for arrays without support for
|
1329
|
-
* callback shorthands
|
1351
|
+
* callback shorthands and `this` binding.
|
1330
1352
|
*
|
1331
1353
|
* @private
|
1332
1354
|
* @param {Array} array The array to iterate over.
|
@@ -1346,7 +1368,7 @@
|
|
1346
1368
|
|
1347
1369
|
/**
|
1348
1370
|
* A specialized version of `_.every` for arrays without support for callback
|
1349
|
-
* shorthands
|
1371
|
+
* shorthands and `this` binding.
|
1350
1372
|
*
|
1351
1373
|
* @private
|
1352
1374
|
* @param {Array} array The array to iterate over.
|
@@ -1368,7 +1390,7 @@
|
|
1368
1390
|
|
1369
1391
|
/**
|
1370
1392
|
* A specialized version of `_.filter` for arrays without support for callback
|
1371
|
-
* shorthands
|
1393
|
+
* shorthands and `this` binding.
|
1372
1394
|
*
|
1373
1395
|
* @private
|
1374
1396
|
* @param {Array} array The array to iterate over.
|
@@ -1392,7 +1414,7 @@
|
|
1392
1414
|
|
1393
1415
|
/**
|
1394
1416
|
* A specialized version of `_.map` for arrays without support for callback
|
1395
|
-
* shorthands
|
1417
|
+
* shorthands and `this` binding.
|
1396
1418
|
*
|
1397
1419
|
* @private
|
1398
1420
|
* @param {Array} array The array to iterate over.
|
@@ -1454,7 +1476,7 @@
|
|
1454
1476
|
|
1455
1477
|
/**
|
1456
1478
|
* A specialized version of `_.reduce` for arrays without support for callback
|
1457
|
-
* shorthands
|
1479
|
+
* shorthands and `this` binding.
|
1458
1480
|
*
|
1459
1481
|
* @private
|
1460
1482
|
* @param {Array} array The array to iterate over.
|
@@ -1479,7 +1501,7 @@
|
|
1479
1501
|
|
1480
1502
|
/**
|
1481
1503
|
* A specialized version of `_.reduceRight` for arrays without support for
|
1482
|
-
* callback shorthands
|
1504
|
+
* callback shorthands and `this` binding.
|
1483
1505
|
*
|
1484
1506
|
* @private
|
1485
1507
|
* @param {Array} array The array to iterate over.
|
@@ -1502,7 +1524,7 @@
|
|
1502
1524
|
|
1503
1525
|
/**
|
1504
1526
|
* A specialized version of `_.some` for arrays without support for callback
|
1505
|
-
* shorthands
|
1527
|
+
* shorthands and `this` binding.
|
1506
1528
|
*
|
1507
1529
|
* @private
|
1508
1530
|
* @param {Array} array The array to iterate over.
|
@@ -1522,6 +1544,23 @@
|
|
1522
1544
|
return false;
|
1523
1545
|
}
|
1524
1546
|
|
1547
|
+
/**
|
1548
|
+
* A specialized version of `_.sum` for arrays without support for iteratees.
|
1549
|
+
*
|
1550
|
+
* @private
|
1551
|
+
* @param {Array} array The array to iterate over.
|
1552
|
+
* @returns {number} Returns the sum.
|
1553
|
+
*/
|
1554
|
+
function arraySum(array) {
|
1555
|
+
var length = array.length,
|
1556
|
+
result = 0;
|
1557
|
+
|
1558
|
+
while (length--) {
|
1559
|
+
result += +array[length] || 0;
|
1560
|
+
}
|
1561
|
+
return result;
|
1562
|
+
}
|
1563
|
+
|
1525
1564
|
/**
|
1526
1565
|
* Used by `_.defaults` to customize its `_.assign` use.
|
1527
1566
|
*
|
@@ -1636,26 +1675,6 @@
|
|
1636
1675
|
return object;
|
1637
1676
|
}
|
1638
1677
|
|
1639
|
-
/**
|
1640
|
-
* The base implementation of `_.bindAll` without support for individual
|
1641
|
-
* method name arguments.
|
1642
|
-
*
|
1643
|
-
* @private
|
1644
|
-
* @param {Object} object The object to bind and assign the bound methods to.
|
1645
|
-
* @param {string[]} methodNames The object method names to bind.
|
1646
|
-
* @returns {Object} Returns `object`.
|
1647
|
-
*/
|
1648
|
-
function baseBindAll(object, methodNames) {
|
1649
|
-
var index = -1,
|
1650
|
-
length = methodNames.length;
|
1651
|
-
|
1652
|
-
while (++index < length) {
|
1653
|
-
var key = methodNames[index];
|
1654
|
-
object[key] = createWrapper(object[key], BIND_FLAG, object);
|
1655
|
-
}
|
1656
|
-
return object;
|
1657
|
-
}
|
1658
|
-
|
1659
1678
|
/**
|
1660
1679
|
* The base implementation of `_.callback` which supports specifying the
|
1661
1680
|
* number of arguments to provide to `func`.
|
@@ -1669,9 +1688,9 @@
|
|
1669
1688
|
function baseCallback(func, thisArg, argCount) {
|
1670
1689
|
var type = typeof func;
|
1671
1690
|
if (type == 'function') {
|
1672
|
-
return
|
1673
|
-
?
|
1674
|
-
: func;
|
1691
|
+
return typeof thisArg == 'undefined'
|
1692
|
+
? func
|
1693
|
+
: bindCallback(func, thisArg, argCount);
|
1675
1694
|
}
|
1676
1695
|
if (func == null) {
|
1677
1696
|
return identity;
|
@@ -1778,14 +1797,14 @@
|
|
1778
1797
|
* @private
|
1779
1798
|
* @param {Function} func The function to delay.
|
1780
1799
|
* @param {number} wait The number of milliseconds to delay invocation.
|
1781
|
-
* @param {Object} args The
|
1800
|
+
* @param {Object} args The arguments provide to `func`.
|
1782
1801
|
* @returns {number} Returns the timer id.
|
1783
1802
|
*/
|
1784
|
-
function baseDelay(func, wait, args
|
1803
|
+
function baseDelay(func, wait, args) {
|
1785
1804
|
if (typeof func != 'function') {
|
1786
1805
|
throw new TypeError(FUNC_ERROR_TEXT);
|
1787
1806
|
}
|
1788
|
-
return setTimeout(function() { func.apply(undefined,
|
1807
|
+
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
1789
1808
|
}
|
1790
1809
|
|
1791
1810
|
/**
|
@@ -1844,21 +1863,7 @@
|
|
1844
1863
|
* @param {Function} iteratee The function invoked per iteration.
|
1845
1864
|
* @returns {Array|Object|string} Returns `collection`.
|
1846
1865
|
*/
|
1847
|
-
|
1848
|
-
var length = collection ? collection.length : 0;
|
1849
|
-
if (!isLength(length)) {
|
1850
|
-
return baseForOwn(collection, iteratee);
|
1851
|
-
}
|
1852
|
-
var index = -1,
|
1853
|
-
iterable = toObject(collection);
|
1854
|
-
|
1855
|
-
while (++index < length) {
|
1856
|
-
if (iteratee(iterable[index], index, iterable) === false) {
|
1857
|
-
break;
|
1858
|
-
}
|
1859
|
-
}
|
1860
|
-
return collection;
|
1861
|
-
}
|
1866
|
+
var baseEach = createBaseEach(baseForOwn);
|
1862
1867
|
|
1863
1868
|
/**
|
1864
1869
|
* The base implementation of `_.forEachRight` without support for callback
|
@@ -1869,23 +1874,11 @@
|
|
1869
1874
|
* @param {Function} iteratee The function invoked per iteration.
|
1870
1875
|
* @returns {Array|Object|string} Returns `collection`.
|
1871
1876
|
*/
|
1872
|
-
|
1873
|
-
var length = collection ? collection.length : 0;
|
1874
|
-
if (!isLength(length)) {
|
1875
|
-
return baseForOwnRight(collection, iteratee);
|
1876
|
-
}
|
1877
|
-
var iterable = toObject(collection);
|
1878
|
-
while (length--) {
|
1879
|
-
if (iteratee(iterable[length], length, iterable) === false) {
|
1880
|
-
break;
|
1881
|
-
}
|
1882
|
-
}
|
1883
|
-
return collection;
|
1884
|
-
}
|
1877
|
+
var baseEachRight = createBaseEach(baseForOwnRight, true);
|
1885
1878
|
|
1886
1879
|
/**
|
1887
1880
|
* The base implementation of `_.every` without support for callback
|
1888
|
-
* shorthands
|
1881
|
+
* shorthands and `this` binding.
|
1889
1882
|
*
|
1890
1883
|
* @private
|
1891
1884
|
* @param {Array|Object|string} collection The collection to iterate over.
|
@@ -1934,7 +1927,7 @@
|
|
1934
1927
|
|
1935
1928
|
/**
|
1936
1929
|
* The base implementation of `_.filter` without support for callback
|
1937
|
-
* shorthands
|
1930
|
+
* shorthands and `this` binding.
|
1938
1931
|
*
|
1939
1932
|
* @private
|
1940
1933
|
* @param {Array|Object|string} collection The collection to iterate over.
|
@@ -1983,11 +1976,10 @@
|
|
1983
1976
|
* @param {Array} array The array to flatten.
|
1984
1977
|
* @param {boolean} isDeep Specify a deep flatten.
|
1985
1978
|
* @param {boolean} isStrict Restrict flattening to arrays and `arguments` objects.
|
1986
|
-
* @param {number} fromIndex The index to start from.
|
1987
1979
|
* @returns {Array} Returns the new flattened array.
|
1988
1980
|
*/
|
1989
|
-
function baseFlatten(array, isDeep, isStrict
|
1990
|
-
var index =
|
1981
|
+
function baseFlatten(array, isDeep, isStrict) {
|
1982
|
+
var index = -1,
|
1991
1983
|
length = array.length,
|
1992
1984
|
resIndex = -1,
|
1993
1985
|
result = [];
|
@@ -1998,7 +1990,7 @@
|
|
1998
1990
|
if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) {
|
1999
1991
|
if (isDeep) {
|
2000
1992
|
// Recursively flatten arrays (susceptible to call stack limits).
|
2001
|
-
value = baseFlatten(value, isDeep, isStrict
|
1993
|
+
value = baseFlatten(value, isDeep, isStrict);
|
2002
1994
|
}
|
2003
1995
|
var valIndex = -1,
|
2004
1996
|
valLength = value.length;
|
@@ -2026,20 +2018,7 @@
|
|
2026
2018
|
* @param {Function} keysFunc The function to get the keys of `object`.
|
2027
2019
|
* @returns {Object} Returns `object`.
|
2028
2020
|
*/
|
2029
|
-
|
2030
|
-
var index = -1,
|
2031
|
-
iterable = toObject(object),
|
2032
|
-
props = keysFunc(object),
|
2033
|
-
length = props.length;
|
2034
|
-
|
2035
|
-
while (++index < length) {
|
2036
|
-
var key = props[index];
|
2037
|
-
if (iteratee(iterable[key], key, iterable) === false) {
|
2038
|
-
break;
|
2039
|
-
}
|
2040
|
-
}
|
2041
|
-
return object;
|
2042
|
-
}
|
2021
|
+
var baseFor = createBaseFor();
|
2043
2022
|
|
2044
2023
|
/**
|
2045
2024
|
* This function is like `baseFor` except that it iterates over properties
|
@@ -2051,19 +2030,7 @@
|
|
2051
2030
|
* @param {Function} keysFunc The function to get the keys of `object`.
|
2052
2031
|
* @returns {Object} Returns `object`.
|
2053
2032
|
*/
|
2054
|
-
|
2055
|
-
var iterable = toObject(object),
|
2056
|
-
props = keysFunc(object),
|
2057
|
-
length = props.length;
|
2058
|
-
|
2059
|
-
while (length--) {
|
2060
|
-
var key = props[length];
|
2061
|
-
if (iteratee(iterable[key], key, iterable) === false) {
|
2062
|
-
break;
|
2063
|
-
}
|
2064
|
-
}
|
2065
|
-
return object;
|
2066
|
-
}
|
2033
|
+
var baseForRight = createBaseFor(true);
|
2067
2034
|
|
2068
2035
|
/**
|
2069
2036
|
* The base implementation of `_.forIn` without support for callback
|
@@ -2128,30 +2095,6 @@
|
|
2128
2095
|
return result;
|
2129
2096
|
}
|
2130
2097
|
|
2131
|
-
/**
|
2132
|
-
* The base implementation of `_.invoke` which requires additional arguments
|
2133
|
-
* to be provided as an array of arguments rather than individually.
|
2134
|
-
*
|
2135
|
-
* @private
|
2136
|
-
* @param {Array|Object|string} collection The collection to iterate over.
|
2137
|
-
* @param {Function|string} methodName The name of the method to invoke or
|
2138
|
-
* the function invoked per iteration.
|
2139
|
-
* @param {Array} [args] The arguments to invoke the method with.
|
2140
|
-
* @returns {Array} Returns the array of results.
|
2141
|
-
*/
|
2142
|
-
function baseInvoke(collection, methodName, args) {
|
2143
|
-
var index = -1,
|
2144
|
-
isFunc = typeof methodName == 'function',
|
2145
|
-
length = collection ? collection.length : 0,
|
2146
|
-
result = isLength(length) ? Array(length) : [];
|
2147
|
-
|
2148
|
-
baseEach(collection, function(value) {
|
2149
|
-
var func = isFunc ? methodName : (value != null && value[methodName]);
|
2150
|
-
result[++index] = func ? func.apply(value, args) : undefined;
|
2151
|
-
});
|
2152
|
-
return result;
|
2153
|
-
}
|
2154
|
-
|
2155
2098
|
/**
|
2156
2099
|
* The base implementation of `_.isEqual` without support for `this` binding
|
2157
2100
|
* `customizer` functions.
|
@@ -2160,12 +2103,12 @@
|
|
2160
2103
|
* @param {*} value The value to compare.
|
2161
2104
|
* @param {*} other The other value to compare.
|
2162
2105
|
* @param {Function} [customizer] The function to customize comparing values.
|
2163
|
-
* @param {boolean} [
|
2106
|
+
* @param {boolean} [isLoose] Specify performing partial comparisons.
|
2164
2107
|
* @param {Array} [stackA] Tracks traversed `value` objects.
|
2165
2108
|
* @param {Array} [stackB] Tracks traversed `other` objects.
|
2166
2109
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
2167
2110
|
*/
|
2168
|
-
function baseIsEqual(value, other, customizer,
|
2111
|
+
function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
|
2169
2112
|
// Exit early for identical values.
|
2170
2113
|
if (value === other) {
|
2171
2114
|
// Treat `+0` vs. `-0` as not equal.
|
@@ -2180,7 +2123,7 @@
|
|
2180
2123
|
// Return `false` unless both values are `NaN`.
|
2181
2124
|
return value !== value && other !== other;
|
2182
2125
|
}
|
2183
|
-
return baseIsEqualDeep(value, other, baseIsEqual, customizer,
|
2126
|
+
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
|
2184
2127
|
}
|
2185
2128
|
|
2186
2129
|
/**
|
@@ -2193,12 +2136,12 @@
|
|
2193
2136
|
* @param {Object} other The other object to compare.
|
2194
2137
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
2195
2138
|
* @param {Function} [customizer] The function to customize comparing objects.
|
2196
|
-
* @param {boolean} [
|
2139
|
+
* @param {boolean} [isLoose] Specify performing partial comparisons.
|
2197
2140
|
* @param {Array} [stackA=[]] Tracks traversed `value` objects.
|
2198
2141
|
* @param {Array} [stackB=[]] Tracks traversed `other` objects.
|
2199
2142
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
2200
2143
|
*/
|
2201
|
-
function baseIsEqualDeep(object, other, equalFunc, customizer,
|
2144
|
+
function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
|
2202
2145
|
var objIsArr = isArray(object),
|
2203
2146
|
othIsArr = isArray(other),
|
2204
2147
|
objTag = arrayTag,
|
@@ -2220,21 +2163,27 @@
|
|
2220
2163
|
othIsArr = isTypedArray(other);
|
2221
2164
|
}
|
2222
2165
|
}
|
2223
|
-
var objIsObj = objTag == objectTag,
|
2224
|
-
othIsObj = othTag == objectTag,
|
2166
|
+
var objIsObj = (objTag == objectTag || (isLoose && objTag == funcTag)),
|
2167
|
+
othIsObj = (othTag == objectTag || (isLoose && othTag == funcTag)),
|
2225
2168
|
isSameTag = objTag == othTag;
|
2226
2169
|
|
2227
2170
|
if (isSameTag && !(objIsArr || objIsObj)) {
|
2228
2171
|
return equalByTag(object, other, objTag);
|
2229
2172
|
}
|
2230
|
-
|
2231
|
-
|
2173
|
+
if (isLoose) {
|
2174
|
+
if (!isSameTag && !(objIsObj && othIsObj)) {
|
2175
|
+
return false;
|
2176
|
+
}
|
2177
|
+
} else {
|
2178
|
+
var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
2179
|
+
othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
2232
2180
|
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2181
|
+
if (valWrapped || othWrapped) {
|
2182
|
+
return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
|
2183
|
+
}
|
2184
|
+
if (!isSameTag) {
|
2185
|
+
return false;
|
2186
|
+
}
|
2238
2187
|
}
|
2239
2188
|
// Assume cyclic values are equal.
|
2240
2189
|
// For more information on detecting circular references see https://es5.github.io/#JO.
|
@@ -2251,7 +2200,7 @@
|
|
2251
2200
|
stackA.push(object);
|
2252
2201
|
stackB.push(other);
|
2253
2202
|
|
2254
|
-
var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer,
|
2203
|
+
var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
|
2255
2204
|
|
2256
2205
|
stackA.pop();
|
2257
2206
|
stackB.pop();
|
@@ -2261,7 +2210,7 @@
|
|
2261
2210
|
|
2262
2211
|
/**
|
2263
2212
|
* The base implementation of `_.isMatch` without support for callback
|
2264
|
-
* shorthands
|
2213
|
+
* shorthands and `this` binding.
|
2265
2214
|
*
|
2266
2215
|
* @private
|
2267
2216
|
* @param {Object} object The object to inspect.
|
@@ -2272,30 +2221,27 @@
|
|
2272
2221
|
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
|
2273
2222
|
*/
|
2274
2223
|
function baseIsMatch(object, props, values, strictCompareFlags, customizer) {
|
2275
|
-
var length = props.length;
|
2276
|
-
if (object == null) {
|
2277
|
-
return !length;
|
2278
|
-
}
|
2279
2224
|
var index = -1,
|
2225
|
+
length = props.length,
|
2280
2226
|
noCustomizer = !customizer;
|
2281
2227
|
|
2282
2228
|
while (++index < length) {
|
2283
2229
|
if ((noCustomizer && strictCompareFlags[index])
|
2284
2230
|
? values[index] !== object[props[index]]
|
2285
|
-
: !
|
2231
|
+
: !(props[index] in object)
|
2286
2232
|
) {
|
2287
2233
|
return false;
|
2288
2234
|
}
|
2289
2235
|
}
|
2290
2236
|
index = -1;
|
2291
2237
|
while (++index < length) {
|
2292
|
-
var key = props[index]
|
2238
|
+
var key = props[index],
|
2239
|
+
objValue = object[key],
|
2240
|
+
srcValue = values[index];
|
2241
|
+
|
2293
2242
|
if (noCustomizer && strictCompareFlags[index]) {
|
2294
|
-
var result =
|
2243
|
+
var result = typeof objValue != 'undefined' || (key in object);
|
2295
2244
|
} else {
|
2296
|
-
var objValue = object[key],
|
2297
|
-
srcValue = values[index];
|
2298
|
-
|
2299
2245
|
result = customizer ? customizer(objValue, srcValue, key) : undefined;
|
2300
2246
|
if (typeof result == 'undefined') {
|
2301
2247
|
result = baseIsEqual(srcValue, objValue, customizer, true);
|
@@ -2310,7 +2256,7 @@
|
|
2310
2256
|
|
2311
2257
|
/**
|
2312
2258
|
* The base implementation of `_.map` without support for callback shorthands
|
2313
|
-
*
|
2259
|
+
* and `this` binding.
|
2314
2260
|
*
|
2315
2261
|
* @private
|
2316
2262
|
* @param {Array|Object|string} collection The collection to iterate over.
|
@@ -2336,13 +2282,17 @@
|
|
2336
2282
|
var props = keys(source),
|
2337
2283
|
length = props.length;
|
2338
2284
|
|
2285
|
+
if (!length) {
|
2286
|
+
return constant(true);
|
2287
|
+
}
|
2339
2288
|
if (length == 1) {
|
2340
2289
|
var key = props[0],
|
2341
2290
|
value = source[key];
|
2342
2291
|
|
2343
2292
|
if (isStrictComparable(value)) {
|
2344
2293
|
return function(object) {
|
2345
|
-
return object != null && object[key] === value &&
|
2294
|
+
return object != null && object[key] === value &&
|
2295
|
+
(typeof value != 'undefined' || (key in toObject(object)));
|
2346
2296
|
};
|
2347
2297
|
}
|
2348
2298
|
}
|
@@ -2355,7 +2305,7 @@
|
|
2355
2305
|
strictCompareFlags[length] = isStrictComparable(value);
|
2356
2306
|
}
|
2357
2307
|
return function(object) {
|
2358
|
-
return baseIsMatch(object, props, values, strictCompareFlags);
|
2308
|
+
return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
|
2359
2309
|
};
|
2360
2310
|
}
|
2361
2311
|
|
@@ -2371,7 +2321,8 @@
|
|
2371
2321
|
function baseMatchesProperty(key, value) {
|
2372
2322
|
if (isStrictComparable(value)) {
|
2373
2323
|
return function(object) {
|
2374
|
-
return object != null && object[key] === value
|
2324
|
+
return object != null && object[key] === value &&
|
2325
|
+
(typeof value != 'undefined' || (key in toObject(object)));
|
2375
2326
|
};
|
2376
2327
|
}
|
2377
2328
|
return function(object) {
|
@@ -2451,7 +2402,7 @@
|
|
2451
2402
|
if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) {
|
2452
2403
|
result = isArray(value)
|
2453
2404
|
? value
|
2454
|
-
: (value ? arrayCopy(value) : []);
|
2405
|
+
: ((value && value.length) ? arrayCopy(value) : []);
|
2455
2406
|
}
|
2456
2407
|
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
2457
2408
|
result = isArguments(value)
|
@@ -2488,30 +2439,6 @@
|
|
2488
2439
|
};
|
2489
2440
|
}
|
2490
2441
|
|
2491
|
-
/**
|
2492
|
-
* The base implementation of `_.pullAt` without support for individual
|
2493
|
-
* index arguments.
|
2494
|
-
*
|
2495
|
-
* @private
|
2496
|
-
* @param {Array} array The array to modify.
|
2497
|
-
* @param {number[]} indexes The indexes of elements to remove.
|
2498
|
-
* @returns {Array} Returns the new array of removed elements.
|
2499
|
-
*/
|
2500
|
-
function basePullAt(array, indexes) {
|
2501
|
-
var length = indexes.length,
|
2502
|
-
result = baseAt(array, indexes);
|
2503
|
-
|
2504
|
-
indexes.sort(baseCompareAscending);
|
2505
|
-
while (length--) {
|
2506
|
-
var index = parseFloat(indexes[length]);
|
2507
|
-
if (index != previous && isIndex(index)) {
|
2508
|
-
var previous = index;
|
2509
|
-
splice.call(array, index, 1);
|
2510
|
-
}
|
2511
|
-
}
|
2512
|
-
return result;
|
2513
|
-
}
|
2514
|
-
|
2515
2442
|
/**
|
2516
2443
|
* The base implementation of `_.random` without support for argument juggling
|
2517
2444
|
* and returning floating-point numbers.
|
@@ -2527,7 +2454,7 @@
|
|
2527
2454
|
|
2528
2455
|
/**
|
2529
2456
|
* The base implementation of `_.reduce` and `_.reduceRight` without support
|
2530
|
-
* for callback shorthands
|
2457
|
+
* for callback shorthands and `this` binding, which iterates over `collection`
|
2531
2458
|
* using the provided `eachFunc`.
|
2532
2459
|
*
|
2533
2460
|
* @private
|
@@ -2594,7 +2521,7 @@
|
|
2594
2521
|
|
2595
2522
|
/**
|
2596
2523
|
* The base implementation of `_.some` without support for callback shorthands
|
2597
|
-
*
|
2524
|
+
* and `this` binding.
|
2598
2525
|
*
|
2599
2526
|
* @private
|
2600
2527
|
* @param {Array|Object|string} collection The collection to iterate over.
|
@@ -2661,6 +2588,23 @@
|
|
2661
2588
|
});
|
2662
2589
|
}
|
2663
2590
|
|
2591
|
+
/**
|
2592
|
+
* The base implementation of `_.sum` without support for callback shorthands
|
2593
|
+
* and `this` binding.
|
2594
|
+
*
|
2595
|
+
* @private
|
2596
|
+
* @param {Array|Object|string} collection The collection to iterate over.
|
2597
|
+
* @param {Function} iteratee The function invoked per iteration.
|
2598
|
+
* @returns {number} Returns the sum.
|
2599
|
+
*/
|
2600
|
+
function baseSum(collection, iteratee) {
|
2601
|
+
var result = 0;
|
2602
|
+
baseEach(collection, function(value, index, collection) {
|
2603
|
+
result += +iteratee(value, index, collection) || 0;
|
2604
|
+
});
|
2605
|
+
return result;
|
2606
|
+
}
|
2607
|
+
|
2664
2608
|
/**
|
2665
2609
|
* The base implementation of `_.uniq` without support for callback shorthands
|
2666
2610
|
* and `this` binding.
|
@@ -2734,6 +2678,27 @@
|
|
2734
2678
|
return result;
|
2735
2679
|
}
|
2736
2680
|
|
2681
|
+
/**
|
2682
|
+
* The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
|
2683
|
+
* and `_.takeWhile` without support for callback shorthands and `this` binding.
|
2684
|
+
*
|
2685
|
+
* @private
|
2686
|
+
* @param {Array} array The array to query.
|
2687
|
+
* @param {Function} predicate The function invoked per iteration.
|
2688
|
+
* @param {boolean} [isDrop] Specify dropping elements instead of taking them.
|
2689
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
2690
|
+
* @returns {Array} Returns the slice of `array`.
|
2691
|
+
*/
|
2692
|
+
function baseWhile(array, predicate, isDrop, fromRight) {
|
2693
|
+
var length = array.length,
|
2694
|
+
index = fromRight ? length : -1;
|
2695
|
+
|
2696
|
+
while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
|
2697
|
+
return isDrop
|
2698
|
+
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
|
2699
|
+
: baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
|
2700
|
+
}
|
2701
|
+
|
2737
2702
|
/**
|
2738
2703
|
* The base implementation of `wrapperValue` which returns the result of
|
2739
2704
|
* performing a sequence of actions on the unwrapped `value`, where each
|
@@ -2742,7 +2707,7 @@
|
|
2742
2707
|
* @private
|
2743
2708
|
* @param {*} value The unwrapped value.
|
2744
2709
|
* @param {Array} actions Actions to peform to resolve the unwrapped value.
|
2745
|
-
* @returns {*} Returns the resolved
|
2710
|
+
* @returns {*} Returns the resolved value.
|
2746
2711
|
*/
|
2747
2712
|
function baseWrapperValue(value, actions) {
|
2748
2713
|
var result = value;
|
@@ -2769,8 +2734,7 @@
|
|
2769
2734
|
* @private
|
2770
2735
|
* @param {Array} array The sorted array to inspect.
|
2771
2736
|
* @param {*} value The value to evaluate.
|
2772
|
-
* @param {boolean} [retHighest] Specify returning the highest
|
2773
|
-
* of the lowest, index at which a value should be inserted into `array`.
|
2737
|
+
* @param {boolean} [retHighest] Specify returning the highest qualified index.
|
2774
2738
|
* @returns {number} Returns the index at which `value` should be inserted
|
2775
2739
|
* into `array`.
|
2776
2740
|
*/
|
@@ -2803,8 +2767,7 @@
|
|
2803
2767
|
* @param {Array} array The sorted array to inspect.
|
2804
2768
|
* @param {*} value The value to evaluate.
|
2805
2769
|
* @param {Function} iteratee The function invoked per iteration.
|
2806
|
-
* @param {boolean} [retHighest] Specify returning the highest
|
2807
|
-
* of the lowest, index at which a value should be inserted into `array`.
|
2770
|
+
* @param {boolean} [retHighest] Specify returning the highest qualified index.
|
2808
2771
|
* @returns {number} Returns the index at which `value` should be inserted
|
2809
2772
|
* into `array`.
|
2810
2773
|
*/
|
@@ -2970,6 +2933,9 @@
|
|
2970
2933
|
* object composed from the results of running each element in the collection
|
2971
2934
|
* through an iteratee.
|
2972
2935
|
*
|
2936
|
+
* **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,
|
2937
|
+
* and `_.partition`.
|
2938
|
+
*
|
2973
2939
|
* @private
|
2974
2940
|
* @param {Function} setter The function to set keys and values of the accumulator object.
|
2975
2941
|
* @param {Function} [initializer] The function to initialize the accumulator object.
|
@@ -3001,6 +2967,8 @@
|
|
3001
2967
|
* Creates a function that assigns properties of source object(s) to a given
|
3002
2968
|
* destination object.
|
3003
2969
|
*
|
2970
|
+
* **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
|
2971
|
+
*
|
3004
2972
|
* @private
|
3005
2973
|
* @param {Function} assigner The function to assign values.
|
3006
2974
|
* @returns {Function} Returns the new assigner function.
|
@@ -3040,6 +3008,56 @@
|
|
3040
3008
|
};
|
3041
3009
|
}
|
3042
3010
|
|
3011
|
+
/**
|
3012
|
+
* Creates a `baseEach` or `baseEachRight` function.
|
3013
|
+
*
|
3014
|
+
* @private
|
3015
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
3016
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
3017
|
+
* @returns {Function} Returns the new base function.
|
3018
|
+
*/
|
3019
|
+
function createBaseEach(eachFunc, fromRight) {
|
3020
|
+
return function(collection, iteratee) {
|
3021
|
+
var length = collection ? collection.length : 0;
|
3022
|
+
if (!isLength(length)) {
|
3023
|
+
return eachFunc(collection, iteratee);
|
3024
|
+
}
|
3025
|
+
var index = fromRight ? length : -1,
|
3026
|
+
iterable = toObject(collection);
|
3027
|
+
|
3028
|
+
while ((fromRight ? index-- : ++index < length)) {
|
3029
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
3030
|
+
break;
|
3031
|
+
}
|
3032
|
+
}
|
3033
|
+
return collection;
|
3034
|
+
};
|
3035
|
+
}
|
3036
|
+
|
3037
|
+
/**
|
3038
|
+
* Creates a base function for `_.forIn` or `_.forInRight`.
|
3039
|
+
*
|
3040
|
+
* @private
|
3041
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
3042
|
+
* @returns {Function} Returns the new base function.
|
3043
|
+
*/
|
3044
|
+
function createBaseFor(fromRight) {
|
3045
|
+
return function(object, iteratee, keysFunc) {
|
3046
|
+
var iterable = toObject(object),
|
3047
|
+
props = keysFunc(object),
|
3048
|
+
length = props.length,
|
3049
|
+
index = fromRight ? length : -1;
|
3050
|
+
|
3051
|
+
while ((fromRight ? index-- : ++index < length)) {
|
3052
|
+
var key = props[index];
|
3053
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
3054
|
+
break;
|
3055
|
+
}
|
3056
|
+
}
|
3057
|
+
return object;
|
3058
|
+
};
|
3059
|
+
}
|
3060
|
+
|
3043
3061
|
/**
|
3044
3062
|
* Creates a function that wraps `func` and invokes it with the `this`
|
3045
3063
|
* binding of `thisArg`.
|
@@ -3070,41 +3088,6 @@
|
|
3070
3088
|
return new SetCache(values);
|
3071
3089
|
};
|
3072
3090
|
|
3073
|
-
/**
|
3074
|
-
* Creates a function to compose other functions into a single function.
|
3075
|
-
*
|
3076
|
-
* @private
|
3077
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
3078
|
-
* @returns {Function} Returns the new composer function.
|
3079
|
-
*/
|
3080
|
-
function createComposer(fromRight) {
|
3081
|
-
return function() {
|
3082
|
-
var length = arguments.length,
|
3083
|
-
index = length,
|
3084
|
-
fromIndex = fromRight ? (length - 1) : 0;
|
3085
|
-
|
3086
|
-
if (!length) {
|
3087
|
-
return function() { return arguments[0]; };
|
3088
|
-
}
|
3089
|
-
var funcs = Array(length);
|
3090
|
-
while (index--) {
|
3091
|
-
funcs[index] = arguments[index];
|
3092
|
-
if (typeof funcs[index] != 'function') {
|
3093
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
3094
|
-
}
|
3095
|
-
}
|
3096
|
-
return function() {
|
3097
|
-
var index = fromIndex,
|
3098
|
-
result = funcs[index].apply(this, arguments);
|
3099
|
-
|
3100
|
-
while ((fromRight ? index-- : ++index < length)) {
|
3101
|
-
result = funcs[index].call(this, result);
|
3102
|
-
}
|
3103
|
-
return result;
|
3104
|
-
};
|
3105
|
-
};
|
3106
|
-
}
|
3107
|
-
|
3108
3091
|
/**
|
3109
3092
|
* Creates a function that produces compound words out of the words in a
|
3110
3093
|
* given string.
|
@@ -3147,7 +3130,26 @@
|
|
3147
3130
|
}
|
3148
3131
|
|
3149
3132
|
/**
|
3150
|
-
* Creates a
|
3133
|
+
* Creates a `_.curry` or `_.curryRight` function.
|
3134
|
+
*
|
3135
|
+
* @private
|
3136
|
+
* @param {boolean} flag The curry bit flag.
|
3137
|
+
* @returns {Function} Returns the new curry function.
|
3138
|
+
*/
|
3139
|
+
function createCurry(flag) {
|
3140
|
+
function curryFunc(func, arity, guard) {
|
3141
|
+
if (guard && isIterateeCall(func, arity, guard)) {
|
3142
|
+
arity = null;
|
3143
|
+
}
|
3144
|
+
var result = createWrapper(func, flag, null, null, null, null, null, arity);
|
3145
|
+
result.placeholder = curryFunc.placeholder;
|
3146
|
+
return result;
|
3147
|
+
}
|
3148
|
+
return curryFunc;
|
3149
|
+
}
|
3150
|
+
|
3151
|
+
/**
|
3152
|
+
* Creates a `_.max` or `_.min` function.
|
3151
3153
|
*
|
3152
3154
|
* @private
|
3153
3155
|
* @param {Function} arrayFunc The function to get the extremum value from an array.
|
@@ -3179,6 +3181,204 @@
|
|
3179
3181
|
};
|
3180
3182
|
}
|
3181
3183
|
|
3184
|
+
/**
|
3185
|
+
* Creates a `_.find` or `_.findLast` function.
|
3186
|
+
*
|
3187
|
+
* @private
|
3188
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
3189
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
3190
|
+
* @returns {Function} Returns the new find function.
|
3191
|
+
*/
|
3192
|
+
function createFind(eachFunc, fromRight) {
|
3193
|
+
return function(collection, predicate, thisArg) {
|
3194
|
+
predicate = getCallback(predicate, thisArg, 3);
|
3195
|
+
if (isArray(collection)) {
|
3196
|
+
var index = baseFindIndex(collection, predicate, fromRight);
|
3197
|
+
return index > -1 ? collection[index] : undefined;
|
3198
|
+
}
|
3199
|
+
return baseFind(collection, predicate, eachFunc);
|
3200
|
+
}
|
3201
|
+
}
|
3202
|
+
|
3203
|
+
/**
|
3204
|
+
* Creates a `_.findIndex` or `_.findLastIndex` function.
|
3205
|
+
*
|
3206
|
+
* @private
|
3207
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
3208
|
+
* @returns {Function} Returns the new find function.
|
3209
|
+
*/
|
3210
|
+
function createFindIndex(fromRight) {
|
3211
|
+
return function(array, predicate, thisArg) {
|
3212
|
+
if (!(array && array.length)) {
|
3213
|
+
return -1;
|
3214
|
+
}
|
3215
|
+
predicate = getCallback(predicate, thisArg, 3);
|
3216
|
+
return baseFindIndex(array, predicate, fromRight);
|
3217
|
+
};
|
3218
|
+
}
|
3219
|
+
|
3220
|
+
/**
|
3221
|
+
* Creates a `_.findKey` or `_.findLastKey` function.
|
3222
|
+
*
|
3223
|
+
* @private
|
3224
|
+
* @param {Function} objectFunc The function to iterate over an object.
|
3225
|
+
* @returns {Function} Returns the new find function.
|
3226
|
+
*/
|
3227
|
+
function createFindKey(objectFunc) {
|
3228
|
+
return function(object, predicate, thisArg) {
|
3229
|
+
predicate = getCallback(predicate, thisArg, 3);
|
3230
|
+
return baseFind(object, predicate, objectFunc, true);
|
3231
|
+
};
|
3232
|
+
}
|
3233
|
+
|
3234
|
+
/**
|
3235
|
+
* Creates a `_.flow` or `_.flowRight` function.
|
3236
|
+
*
|
3237
|
+
* @private
|
3238
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
3239
|
+
* @returns {Function} Returns the new flow function.
|
3240
|
+
*/
|
3241
|
+
function createFlow(fromRight) {
|
3242
|
+
return function() {
|
3243
|
+
var length = arguments.length;
|
3244
|
+
if (!length) {
|
3245
|
+
return function() { return arguments[0]; };
|
3246
|
+
}
|
3247
|
+
var wrapper,
|
3248
|
+
index = fromRight ? length : -1,
|
3249
|
+
leftIndex = 0,
|
3250
|
+
funcs = Array(length);
|
3251
|
+
|
3252
|
+
while ((fromRight ? index-- : ++index < length)) {
|
3253
|
+
var func = funcs[leftIndex++] = arguments[index];
|
3254
|
+
if (typeof func != 'function') {
|
3255
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
3256
|
+
}
|
3257
|
+
var funcName = wrapper ? '' : getFuncName(func);
|
3258
|
+
wrapper = funcName == 'wrapper' ? new LodashWrapper([]) : wrapper;
|
3259
|
+
}
|
3260
|
+
index = wrapper ? -1 : length;
|
3261
|
+
while (++index < length) {
|
3262
|
+
func = funcs[index];
|
3263
|
+
funcName = getFuncName(func);
|
3264
|
+
|
3265
|
+
var data = funcName == 'wrapper' ? getData(func) : null;
|
3266
|
+
if (data && isLaziable(data[0])) {
|
3267
|
+
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
3268
|
+
} else {
|
3269
|
+
wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
|
3270
|
+
}
|
3271
|
+
}
|
3272
|
+
return function() {
|
3273
|
+
var args = arguments;
|
3274
|
+
if (wrapper && args.length == 1 && isArray(args[0])) {
|
3275
|
+
return wrapper.plant(args[0]).value();
|
3276
|
+
}
|
3277
|
+
var index = 0,
|
3278
|
+
result = funcs[index].apply(this, args);
|
3279
|
+
|
3280
|
+
while (++index < length) {
|
3281
|
+
result = funcs[index].call(this, result);
|
3282
|
+
}
|
3283
|
+
return result;
|
3284
|
+
};
|
3285
|
+
};
|
3286
|
+
}
|
3287
|
+
|
3288
|
+
/**
|
3289
|
+
* Creates a function for `_.forEach` or `_.forEachRight`.
|
3290
|
+
*
|
3291
|
+
* @private
|
3292
|
+
* @param {Function} arrayFunc The function to iterate over an array.
|
3293
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
3294
|
+
* @returns {Function} Returns the new each function.
|
3295
|
+
*/
|
3296
|
+
function createForEach(arrayFunc, eachFunc) {
|
3297
|
+
return function(collection, iteratee, thisArg) {
|
3298
|
+
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
3299
|
+
? arrayFunc(collection, iteratee)
|
3300
|
+
: eachFunc(collection, bindCallback(iteratee, thisArg, 3));
|
3301
|
+
};
|
3302
|
+
}
|
3303
|
+
|
3304
|
+
/**
|
3305
|
+
* Creates a function for `_.forIn` or `_.forInRight`.
|
3306
|
+
*
|
3307
|
+
* @private
|
3308
|
+
* @param {Function} objectFunc The function to iterate over an object.
|
3309
|
+
* @returns {Function} Returns the new each function.
|
3310
|
+
*/
|
3311
|
+
function createForIn(objectFunc) {
|
3312
|
+
return function(object, iteratee, thisArg) {
|
3313
|
+
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
|
3314
|
+
iteratee = bindCallback(iteratee, thisArg, 3);
|
3315
|
+
}
|
3316
|
+
return objectFunc(object, iteratee, keysIn);
|
3317
|
+
};
|
3318
|
+
}
|
3319
|
+
|
3320
|
+
/**
|
3321
|
+
* Creates a function for `_.forOwn` or `_.forOwnRight`.
|
3322
|
+
*
|
3323
|
+
* @private
|
3324
|
+
* @param {Function} objectFunc The function to iterate over an object.
|
3325
|
+
* @returns {Function} Returns the new each function.
|
3326
|
+
*/
|
3327
|
+
function createForOwn(objectFunc) {
|
3328
|
+
return function(object, iteratee, thisArg) {
|
3329
|
+
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
|
3330
|
+
iteratee = bindCallback(iteratee, thisArg, 3);
|
3331
|
+
}
|
3332
|
+
return objectFunc(object, iteratee);
|
3333
|
+
};
|
3334
|
+
}
|
3335
|
+
|
3336
|
+
/**
|
3337
|
+
* Creates a function for `_.padLeft` or `_.padRight`.
|
3338
|
+
*
|
3339
|
+
* @private
|
3340
|
+
* @param {boolean} [fromRight] Specify padding from the right.
|
3341
|
+
* @returns {Function} Returns the new pad function.
|
3342
|
+
*/
|
3343
|
+
function createPadDir(fromRight) {
|
3344
|
+
return function(string, length, chars) {
|
3345
|
+
string = baseToString(string);
|
3346
|
+
return string && ((fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string));
|
3347
|
+
};
|
3348
|
+
}
|
3349
|
+
|
3350
|
+
/**
|
3351
|
+
* Creates a `_.partial` or `_.partialRight` function.
|
3352
|
+
*
|
3353
|
+
* @private
|
3354
|
+
* @param {boolean} flag The partial bit flag.
|
3355
|
+
* @returns {Function} Returns the new partial function.
|
3356
|
+
*/
|
3357
|
+
function createPartial(flag) {
|
3358
|
+
var partialFunc = restParam(function(func, partials) {
|
3359
|
+
var holders = replaceHolders(partials, partialFunc.placeholder);
|
3360
|
+
return createWrapper(func, flag, null, partials, holders);
|
3361
|
+
});
|
3362
|
+
return partialFunc;
|
3363
|
+
}
|
3364
|
+
|
3365
|
+
/**
|
3366
|
+
* Creates a function for `_.reduce` or `_.reduceRight`.
|
3367
|
+
*
|
3368
|
+
* @private
|
3369
|
+
* @param {Function} arrayFunc The function to iterate over an array.
|
3370
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
3371
|
+
* @returns {Function} Returns the new each function.
|
3372
|
+
*/
|
3373
|
+
function createReduce(arrayFunc, eachFunc) {
|
3374
|
+
return function(collection, iteratee, accumulator, thisArg) {
|
3375
|
+
var initFromArray = arguments.length < 3;
|
3376
|
+
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
3377
|
+
? arrayFunc(collection, iteratee, accumulator, initFromArray)
|
3378
|
+
: baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
|
3379
|
+
};
|
3380
|
+
}
|
3381
|
+
|
3182
3382
|
/**
|
3183
3383
|
* Creates a function that wraps `func` and invokes it with optional `this`
|
3184
3384
|
* binding of, partial application, and currying.
|
@@ -3242,7 +3442,12 @@
|
|
3242
3442
|
if (!isCurryBound) {
|
3243
3443
|
bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
|
3244
3444
|
}
|
3245
|
-
var
|
3445
|
+
var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
|
3446
|
+
result = createHybridWrapper.apply(undefined, newData);
|
3447
|
+
|
3448
|
+
if (isLaziable(func)) {
|
3449
|
+
setData(result, newData);
|
3450
|
+
}
|
3246
3451
|
result.placeholder = placeholder;
|
3247
3452
|
return result;
|
3248
3453
|
}
|
@@ -3264,9 +3469,8 @@
|
|
3264
3469
|
}
|
3265
3470
|
|
3266
3471
|
/**
|
3267
|
-
* Creates the
|
3268
|
-
* The `chars` string
|
3269
|
-
* exceeds the padding length.
|
3472
|
+
* Creates the padding required for `string` based on the given `length`.
|
3473
|
+
* The `chars` string is truncated if the number of characters exceeds `length`.
|
3270
3474
|
*
|
3271
3475
|
* @private
|
3272
3476
|
* @param {string} string The string to create padding for.
|
@@ -3274,7 +3478,7 @@
|
|
3274
3478
|
* @param {string} [chars=' '] The string used as padding.
|
3275
3479
|
* @returns {string} Returns the pad for `string`.
|
3276
3480
|
*/
|
3277
|
-
function
|
3481
|
+
function createPadding(string, length, chars) {
|
3278
3482
|
var strLength = string.length;
|
3279
3483
|
length = +length;
|
3280
3484
|
|
@@ -3323,6 +3527,22 @@
|
|
3323
3527
|
return wrapper;
|
3324
3528
|
}
|
3325
3529
|
|
3530
|
+
/**
|
3531
|
+
* Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
|
3532
|
+
*
|
3533
|
+
* @private
|
3534
|
+
* @param {boolean} [retHighest] Specify returning the highest qualified index.
|
3535
|
+
* @returns {Function} Returns the new index function.
|
3536
|
+
*/
|
3537
|
+
function createSortedIndex(retHighest) {
|
3538
|
+
return function(array, value, iteratee, thisArg) {
|
3539
|
+
var func = getCallback(iteratee);
|
3540
|
+
return (func === baseCallback && iteratee == null)
|
3541
|
+
? binaryIndex(array, value, retHighest)
|
3542
|
+
: binaryIndexBy(array, value, func(iteratee, thisArg, 1), retHighest);
|
3543
|
+
};
|
3544
|
+
}
|
3545
|
+
|
3326
3546
|
/**
|
3327
3547
|
* Creates a function that either curries or invokes `func` with optional
|
3328
3548
|
* `this` binding and partially applied arguments.
|
@@ -3365,10 +3585,10 @@
|
|
3365
3585
|
|
3366
3586
|
partials = holders = null;
|
3367
3587
|
}
|
3368
|
-
var data =
|
3588
|
+
var data = isBindKey ? null : getData(func),
|
3369
3589
|
newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
|
3370
3590
|
|
3371
|
-
if (data
|
3591
|
+
if (data) {
|
3372
3592
|
mergeData(newData, data);
|
3373
3593
|
bitmask = newData[1];
|
3374
3594
|
arity = newData[9];
|
@@ -3397,18 +3617,18 @@
|
|
3397
3617
|
* @param {Array} other The other array to compare.
|
3398
3618
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
3399
3619
|
* @param {Function} [customizer] The function to customize comparing arrays.
|
3400
|
-
* @param {boolean} [
|
3620
|
+
* @param {boolean} [isLoose] Specify performing partial comparisons.
|
3401
3621
|
* @param {Array} [stackA] Tracks traversed `value` objects.
|
3402
3622
|
* @param {Array} [stackB] Tracks traversed `other` objects.
|
3403
3623
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
3404
3624
|
*/
|
3405
|
-
function equalArrays(array, other, equalFunc, customizer,
|
3625
|
+
function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
|
3406
3626
|
var index = -1,
|
3407
3627
|
arrLength = array.length,
|
3408
3628
|
othLength = other.length,
|
3409
3629
|
result = true;
|
3410
3630
|
|
3411
|
-
if (arrLength != othLength && !(
|
3631
|
+
if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
|
3412
3632
|
return false;
|
3413
3633
|
}
|
3414
3634
|
// Deep compare the contents, ignoring non-numeric properties.
|
@@ -3418,23 +3638,23 @@
|
|
3418
3638
|
|
3419
3639
|
result = undefined;
|
3420
3640
|
if (customizer) {
|
3421
|
-
result =
|
3641
|
+
result = isLoose
|
3422
3642
|
? customizer(othValue, arrValue, index)
|
3423
3643
|
: customizer(arrValue, othValue, index);
|
3424
3644
|
}
|
3425
3645
|
if (typeof result == 'undefined') {
|
3426
3646
|
// Recursively compare arrays (susceptible to call stack limits).
|
3427
|
-
if (
|
3647
|
+
if (isLoose) {
|
3428
3648
|
var othIndex = othLength;
|
3429
3649
|
while (othIndex--) {
|
3430
3650
|
othValue = other[othIndex];
|
3431
|
-
result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer,
|
3651
|
+
result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
|
3432
3652
|
if (result) {
|
3433
3653
|
break;
|
3434
3654
|
}
|
3435
3655
|
}
|
3436
3656
|
} else {
|
3437
|
-
result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer,
|
3657
|
+
result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
|
3438
3658
|
}
|
3439
3659
|
}
|
3440
3660
|
}
|
@@ -3490,26 +3710,26 @@
|
|
3490
3710
|
* @param {Object} other The other object to compare.
|
3491
3711
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
3492
3712
|
* @param {Function} [customizer] The function to customize comparing values.
|
3493
|
-
* @param {boolean} [
|
3713
|
+
* @param {boolean} [isLoose] Specify performing partial comparisons.
|
3494
3714
|
* @param {Array} [stackA] Tracks traversed `value` objects.
|
3495
3715
|
* @param {Array} [stackB] Tracks traversed `other` objects.
|
3496
3716
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
3497
3717
|
*/
|
3498
|
-
function equalObjects(object, other, equalFunc, customizer,
|
3718
|
+
function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
|
3499
3719
|
var objProps = keys(object),
|
3500
3720
|
objLength = objProps.length,
|
3501
3721
|
othProps = keys(other),
|
3502
3722
|
othLength = othProps.length;
|
3503
3723
|
|
3504
|
-
if (objLength != othLength && !
|
3724
|
+
if (objLength != othLength && !isLoose) {
|
3505
3725
|
return false;
|
3506
3726
|
}
|
3507
|
-
var
|
3727
|
+
var skipCtor = isLoose,
|
3508
3728
|
index = -1;
|
3509
3729
|
|
3510
3730
|
while (++index < objLength) {
|
3511
3731
|
var key = objProps[index],
|
3512
|
-
result = hasOwnProperty.call(other, key);
|
3732
|
+
result = isLoose ? key in other : hasOwnProperty.call(other, key);
|
3513
3733
|
|
3514
3734
|
if (result) {
|
3515
3735
|
var objValue = object[key],
|
@@ -3517,21 +3737,21 @@
|
|
3517
3737
|
|
3518
3738
|
result = undefined;
|
3519
3739
|
if (customizer) {
|
3520
|
-
result =
|
3740
|
+
result = isLoose
|
3521
3741
|
? customizer(othValue, objValue, key)
|
3522
3742
|
: customizer(objValue, othValue, key);
|
3523
3743
|
}
|
3524
3744
|
if (typeof result == 'undefined') {
|
3525
3745
|
// Recursively compare objects (susceptible to call stack limits).
|
3526
|
-
result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer,
|
3746
|
+
result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
|
3527
3747
|
}
|
3528
3748
|
}
|
3529
3749
|
if (!result) {
|
3530
3750
|
return false;
|
3531
3751
|
}
|
3532
|
-
|
3752
|
+
skipCtor || (skipCtor = key == 'constructor');
|
3533
3753
|
}
|
3534
|
-
if (!
|
3754
|
+
if (!skipCtor) {
|
3535
3755
|
var objCtor = object.constructor,
|
3536
3756
|
othCtor = other.constructor;
|
3537
3757
|
|
@@ -3549,7 +3769,7 @@
|
|
3549
3769
|
/**
|
3550
3770
|
* Gets the extremum value of `collection` invoking `iteratee` for each value
|
3551
3771
|
* in `collection` to generate the criterion by which the value is ranked.
|
3552
|
-
* The `iteratee` is invoked with three arguments
|
3772
|
+
* The `iteratee` is invoked with three arguments: (value, index, collection).
|
3553
3773
|
*
|
3554
3774
|
* @private
|
3555
3775
|
* @param {Array|Object|string} collection The collection to iterate over.
|
@@ -3600,6 +3820,37 @@
|
|
3600
3820
|
return metaMap.get(func);
|
3601
3821
|
};
|
3602
3822
|
|
3823
|
+
/**
|
3824
|
+
* Gets the name of `func`.
|
3825
|
+
*
|
3826
|
+
* @private
|
3827
|
+
* @param {Function} func The function to query.
|
3828
|
+
* @returns {string} Returns the function name.
|
3829
|
+
*/
|
3830
|
+
var getFuncName = (function() {
|
3831
|
+
if (!support.funcNames) {
|
3832
|
+
return constant('');
|
3833
|
+
}
|
3834
|
+
if (constant.name == 'constant') {
|
3835
|
+
return baseProperty('name');
|
3836
|
+
}
|
3837
|
+
return function(func) {
|
3838
|
+
var result = func.name,
|
3839
|
+
array = realNames[result],
|
3840
|
+
length = array ? array.length : 0;
|
3841
|
+
|
3842
|
+
while (length--) {
|
3843
|
+
var data = array[length],
|
3844
|
+
otherFunc = data.func;
|
3845
|
+
|
3846
|
+
if (otherFunc == null || otherFunc == func) {
|
3847
|
+
return data.name;
|
3848
|
+
}
|
3849
|
+
}
|
3850
|
+
return result;
|
3851
|
+
};
|
3852
|
+
}());
|
3853
|
+
|
3603
3854
|
/**
|
3604
3855
|
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
|
3605
3856
|
* customized this function returns the custom method, otherwise it returns
|
@@ -3717,31 +3968,6 @@
|
|
3717
3968
|
return result;
|
3718
3969
|
}
|
3719
3970
|
|
3720
|
-
/**
|
3721
|
-
* Checks if `func` is eligible for `this` binding.
|
3722
|
-
*
|
3723
|
-
* @private
|
3724
|
-
* @param {Function} func The function to check.
|
3725
|
-
* @returns {boolean} Returns `true` if `func` is eligible, else `false`.
|
3726
|
-
*/
|
3727
|
-
function isBindable(func) {
|
3728
|
-
var support = lodash.support,
|
3729
|
-
result = !(support.funcNames ? func.name : support.funcDecomp);
|
3730
|
-
|
3731
|
-
if (!result) {
|
3732
|
-
var source = fnToString.call(func);
|
3733
|
-
if (!support.funcNames) {
|
3734
|
-
result = !reFuncName.test(source);
|
3735
|
-
}
|
3736
|
-
if (!result) {
|
3737
|
-
// Check if `func` references the `this` keyword and store the result.
|
3738
|
-
result = reThis.test(source) || isNative(func);
|
3739
|
-
baseSetData(func, result);
|
3740
|
-
}
|
3741
|
-
}
|
3742
|
-
return result;
|
3743
|
-
}
|
3744
|
-
|
3745
3971
|
/**
|
3746
3972
|
* Checks if `value` is a valid array-like index.
|
3747
3973
|
*
|
@@ -3783,12 +4009,22 @@
|
|
3783
4009
|
return false;
|
3784
4010
|
}
|
3785
4011
|
|
4012
|
+
/**
|
4013
|
+
* Checks if `func` has a lazy counterpart.
|
4014
|
+
*
|
4015
|
+
* @private
|
4016
|
+
* @param {Function} func The function to check.
|
4017
|
+
* @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
|
4018
|
+
*/
|
4019
|
+
function isLaziable(func) {
|
4020
|
+
var funcName = getFuncName(func);
|
4021
|
+
return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;
|
4022
|
+
}
|
4023
|
+
|
3786
4024
|
/**
|
3787
4025
|
* Checks if `value` is a valid array-like length.
|
3788
4026
|
*
|
3789
|
-
* **Note:** This function is based on
|
3790
|
-
* [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
|
3791
|
-
* for more details.
|
4027
|
+
* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
|
3792
4028
|
*
|
3793
4029
|
* @private
|
3794
4030
|
* @param {*} value The value to check.
|
@@ -3828,22 +4064,13 @@
|
|
3828
4064
|
function mergeData(data, source) {
|
3829
4065
|
var bitmask = data[1],
|
3830
4066
|
srcBitmask = source[1],
|
3831
|
-
newBitmask = bitmask | srcBitmask
|
3832
|
-
|
3833
|
-
var arityFlags = ARY_FLAG | REARG_FLAG,
|
3834
|
-
bindFlags = BIND_FLAG | BIND_KEY_FLAG,
|
3835
|
-
comboFlags = arityFlags | bindFlags | CURRY_BOUND_FLAG | CURRY_RIGHT_FLAG;
|
4067
|
+
newBitmask = bitmask | srcBitmask,
|
4068
|
+
isCommon = newBitmask < ARY_FLAG;
|
3836
4069
|
|
3837
|
-
var
|
3838
|
-
|
3839
|
-
|
3840
|
-
|
3841
|
-
|
3842
|
-
var isCommon = !(bitmask >= REARG_FLAG && srcBitmask > bindFlags) &&
|
3843
|
-
!(bitmask > bindFlags && srcBitmask >= REARG_FLAG);
|
3844
|
-
|
3845
|
-
var isCombo = (newBitmask >= arityFlags && newBitmask <= comboFlags) &&
|
3846
|
-
(bitmask < REARG_FLAG || ((isRearg || isAry) && argPos.length <= ary));
|
4070
|
+
var isCombo =
|
4071
|
+
(srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
|
4072
|
+
(srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
|
4073
|
+
(srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
|
3847
4074
|
|
3848
4075
|
// Exit early if metadata can't be merged.
|
3849
4076
|
if (!(isCommon || isCombo)) {
|
@@ -4162,10 +4389,9 @@
|
|
4162
4389
|
* Creates an array excluding all values of the provided arrays using
|
4163
4390
|
* `SameValueZero` for equality comparisons.
|
4164
4391
|
*
|
4165
|
-
* **Note:** `SameValueZero`
|
4166
|
-
* e.g. `===`, except that
|
4167
|
-
*
|
4168
|
-
* for more details.
|
4392
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
4393
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
4394
|
+
* `NaN` matches `NaN`.
|
4169
4395
|
*
|
4170
4396
|
* @static
|
4171
4397
|
* @memberOf _
|
@@ -4178,19 +4404,11 @@
|
|
4178
4404
|
* _.difference([1, 2, 3], [4, 2]);
|
4179
4405
|
* // => [1, 3]
|
4180
4406
|
*/
|
4181
|
-
|
4182
|
-
|
4183
|
-
|
4184
|
-
|
4185
|
-
|
4186
|
-
while (++index < length) {
|
4187
|
-
var value = args[index];
|
4188
|
-
if (isArray(value) || isArguments(value)) {
|
4189
|
-
break;
|
4190
|
-
}
|
4191
|
-
}
|
4192
|
-
return baseDifference(value, baseFlatten(args, false, true, ++index));
|
4193
|
-
}
|
4407
|
+
var difference = restParam(function(array, values) {
|
4408
|
+
return (isArray(array) || isArguments(array))
|
4409
|
+
? baseDifference(array, baseFlatten(values, false, true))
|
4410
|
+
: [];
|
4411
|
+
});
|
4194
4412
|
|
4195
4413
|
/**
|
4196
4414
|
* Creates a slice of `array` with `n` elements dropped from the beginning.
|
@@ -4266,7 +4484,7 @@
|
|
4266
4484
|
/**
|
4267
4485
|
* Creates a slice of `array` excluding elements dropped from the end.
|
4268
4486
|
* Elements are dropped until `predicate` returns falsey. The predicate is
|
4269
|
-
* bound to `thisArg` and invoked with three arguments
|
4487
|
+
* bound to `thisArg` and invoked with three arguments: (value, index, array).
|
4270
4488
|
*
|
4271
4489
|
* If a property name is provided for `predicate` the created `_.property`
|
4272
4490
|
* style callback returns the property value of the given element.
|
@@ -4313,19 +4531,15 @@
|
|
4313
4531
|
* // => ['barney', 'fred', 'pebbles']
|
4314
4532
|
*/
|
4315
4533
|
function dropRightWhile(array, predicate, thisArg) {
|
4316
|
-
|
4317
|
-
|
4318
|
-
|
4319
|
-
}
|
4320
|
-
predicate = getCallback(predicate, thisArg, 3);
|
4321
|
-
while (length-- && predicate(array[length], length, array)) {}
|
4322
|
-
return baseSlice(array, 0, length + 1);
|
4534
|
+
return (array && array.length)
|
4535
|
+
? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)
|
4536
|
+
: [];
|
4323
4537
|
}
|
4324
4538
|
|
4325
4539
|
/**
|
4326
4540
|
* Creates a slice of `array` excluding elements dropped from the beginning.
|
4327
4541
|
* Elements are dropped until `predicate` returns falsey. The predicate is
|
4328
|
-
* bound to `thisArg` and invoked with three arguments
|
4542
|
+
* bound to `thisArg` and invoked with three arguments: (value, index, array).
|
4329
4543
|
*
|
4330
4544
|
* If a property name is provided for `predicate` the created `_.property`
|
4331
4545
|
* style callback returns the property value of the given element.
|
@@ -4372,14 +4586,9 @@
|
|
4372
4586
|
* // => ['barney', 'fred', 'pebbles']
|
4373
4587
|
*/
|
4374
4588
|
function dropWhile(array, predicate, thisArg) {
|
4375
|
-
|
4376
|
-
|
4377
|
-
|
4378
|
-
}
|
4379
|
-
var index = -1;
|
4380
|
-
predicate = getCallback(predicate, thisArg, 3);
|
4381
|
-
while (++index < length && predicate(array[index], index, array)) {}
|
4382
|
-
return baseSlice(array, index);
|
4589
|
+
return (array && array.length)
|
4590
|
+
? baseWhile(array, getCallback(predicate, thisArg, 3), true)
|
4591
|
+
: [];
|
4383
4592
|
}
|
4384
4593
|
|
4385
4594
|
/**
|
@@ -4396,6 +4605,19 @@
|
|
4396
4605
|
* @param {number} [start=0] The start position.
|
4397
4606
|
* @param {number} [end=array.length] The end position.
|
4398
4607
|
* @returns {Array} Returns `array`.
|
4608
|
+
* @example
|
4609
|
+
*
|
4610
|
+
* var array = [1, 2, 3];
|
4611
|
+
*
|
4612
|
+
* _.fill(array, 'a');
|
4613
|
+
* console.log(array);
|
4614
|
+
* // => ['a', 'a', 'a']
|
4615
|
+
*
|
4616
|
+
* _.fill(Array(3), 2);
|
4617
|
+
* // => [2, 2, 2]
|
4618
|
+
*
|
4619
|
+
* _.fill([4, 6, 8], '*', 1, 2);
|
4620
|
+
* // => [4, '*', 8]
|
4399
4621
|
*/
|
4400
4622
|
function fill(array, value, start, end) {
|
4401
4623
|
var length = array ? array.length : 0;
|
@@ -4411,7 +4633,7 @@
|
|
4411
4633
|
|
4412
4634
|
/**
|
4413
4635
|
* This method is like `_.find` except that it returns the index of the first
|
4414
|
-
* element `predicate` returns truthy for
|
4636
|
+
* element `predicate` returns truthy for instead of the element itself.
|
4415
4637
|
*
|
4416
4638
|
* If a property name is provided for `predicate` the created `_.property`
|
4417
4639
|
* style callback returns the property value of the given element.
|
@@ -4457,18 +4679,7 @@
|
|
4457
4679
|
* _.findIndex(users, 'active');
|
4458
4680
|
* // => 2
|
4459
4681
|
*/
|
4460
|
-
|
4461
|
-
var index = -1,
|
4462
|
-
length = array ? array.length : 0;
|
4463
|
-
|
4464
|
-
predicate = getCallback(predicate, thisArg, 3);
|
4465
|
-
while (++index < length) {
|
4466
|
-
if (predicate(array[index], index, array)) {
|
4467
|
-
return index;
|
4468
|
-
}
|
4469
|
-
}
|
4470
|
-
return -1;
|
4471
|
-
}
|
4682
|
+
var findIndex = createFindIndex();
|
4472
4683
|
|
4473
4684
|
/**
|
4474
4685
|
* This method is like `_.findIndex` except that it iterates over elements
|
@@ -4518,16 +4729,7 @@
|
|
4518
4729
|
* _.findLastIndex(users, 'active');
|
4519
4730
|
* // => 0
|
4520
4731
|
*/
|
4521
|
-
|
4522
|
-
var length = array ? array.length : 0;
|
4523
|
-
predicate = getCallback(predicate, thisArg, 3);
|
4524
|
-
while (length--) {
|
4525
|
-
if (predicate(array[length], length, array)) {
|
4526
|
-
return length;
|
4527
|
-
}
|
4528
|
-
}
|
4529
|
-
return -1;
|
4530
|
-
}
|
4732
|
+
var findLastIndex = createFindIndex(true);
|
4531
4733
|
|
4532
4734
|
/**
|
4533
4735
|
* Gets the first element of `array`.
|
@@ -4564,18 +4766,18 @@
|
|
4564
4766
|
* @example
|
4565
4767
|
*
|
4566
4768
|
* _.flatten([1, [2, 3, [4]]]);
|
4567
|
-
* // => [1, 2, 3, [4]]
|
4769
|
+
* // => [1, 2, 3, [4]]
|
4568
4770
|
*
|
4569
4771
|
* // using `isDeep`
|
4570
4772
|
* _.flatten([1, [2, 3, [4]]], true);
|
4571
|
-
* // => [1, 2, 3, 4]
|
4773
|
+
* // => [1, 2, 3, 4]
|
4572
4774
|
*/
|
4573
4775
|
function flatten(array, isDeep, guard) {
|
4574
4776
|
var length = array ? array.length : 0;
|
4575
4777
|
if (guard && isIterateeCall(array, isDeep, guard)) {
|
4576
4778
|
isDeep = false;
|
4577
4779
|
}
|
4578
|
-
return length ? baseFlatten(array, isDeep
|
4780
|
+
return length ? baseFlatten(array, isDeep) : [];
|
4579
4781
|
}
|
4580
4782
|
|
4581
4783
|
/**
|
@@ -4589,11 +4791,11 @@
|
|
4589
4791
|
* @example
|
4590
4792
|
*
|
4591
4793
|
* _.flattenDeep([1, [2, 3, [4]]]);
|
4592
|
-
* // => [1, 2, 3, 4]
|
4794
|
+
* // => [1, 2, 3, 4]
|
4593
4795
|
*/
|
4594
4796
|
function flattenDeep(array) {
|
4595
4797
|
var length = array ? array.length : 0;
|
4596
|
-
return length ? baseFlatten(array, true
|
4798
|
+
return length ? baseFlatten(array, true) : [];
|
4597
4799
|
}
|
4598
4800
|
|
4599
4801
|
/**
|
@@ -4602,10 +4804,9 @@
|
|
4602
4804
|
* it is used as the offset from the end of `array`. If `array` is sorted
|
4603
4805
|
* providing `true` for `fromIndex` performs a faster binary search.
|
4604
4806
|
*
|
4605
|
-
* **Note:** `SameValueZero`
|
4606
|
-
* e.g. `===`, except that
|
4607
|
-
*
|
4608
|
-
* for more details.
|
4807
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
4808
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
4809
|
+
* `NaN` matches `NaN`.
|
4609
4810
|
*
|
4610
4811
|
* @static
|
4611
4812
|
* @memberOf _
|
@@ -4668,10 +4869,9 @@
|
|
4668
4869
|
* Creates an array of unique values in all provided arrays using `SameValueZero`
|
4669
4870
|
* for equality comparisons.
|
4670
4871
|
*
|
4671
|
-
* **Note:** `SameValueZero`
|
4672
|
-
* e.g. `===`, except that
|
4673
|
-
*
|
4674
|
-
* for more details.
|
4872
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
4873
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
4874
|
+
* `NaN` matches `NaN`.
|
4675
4875
|
*
|
4676
4876
|
* @static
|
4677
4877
|
* @memberOf _
|
@@ -4799,10 +4999,10 @@
|
|
4799
4999
|
* comparisons.
|
4800
5000
|
*
|
4801
5001
|
* **Notes:**
|
4802
|
-
* - Unlike `_.without`, this method mutates `array
|
4803
|
-
* - `SameValueZero`
|
4804
|
-
*
|
4805
|
-
*
|
5002
|
+
* - Unlike `_.without`, this method mutates `array`
|
5003
|
+
* - [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
5004
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except
|
5005
|
+
* that `NaN` matches `NaN`
|
4806
5006
|
*
|
4807
5007
|
* @static
|
4808
5008
|
* @memberOf _
|
@@ -4865,14 +5065,28 @@
|
|
4865
5065
|
* console.log(evens);
|
4866
5066
|
* // => [10, 20]
|
4867
5067
|
*/
|
4868
|
-
|
4869
|
-
|
4870
|
-
|
5068
|
+
var pullAt = restParam(function(array, indexes) {
|
5069
|
+
array || (array = []);
|
5070
|
+
indexes = baseFlatten(indexes);
|
5071
|
+
|
5072
|
+
var length = indexes.length,
|
5073
|
+
result = baseAt(array, indexes);
|
5074
|
+
|
5075
|
+
indexes.sort(baseCompareAscending);
|
5076
|
+
while (length--) {
|
5077
|
+
var index = parseFloat(indexes[length]);
|
5078
|
+
if (index != previous && isIndex(index)) {
|
5079
|
+
var previous = index;
|
5080
|
+
splice.call(array, index, 1);
|
5081
|
+
}
|
5082
|
+
}
|
5083
|
+
return result;
|
5084
|
+
});
|
4871
5085
|
|
4872
5086
|
/**
|
4873
5087
|
* Removes all elements from `array` that `predicate` returns truthy for
|
4874
5088
|
* and returns an array of the removed elements. The predicate is bound to
|
4875
|
-
* `thisArg` and invoked with three arguments
|
5089
|
+
* `thisArg` and invoked with three arguments: (value, index, array).
|
4876
5090
|
*
|
4877
5091
|
* If a property name is provided for `predicate` the created `_.property`
|
4878
5092
|
* style callback returns the property value of the given element.
|
@@ -4976,14 +5190,14 @@
|
|
4976
5190
|
* to compute their sort ranking. The iteratee is bound to `thisArg` and
|
4977
5191
|
* invoked with one argument; (value).
|
4978
5192
|
*
|
4979
|
-
* If a property name is provided for `
|
5193
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
4980
5194
|
* style callback returns the property value of the given element.
|
4981
5195
|
*
|
4982
5196
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
4983
5197
|
* style callback returns `true` for elements that have a matching property
|
4984
5198
|
* value, else `false`.
|
4985
5199
|
*
|
4986
|
-
* If an object is provided for `
|
5200
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
4987
5201
|
* callback returns `true` for elements that have the properties of the given
|
4988
5202
|
* object, else `false`.
|
4989
5203
|
*
|
@@ -5017,12 +5231,7 @@
|
|
5017
5231
|
* _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
|
5018
5232
|
* // => 1
|
5019
5233
|
*/
|
5020
|
-
|
5021
|
-
var func = getCallback(iteratee);
|
5022
|
-
return (func === baseCallback && iteratee == null)
|
5023
|
-
? binaryIndex(array, value)
|
5024
|
-
: binaryIndexBy(array, value, func(iteratee, thisArg, 1));
|
5025
|
-
}
|
5234
|
+
var sortedIndex = createSortedIndex();
|
5026
5235
|
|
5027
5236
|
/**
|
5028
5237
|
* This method is like `_.sortedIndex` except that it returns the highest
|
@@ -5044,12 +5253,7 @@
|
|
5044
5253
|
* _.sortedLastIndex([4, 4, 5, 5], 5);
|
5045
5254
|
* // => 4
|
5046
5255
|
*/
|
5047
|
-
|
5048
|
-
var func = getCallback(iteratee);
|
5049
|
-
return (func === baseCallback && iteratee == null)
|
5050
|
-
? binaryIndex(array, value, true)
|
5051
|
-
: binaryIndexBy(array, value, func(iteratee, thisArg, 1), true);
|
5052
|
-
}
|
5256
|
+
var sortedLastIndex = createSortedIndex(true);
|
5053
5257
|
|
5054
5258
|
/**
|
5055
5259
|
* Creates a slice of `array` with `n` elements taken from the beginning.
|
@@ -5125,7 +5329,7 @@
|
|
5125
5329
|
/**
|
5126
5330
|
* Creates a slice of `array` with elements taken from the end. Elements are
|
5127
5331
|
* taken until `predicate` returns falsey. The predicate is bound to `thisArg`
|
5128
|
-
* and invoked with three arguments
|
5332
|
+
* and invoked with three arguments: (value, index, array).
|
5129
5333
|
*
|
5130
5334
|
* If a property name is provided for `predicate` the created `_.property`
|
5131
5335
|
* style callback returns the property value of the given element.
|
@@ -5172,19 +5376,15 @@
|
|
5172
5376
|
* // => []
|
5173
5377
|
*/
|
5174
5378
|
function takeRightWhile(array, predicate, thisArg) {
|
5175
|
-
|
5176
|
-
|
5177
|
-
|
5178
|
-
}
|
5179
|
-
predicate = getCallback(predicate, thisArg, 3);
|
5180
|
-
while (length-- && predicate(array[length], length, array)) {}
|
5181
|
-
return baseSlice(array, length + 1);
|
5379
|
+
return (array && array.length)
|
5380
|
+
? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)
|
5381
|
+
: [];
|
5182
5382
|
}
|
5183
5383
|
|
5184
5384
|
/**
|
5185
5385
|
* Creates a slice of `array` with elements taken from the beginning. Elements
|
5186
5386
|
* are taken until `predicate` returns falsey. The predicate is bound to
|
5187
|
-
* `thisArg` and invoked with three arguments
|
5387
|
+
* `thisArg` and invoked with three arguments: (value, index, array).
|
5188
5388
|
*
|
5189
5389
|
* If a property name is provided for `predicate` the created `_.property`
|
5190
5390
|
* style callback returns the property value of the given element.
|
@@ -5231,24 +5431,18 @@
|
|
5231
5431
|
* // => []
|
5232
5432
|
*/
|
5233
5433
|
function takeWhile(array, predicate, thisArg) {
|
5234
|
-
|
5235
|
-
|
5236
|
-
|
5237
|
-
}
|
5238
|
-
var index = -1;
|
5239
|
-
predicate = getCallback(predicate, thisArg, 3);
|
5240
|
-
while (++index < length && predicate(array[index], index, array)) {}
|
5241
|
-
return baseSlice(array, 0, index);
|
5434
|
+
return (array && array.length)
|
5435
|
+
? baseWhile(array, getCallback(predicate, thisArg, 3))
|
5436
|
+
: [];
|
5242
5437
|
}
|
5243
5438
|
|
5244
5439
|
/**
|
5245
5440
|
* Creates an array of unique values, in order, of the provided arrays using
|
5246
5441
|
* `SameValueZero` for equality comparisons.
|
5247
5442
|
*
|
5248
|
-
* **Note:** `SameValueZero`
|
5249
|
-
* e.g. `===`, except that
|
5250
|
-
*
|
5251
|
-
* for more details.
|
5443
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
5444
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
5445
|
+
* `NaN` matches `NaN`.
|
5252
5446
|
*
|
5253
5447
|
* @static
|
5254
5448
|
* @memberOf _
|
@@ -5260,9 +5454,9 @@
|
|
5260
5454
|
* _.union([1, 2], [4, 2], [2, 1]);
|
5261
5455
|
* // => [1, 2, 4]
|
5262
5456
|
*/
|
5263
|
-
|
5264
|
-
return baseUniq(baseFlatten(
|
5265
|
-
}
|
5457
|
+
var union = restParam(function(arrays) {
|
5458
|
+
return baseUniq(baseFlatten(arrays, false, true));
|
5459
|
+
});
|
5266
5460
|
|
5267
5461
|
/**
|
5268
5462
|
* Creates a duplicate-value-free version of an array using `SameValueZero`
|
@@ -5270,23 +5464,22 @@
|
|
5270
5464
|
* search algorithm for sorted arrays. If an iteratee function is provided it
|
5271
5465
|
* is invoked for each value in the array to generate the criterion by which
|
5272
5466
|
* uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
|
5273
|
-
* with three arguments
|
5467
|
+
* with three arguments: (value, index, array).
|
5274
5468
|
*
|
5275
|
-
* If a property name is provided for `
|
5469
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
5276
5470
|
* style callback returns the property value of the given element.
|
5277
5471
|
*
|
5278
5472
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
5279
5473
|
* style callback returns `true` for elements that have a matching property
|
5280
5474
|
* value, else `false`.
|
5281
5475
|
*
|
5282
|
-
* If an object is provided for `
|
5476
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
5283
5477
|
* callback returns `true` for elements that have the properties of the given
|
5284
5478
|
* object, else `false`.
|
5285
5479
|
*
|
5286
|
-
* **Note:** `SameValueZero`
|
5287
|
-
* e.g. `===`, except that
|
5288
|
-
*
|
5289
|
-
* for more details.
|
5480
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
5481
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
5482
|
+
* `NaN` matches `NaN`.
|
5290
5483
|
*
|
5291
5484
|
* @static
|
5292
5485
|
* @memberOf _
|
@@ -5368,10 +5561,9 @@
|
|
5368
5561
|
* Creates an array excluding all provided values using `SameValueZero` for
|
5369
5562
|
* equality comparisons.
|
5370
5563
|
*
|
5371
|
-
* **Note:** `SameValueZero`
|
5372
|
-
* e.g. `===`, except that
|
5373
|
-
*
|
5374
|
-
* for more details.
|
5564
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
5565
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
5566
|
+
* `NaN` matches `NaN`.
|
5375
5567
|
*
|
5376
5568
|
* @static
|
5377
5569
|
* @memberOf _
|
@@ -5384,14 +5576,15 @@
|
|
5384
5576
|
* _.without([1, 2, 1, 3], 1, 2);
|
5385
5577
|
* // => [3]
|
5386
5578
|
*/
|
5387
|
-
|
5388
|
-
return
|
5389
|
-
|
5579
|
+
var without = restParam(function(array, values) {
|
5580
|
+
return (isArray(array) || isArguments(array))
|
5581
|
+
? baseDifference(array, values)
|
5582
|
+
: [];
|
5583
|
+
});
|
5390
5584
|
|
5391
5585
|
/**
|
5392
|
-
* Creates an array that is the symmetric difference
|
5393
|
-
*
|
5394
|
-
* more details.
|
5586
|
+
* Creates an array that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
5587
|
+
* of the provided arrays.
|
5395
5588
|
*
|
5396
5589
|
* @static
|
5397
5590
|
* @memberOf _
|
@@ -5433,20 +5626,13 @@
|
|
5433
5626
|
* _.zip(['fred', 'barney'], [30, 40], [true, false]);
|
5434
5627
|
* // => [['fred', 30, true], ['barney', 40, false]]
|
5435
5628
|
*/
|
5436
|
-
|
5437
|
-
var length = arguments.length,
|
5438
|
-
array = Array(length);
|
5439
|
-
|
5440
|
-
while (length--) {
|
5441
|
-
array[length] = arguments[length];
|
5442
|
-
}
|
5443
|
-
return unzip(array);
|
5444
|
-
}
|
5629
|
+
var zip = restParam(unzip);
|
5445
5630
|
|
5446
5631
|
/**
|
5447
|
-
*
|
5448
|
-
* either a single two dimensional array,
|
5449
|
-
* or two arrays, one of property names
|
5632
|
+
* The inverse of `_.pairs`; this method returns an object composed from arrays
|
5633
|
+
* of property names and values. Provide either a single two dimensional array,
|
5634
|
+
* e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
|
5635
|
+
* and one of corresponding values.
|
5450
5636
|
*
|
5451
5637
|
* @static
|
5452
5638
|
* @memberOf _
|
@@ -5457,6 +5643,9 @@
|
|
5457
5643
|
* @returns {Object} Returns the new object.
|
5458
5644
|
* @example
|
5459
5645
|
*
|
5646
|
+
* _.zipObject([['fred', 30], ['barney', 40]]);
|
5647
|
+
* // => { 'fred': 30, 'barney': 40 }
|
5648
|
+
*
|
5460
5649
|
* _.zipObject(['fred', 'barney'], [30, 40]);
|
5461
5650
|
* // => { 'fred': 30, 'barney': 40 }
|
5462
5651
|
*/
|
@@ -5553,13 +5742,14 @@
|
|
5553
5742
|
* @returns {*} Returns the result of `interceptor`.
|
5554
5743
|
* @example
|
5555
5744
|
*
|
5556
|
-
* _(
|
5557
|
-
* .
|
5745
|
+
* _(' abc ')
|
5746
|
+
* .chain()
|
5747
|
+
* .trim()
|
5558
5748
|
* .thru(function(value) {
|
5559
5749
|
* return [value];
|
5560
5750
|
* })
|
5561
5751
|
* .value();
|
5562
|
-
* // => [
|
5752
|
+
* // => ['abc']
|
5563
5753
|
*/
|
5564
5754
|
function thru(value, interceptor, thisArg) {
|
5565
5755
|
return interceptor.call(thisArg, value);
|
@@ -5749,32 +5939,32 @@
|
|
5749
5939
|
* _.at(['a', 'b', 'c'], [0, 2]);
|
5750
5940
|
* // => ['a', 'c']
|
5751
5941
|
*
|
5752
|
-
* _.at(['
|
5753
|
-
* // => ['
|
5942
|
+
* _.at(['barney', 'fred', 'pebbles'], 0, 2);
|
5943
|
+
* // => ['barney', 'pebbles']
|
5754
5944
|
*/
|
5755
|
-
|
5945
|
+
var at = restParam(function(collection, props) {
|
5756
5946
|
var length = collection ? collection.length : 0;
|
5757
5947
|
if (isLength(length)) {
|
5758
5948
|
collection = toIterable(collection);
|
5759
5949
|
}
|
5760
|
-
return baseAt(collection, baseFlatten(
|
5761
|
-
}
|
5950
|
+
return baseAt(collection, baseFlatten(props));
|
5951
|
+
});
|
5762
5952
|
|
5763
5953
|
/**
|
5764
5954
|
* Creates an object composed of keys generated from the results of running
|
5765
5955
|
* each element of `collection` through `iteratee`. The corresponding value
|
5766
5956
|
* of each key is the number of times the key was returned by `iteratee`.
|
5767
|
-
* The `iteratee` is bound to `thisArg` and invoked with three arguments
|
5957
|
+
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
5768
5958
|
* (value, index|key, collection).
|
5769
5959
|
*
|
5770
|
-
* If a property name is provided for `
|
5960
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
5771
5961
|
* style callback returns the property value of the given element.
|
5772
5962
|
*
|
5773
5963
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
5774
5964
|
* style callback returns `true` for elements that have a matching property
|
5775
5965
|
* value, else `false`.
|
5776
5966
|
*
|
5777
|
-
* If an object is provided for `
|
5967
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
5778
5968
|
* callback returns `true` for elements that have the properties of the given
|
5779
5969
|
* object, else `false`.
|
5780
5970
|
*
|
@@ -5807,7 +5997,7 @@
|
|
5807
5997
|
|
5808
5998
|
/**
|
5809
5999
|
* Checks if `predicate` returns truthy for **all** elements of `collection`.
|
5810
|
-
* The predicate is bound to `thisArg` and invoked with three arguments
|
6000
|
+
* The predicate is bound to `thisArg` and invoked with three arguments:
|
5811
6001
|
* (value, index|key, collection).
|
5812
6002
|
*
|
5813
6003
|
* If a property name is provided for `predicate` the created `_.property`
|
@@ -5855,6 +6045,9 @@
|
|
5855
6045
|
*/
|
5856
6046
|
function every(collection, predicate, thisArg) {
|
5857
6047
|
var func = isArray(collection) ? arrayEvery : baseEvery;
|
6048
|
+
if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
|
6049
|
+
predicate = null;
|
6050
|
+
}
|
5858
6051
|
if (typeof predicate != 'function' || typeof thisArg != 'undefined') {
|
5859
6052
|
predicate = getCallback(predicate, thisArg, 3);
|
5860
6053
|
}
|
@@ -5864,7 +6057,7 @@
|
|
5864
6057
|
/**
|
5865
6058
|
* Iterates over elements of `collection`, returning an array of all elements
|
5866
6059
|
* `predicate` returns truthy for. The predicate is bound to `thisArg` and
|
5867
|
-
* invoked with three arguments
|
6060
|
+
* invoked with three arguments: (value, index|key, collection).
|
5868
6061
|
*
|
5869
6062
|
* If a property name is provided for `predicate` the created `_.property`
|
5870
6063
|
* style callback returns the property value of the given element.
|
@@ -5919,7 +6112,7 @@
|
|
5919
6112
|
/**
|
5920
6113
|
* Iterates over elements of `collection`, returning the first element
|
5921
6114
|
* `predicate` returns truthy for. The predicate is bound to `thisArg` and
|
5922
|
-
* invoked with three arguments
|
6115
|
+
* invoked with three arguments: (value, index|key, collection).
|
5923
6116
|
*
|
5924
6117
|
* If a property name is provided for `predicate` the created `_.property`
|
5925
6118
|
* style callback returns the property value of the given element.
|
@@ -5966,14 +6159,7 @@
|
|
5966
6159
|
* _.result(_.find(users, 'active'), 'user');
|
5967
6160
|
* // => 'barney'
|
5968
6161
|
*/
|
5969
|
-
|
5970
|
-
if (isArray(collection)) {
|
5971
|
-
var index = findIndex(collection, predicate, thisArg);
|
5972
|
-
return index > -1 ? collection[index] : undefined;
|
5973
|
-
}
|
5974
|
-
predicate = getCallback(predicate, thisArg, 3);
|
5975
|
-
return baseFind(collection, predicate, baseEach);
|
5976
|
-
}
|
6162
|
+
var find = createFind(baseEach);
|
5977
6163
|
|
5978
6164
|
/**
|
5979
6165
|
* This method is like `_.find` except that it iterates over elements of
|
@@ -5994,10 +6180,7 @@
|
|
5994
6180
|
* });
|
5995
6181
|
* // => 3
|
5996
6182
|
*/
|
5997
|
-
|
5998
|
-
predicate = getCallback(predicate, thisArg, 3);
|
5999
|
-
return baseFind(collection, predicate, baseEachRight);
|
6000
|
-
}
|
6183
|
+
var findLast = createFind(baseEachRight, true);
|
6001
6184
|
|
6002
6185
|
/**
|
6003
6186
|
* Performs a deep comparison between each element in `collection` and the
|
@@ -6034,7 +6217,7 @@
|
|
6034
6217
|
|
6035
6218
|
/**
|
6036
6219
|
* Iterates over elements of `collection` invoking `iteratee` for each element.
|
6037
|
-
* The `iteratee` is bound to `thisArg` and invoked with three arguments
|
6220
|
+
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
6038
6221
|
* (value, index|key, collection). Iterator functions may exit iteration early
|
6039
6222
|
* by explicitly returning `false`.
|
6040
6223
|
*
|
@@ -6062,11 +6245,7 @@
|
|
6062
6245
|
* });
|
6063
6246
|
* // => logs each value-key pair and returns the object (iteration order is not guaranteed)
|
6064
6247
|
*/
|
6065
|
-
|
6066
|
-
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
6067
|
-
? arrayEach(collection, iteratee)
|
6068
|
-
: baseEach(collection, bindCallback(iteratee, thisArg, 3));
|
6069
|
-
}
|
6248
|
+
var forEach = createForEach(arrayEach, baseEach);
|
6070
6249
|
|
6071
6250
|
/**
|
6072
6251
|
* This method is like `_.forEach` except that it iterates over elements of
|
@@ -6084,30 +6263,26 @@
|
|
6084
6263
|
*
|
6085
6264
|
* _([1, 2]).forEachRight(function(n) {
|
6086
6265
|
* console.log(n);
|
6087
|
-
* }).
|
6266
|
+
* }).value();
|
6088
6267
|
* // => logs each value from right to left and returns the array
|
6089
6268
|
*/
|
6090
|
-
|
6091
|
-
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
6092
|
-
? arrayEachRight(collection, iteratee)
|
6093
|
-
: baseEachRight(collection, bindCallback(iteratee, thisArg, 3));
|
6094
|
-
}
|
6269
|
+
var forEachRight = createForEach(arrayEachRight, baseEachRight);
|
6095
6270
|
|
6096
6271
|
/**
|
6097
6272
|
* Creates an object composed of keys generated from the results of running
|
6098
6273
|
* each element of `collection` through `iteratee`. The corresponding value
|
6099
6274
|
* of each key is an array of the elements responsible for generating the key.
|
6100
|
-
* The `iteratee` is bound to `thisArg` and invoked with three arguments
|
6275
|
+
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
6101
6276
|
* (value, index|key, collection).
|
6102
6277
|
*
|
6103
|
-
* If a property name is provided for `
|
6278
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
6104
6279
|
* style callback returns the property value of the given element.
|
6105
6280
|
*
|
6106
6281
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
6107
6282
|
* style callback returns `true` for elements that have a matching property
|
6108
6283
|
* value, else `false`.
|
6109
6284
|
*
|
6110
|
-
* If an object is provided for `
|
6285
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
6111
6286
|
* callback returns `true` for elements that have the properties of the given
|
6112
6287
|
* object, else `false`.
|
6113
6288
|
*
|
@@ -6148,10 +6323,9 @@
|
|
6148
6323
|
* comparisons. If `fromIndex` is negative, it is used as the offset from
|
6149
6324
|
* the end of `collection`.
|
6150
6325
|
*
|
6151
|
-
* **Note:** `SameValueZero`
|
6152
|
-
* e.g. `===`, except that
|
6153
|
-
*
|
6154
|
-
* for more details.
|
6326
|
+
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
6327
|
+
* comparisons are like strict equality comparisons, e.g. `===`, except that
|
6328
|
+
* `NaN` matches `NaN`.
|
6155
6329
|
*
|
6156
6330
|
* @static
|
6157
6331
|
* @memberOf _
|
@@ -6160,6 +6334,7 @@
|
|
6160
6334
|
* @param {Array|Object|string} collection The collection to search.
|
6161
6335
|
* @param {*} target The value to search for.
|
6162
6336
|
* @param {number} [fromIndex=0] The index to search from.
|
6337
|
+
* @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
|
6163
6338
|
* @returns {boolean} Returns `true` if a matching element is found, else `false`.
|
6164
6339
|
* @example
|
6165
6340
|
*
|
@@ -6175,7 +6350,7 @@
|
|
6175
6350
|
* _.includes('pebbles', 'eb');
|
6176
6351
|
* // => true
|
6177
6352
|
*/
|
6178
|
-
function includes(collection, target, fromIndex) {
|
6353
|
+
function includes(collection, target, fromIndex, guard) {
|
6179
6354
|
var length = collection ? collection.length : 0;
|
6180
6355
|
if (!isLength(length)) {
|
6181
6356
|
collection = values(collection);
|
@@ -6184,10 +6359,10 @@
|
|
6184
6359
|
if (!length) {
|
6185
6360
|
return false;
|
6186
6361
|
}
|
6187
|
-
if (typeof fromIndex
|
6188
|
-
fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
|
6189
|
-
} else {
|
6362
|
+
if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
|
6190
6363
|
fromIndex = 0;
|
6364
|
+
} else {
|
6365
|
+
fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
|
6191
6366
|
}
|
6192
6367
|
return (typeof collection == 'string' || !isArray(collection) && isString(collection))
|
6193
6368
|
? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)
|
@@ -6198,17 +6373,17 @@
|
|
6198
6373
|
* Creates an object composed of keys generated from the results of running
|
6199
6374
|
* each element of `collection` through `iteratee`. The corresponding value
|
6200
6375
|
* of each key is the last element responsible for generating the key. The
|
6201
|
-
* iteratee function is bound to `thisArg` and invoked with three arguments
|
6376
|
+
* iteratee function is bound to `thisArg` and invoked with three arguments:
|
6202
6377
|
* (value, index|key, collection).
|
6203
6378
|
*
|
6204
|
-
* If a property name is provided for `
|
6379
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
6205
6380
|
* style callback returns the property value of the given element.
|
6206
6381
|
*
|
6207
6382
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
6208
6383
|
* style callback returns `true` for elements that have a matching property
|
6209
6384
|
* value, else `false`.
|
6210
6385
|
*
|
6211
|
-
* If an object is provided for `
|
6386
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
6212
6387
|
* callback returns `true` for elements that have the properties of the given
|
6213
6388
|
* object, else `false`.
|
6214
6389
|
*
|
@@ -6266,23 +6441,32 @@
|
|
6266
6441
|
* _.invoke([123, 456], String.prototype.split, '');
|
6267
6442
|
* // => [['1', '2', '3'], ['4', '5', '6']]
|
6268
6443
|
*/
|
6269
|
-
|
6270
|
-
|
6271
|
-
|
6444
|
+
var invoke = restParam(function(collection, methodName, args) {
|
6445
|
+
var index = -1,
|
6446
|
+
isFunc = typeof methodName == 'function',
|
6447
|
+
length = collection ? collection.length : 0,
|
6448
|
+
result = isLength(length) ? Array(length) : [];
|
6449
|
+
|
6450
|
+
baseEach(collection, function(value) {
|
6451
|
+
var func = isFunc ? methodName : (value != null && value[methodName]);
|
6452
|
+
result[++index] = func ? func.apply(value, args) : undefined;
|
6453
|
+
});
|
6454
|
+
return result;
|
6455
|
+
});
|
6272
6456
|
|
6273
6457
|
/**
|
6274
6458
|
* Creates an array of values by running each element in `collection` through
|
6275
6459
|
* `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
|
6276
|
-
* arguments
|
6460
|
+
* arguments: (value, index|key, collection).
|
6277
6461
|
*
|
6278
|
-
* If a property name is provided for `
|
6462
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
6279
6463
|
* style callback returns the property value of the given element.
|
6280
6464
|
*
|
6281
6465
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
6282
6466
|
* style callback returns `true` for elements that have a matching property
|
6283
6467
|
* value, else `false`.
|
6284
6468
|
*
|
6285
|
-
* If an object is provided for `
|
6469
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
6286
6470
|
* callback returns `true` for elements that have the properties of the given
|
6287
6471
|
* object, else `false`.
|
6288
6472
|
*
|
@@ -6291,9 +6475,9 @@
|
|
6291
6475
|
*
|
6292
6476
|
* The guarded methods are:
|
6293
6477
|
* `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, `drop`,
|
6294
|
-
* `dropRight`, `fill`, `flatten`, `invert`, `max`, `min`, `parseInt`,
|
6295
|
-
* `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimLeft`,
|
6296
|
-
* `trunc`, `random`, `range`, `sample`, `uniq`, and `words`
|
6478
|
+
* `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, `parseInt`,
|
6479
|
+
* `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimLeft`,
|
6480
|
+
* `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, `uniq`, and `words`
|
6297
6481
|
*
|
6298
6482
|
* @static
|
6299
6483
|
* @memberOf _
|
@@ -6336,7 +6520,7 @@
|
|
6336
6520
|
* Creates an array of elements split into two groups, the first of which
|
6337
6521
|
* contains elements `predicate` returns truthy for, while the second of which
|
6338
6522
|
* contains elements `predicate` returns falsey for. The predicate is bound
|
6339
|
-
* to `thisArg` and invoked with three arguments
|
6523
|
+
* to `thisArg` and invoked with three arguments: (value, index|key, collection).
|
6340
6524
|
*
|
6341
6525
|
* If a property name is provided for `predicate` the created `_.property`
|
6342
6526
|
* style callback returns the property value of the given element.
|
@@ -6427,14 +6611,14 @@
|
|
6427
6611
|
* each element in `collection` through `iteratee`, where each successive
|
6428
6612
|
* invocation is supplied the return value of the previous. If `accumulator`
|
6429
6613
|
* is not provided the first element of `collection` is used as the initial
|
6430
|
-
* value. The `iteratee` is bound to `thisArg`and invoked with four arguments
|
6614
|
+
* value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
|
6431
6615
|
* (accumulator, value, index|key, collection).
|
6432
6616
|
*
|
6433
6617
|
* Many lodash methods are guarded to work as interatees for methods like
|
6434
6618
|
* `_.reduce`, `_.reduceRight`, and `_.transform`.
|
6435
6619
|
*
|
6436
6620
|
* The guarded methods are:
|
6437
|
-
* `assign`, `defaults`, `merge`, and `
|
6621
|
+
* `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`
|
6438
6622
|
*
|
6439
6623
|
* @static
|
6440
6624
|
* @memberOf _
|
@@ -6458,10 +6642,7 @@
|
|
6458
6642
|
* }, {});
|
6459
6643
|
* // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
|
6460
6644
|
*/
|
6461
|
-
|
6462
|
-
var func = isArray(collection) ? arrayReduce : baseReduce;
|
6463
|
-
return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEach);
|
6464
|
-
}
|
6645
|
+
var reduce = createReduce(arrayReduce, baseEach);
|
6465
6646
|
|
6466
6647
|
/**
|
6467
6648
|
* This method is like `_.reduce` except that it iterates over elements of
|
@@ -6485,10 +6666,7 @@
|
|
6485
6666
|
* }, []);
|
6486
6667
|
* // => [4, 5, 2, 3, 0, 1]
|
6487
6668
|
*/
|
6488
|
-
|
6489
|
-
var func = isArray(collection) ? arrayReduceRight : baseReduce;
|
6490
|
-
return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEachRight);
|
6491
|
-
}
|
6669
|
+
var reduceRight = createReduce(arrayReduceRight, baseEachRight);
|
6492
6670
|
|
6493
6671
|
/**
|
6494
6672
|
* The opposite of `_.filter`; this method returns the elements of `collection`
|
@@ -6575,9 +6753,8 @@
|
|
6575
6753
|
}
|
6576
6754
|
|
6577
6755
|
/**
|
6578
|
-
* Creates an array of shuffled values, using a version of the
|
6579
|
-
* shuffle
|
6580
|
-
* for more details.
|
6756
|
+
* Creates an array of shuffled values, using a version of the
|
6757
|
+
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
|
6581
6758
|
*
|
6582
6759
|
* @static
|
6583
6760
|
* @memberOf _
|
@@ -6635,7 +6812,7 @@
|
|
6635
6812
|
* Checks if `predicate` returns truthy for **any** element of `collection`.
|
6636
6813
|
* The function returns as soon as it finds a passing value and does not iterate
|
6637
6814
|
* over the entire collection. The predicate is bound to `thisArg` and invoked
|
6638
|
-
* with three arguments
|
6815
|
+
* with three arguments: (value, index|key, collection).
|
6639
6816
|
*
|
6640
6817
|
* If a property name is provided for `predicate` the created `_.property`
|
6641
6818
|
* style callback returns the property value of the given element.
|
@@ -6682,6 +6859,9 @@
|
|
6682
6859
|
*/
|
6683
6860
|
function some(collection, predicate, thisArg) {
|
6684
6861
|
var func = isArray(collection) ? arraySome : baseSome;
|
6862
|
+
if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
|
6863
|
+
predicate = null;
|
6864
|
+
}
|
6685
6865
|
if (typeof predicate != 'function' || typeof thisArg != 'undefined') {
|
6686
6866
|
predicate = getCallback(predicate, thisArg, 3);
|
6687
6867
|
}
|
@@ -6692,17 +6872,17 @@
|
|
6692
6872
|
* Creates an array of elements, sorted in ascending order by the results of
|
6693
6873
|
* running each element in a collection through `iteratee`. This method performs
|
6694
6874
|
* a stable sort, that is, it preserves the original sort order of equal elements.
|
6695
|
-
* The `iteratee` is bound to `thisArg` and invoked with three arguments
|
6875
|
+
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
6696
6876
|
* (value, index|key, collection).
|
6697
6877
|
*
|
6698
|
-
* If a property name is provided for `
|
6878
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
6699
6879
|
* style callback returns the property value of the given element.
|
6700
6880
|
*
|
6701
6881
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
6702
6882
|
* style callback returns `true` for elements that have a matching property
|
6703
6883
|
* value, else `false`.
|
6704
6884
|
*
|
6705
|
-
* If an object is provided for `
|
6885
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
6706
6886
|
* callback returns `true` for elements that have the properties of the given
|
6707
6887
|
* object, else `false`.
|
6708
6888
|
*
|
@@ -6778,17 +6958,24 @@
|
|
6778
6958
|
* _.map(_.sortByAll(users, ['user', 'age']), _.values);
|
6779
6959
|
* // => [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]]
|
6780
6960
|
*/
|
6781
|
-
function sortByAll(
|
6961
|
+
function sortByAll() {
|
6962
|
+
var args = arguments,
|
6963
|
+
collection = args[0],
|
6964
|
+
guard = args[3],
|
6965
|
+
index = 0,
|
6966
|
+
length = args.length - 1;
|
6967
|
+
|
6782
6968
|
if (collection == null) {
|
6783
6969
|
return [];
|
6784
6970
|
}
|
6785
|
-
var
|
6786
|
-
|
6787
|
-
|
6971
|
+
var props = Array(length);
|
6972
|
+
while (index < length) {
|
6973
|
+
props[index] = args[++index];
|
6974
|
+
}
|
6788
6975
|
if (guard && isIterateeCall(args[1], args[2], guard)) {
|
6789
|
-
|
6976
|
+
props = args[1];
|
6790
6977
|
}
|
6791
|
-
return baseSortByOrder(collection, baseFlatten(
|
6978
|
+
return baseSortByOrder(collection, baseFlatten(props), []);
|
6792
6979
|
}
|
6793
6980
|
|
6794
6981
|
/**
|
@@ -7007,7 +7194,7 @@
|
|
7007
7194
|
* @category Function
|
7008
7195
|
* @param {Function} func The function to bind.
|
7009
7196
|
* @param {*} thisArg The `this` binding of `func`.
|
7010
|
-
* @param {...*} [
|
7197
|
+
* @param {...*} [partials] The arguments to be partially applied.
|
7011
7198
|
* @returns {Function} Returns the new bound function.
|
7012
7199
|
* @example
|
7013
7200
|
*
|
@@ -7026,16 +7213,14 @@
|
|
7026
7213
|
* bound('hi');
|
7027
7214
|
* // => 'hi fred!'
|
7028
7215
|
*/
|
7029
|
-
|
7216
|
+
var bind = restParam(function(func, thisArg, partials) {
|
7030
7217
|
var bitmask = BIND_FLAG;
|
7031
|
-
if (
|
7032
|
-
var
|
7033
|
-
holders = replaceHolders(partials, bind.placeholder);
|
7034
|
-
|
7218
|
+
if (partials.length) {
|
7219
|
+
var holders = replaceHolders(partials, bind.placeholder);
|
7035
7220
|
bitmask |= PARTIAL_FLAG;
|
7036
7221
|
}
|
7037
7222
|
return createWrapper(func, bitmask, thisArg, partials, holders);
|
7038
|
-
}
|
7223
|
+
});
|
7039
7224
|
|
7040
7225
|
/**
|
7041
7226
|
* Binds methods of an object to the object itself, overwriting the existing
|
@@ -7065,13 +7250,18 @@
|
|
7065
7250
|
* jQuery('#docs').on('click', view.onClick);
|
7066
7251
|
* // => logs 'clicked docs' when the element is clicked
|
7067
7252
|
*/
|
7068
|
-
|
7069
|
-
|
7070
|
-
|
7071
|
-
|
7072
|
-
|
7073
|
-
|
7074
|
-
|
7253
|
+
var bindAll = restParam(function(object, methodNames) {
|
7254
|
+
methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
|
7255
|
+
|
7256
|
+
var index = -1,
|
7257
|
+
length = methodNames.length;
|
7258
|
+
|
7259
|
+
while (++index < length) {
|
7260
|
+
var key = methodNames[index];
|
7261
|
+
object[key] = createWrapper(object[key], BIND_FLAG, object);
|
7262
|
+
}
|
7263
|
+
return object;
|
7264
|
+
});
|
7075
7265
|
|
7076
7266
|
/**
|
7077
7267
|
* Creates a function that invokes the method at `object[key]` and prepends
|
@@ -7090,7 +7280,7 @@
|
|
7090
7280
|
* @category Function
|
7091
7281
|
* @param {Object} object The object the method belongs to.
|
7092
7282
|
* @param {string} key The key of the method.
|
7093
|
-
* @param {...*} [
|
7283
|
+
* @param {...*} [partials] The arguments to be partially applied.
|
7094
7284
|
* @returns {Function} Returns the new bound function.
|
7095
7285
|
* @example
|
7096
7286
|
*
|
@@ -7117,16 +7307,14 @@
|
|
7117
7307
|
* bound('hi');
|
7118
7308
|
* // => 'hiya fred!'
|
7119
7309
|
*/
|
7120
|
-
|
7310
|
+
var bindKey = restParam(function(object, key, partials) {
|
7121
7311
|
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
|
7122
|
-
if (
|
7123
|
-
var
|
7124
|
-
holders = replaceHolders(partials, bindKey.placeholder);
|
7125
|
-
|
7312
|
+
if (partials.length) {
|
7313
|
+
var holders = replaceHolders(partials, bindKey.placeholder);
|
7126
7314
|
bitmask |= PARTIAL_FLAG;
|
7127
7315
|
}
|
7128
7316
|
return createWrapper(key, bitmask, object, partials, holders);
|
7129
|
-
}
|
7317
|
+
});
|
7130
7318
|
|
7131
7319
|
/**
|
7132
7320
|
* Creates a function that accepts one or more arguments of `func` that when
|
@@ -7168,14 +7356,7 @@
|
|
7168
7356
|
* curried(1)(_, 3)(2);
|
7169
7357
|
* // => [1, 2, 3]
|
7170
7358
|
*/
|
7171
|
-
|
7172
|
-
if (guard && isIterateeCall(func, arity, guard)) {
|
7173
|
-
arity = null;
|
7174
|
-
}
|
7175
|
-
var result = createWrapper(func, CURRY_FLAG, null, null, null, null, null, arity);
|
7176
|
-
result.placeholder = curry.placeholder;
|
7177
|
-
return result;
|
7178
|
-
}
|
7359
|
+
var curry = createCurry(CURRY_FLAG);
|
7179
7360
|
|
7180
7361
|
/**
|
7181
7362
|
* This method is like `_.curry` except that arguments are applied to `func`
|
@@ -7214,14 +7395,7 @@
|
|
7214
7395
|
* curried(3)(1, _)(2);
|
7215
7396
|
* // => [1, 2, 3]
|
7216
7397
|
*/
|
7217
|
-
|
7218
|
-
if (guard && isIterateeCall(func, arity, guard)) {
|
7219
|
-
arity = null;
|
7220
|
-
}
|
7221
|
-
var result = createWrapper(func, CURRY_RIGHT_FLAG, null, null, null, null, null, arity);
|
7222
|
-
result.placeholder = curryRight.placeholder;
|
7223
|
-
return result;
|
7224
|
-
}
|
7398
|
+
var curryRight = createCurry(CURRY_RIGHT_FLAG);
|
7225
7399
|
|
7226
7400
|
/**
|
7227
7401
|
* Creates a function that delays invoking `func` until after `wait` milliseconds
|
@@ -7416,9 +7590,9 @@
|
|
7416
7590
|
* }, 'deferred');
|
7417
7591
|
* // logs 'deferred' after one or more milliseconds
|
7418
7592
|
*/
|
7419
|
-
|
7420
|
-
return baseDelay(func, 1,
|
7421
|
-
}
|
7593
|
+
var defer = restParam(function(func, args) {
|
7594
|
+
return baseDelay(func, 1, args);
|
7595
|
+
});
|
7422
7596
|
|
7423
7597
|
/**
|
7424
7598
|
* Invokes `func` after `wait` milliseconds. Any additional arguments are
|
@@ -7438,9 +7612,9 @@
|
|
7438
7612
|
* }, 1000, 'later');
|
7439
7613
|
* // => logs 'later' after one second
|
7440
7614
|
*/
|
7441
|
-
|
7442
|
-
return baseDelay(func, wait,
|
7443
|
-
}
|
7615
|
+
var delay = restParam(function(func, wait, args) {
|
7616
|
+
return baseDelay(func, wait, args);
|
7617
|
+
});
|
7444
7618
|
|
7445
7619
|
/**
|
7446
7620
|
* Creates a function that returns the result of invoking the provided
|
@@ -7462,7 +7636,7 @@
|
|
7462
7636
|
* addSquare(1, 2);
|
7463
7637
|
* // => 9
|
7464
7638
|
*/
|
7465
|
-
var flow =
|
7639
|
+
var flow = createFlow();
|
7466
7640
|
|
7467
7641
|
/**
|
7468
7642
|
* This method is like `_.flow` except that it creates a function that
|
@@ -7484,7 +7658,7 @@
|
|
7484
7658
|
* addSquare(1, 2);
|
7485
7659
|
* // => 9
|
7486
7660
|
*/
|
7487
|
-
var flowRight =
|
7661
|
+
var flowRight = createFlow(true);
|
7488
7662
|
|
7489
7663
|
/**
|
7490
7664
|
* Creates a function that memoizes the result of `func`. If `resolver` is
|
@@ -7496,10 +7670,8 @@
|
|
7496
7670
|
*
|
7497
7671
|
* **Note:** The cache is exposed as the `cache` property on the memoized
|
7498
7672
|
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
7499
|
-
* constructor with one whose instances implement the
|
7500
|
-
* of `get`, `has`, and `set`.
|
7501
|
-
* [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object)
|
7502
|
-
* for more details.
|
7673
|
+
* constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object)
|
7674
|
+
* method interface of `get`, `has`, and `set`.
|
7503
7675
|
*
|
7504
7676
|
* @static
|
7505
7677
|
* @memberOf _
|
@@ -7590,7 +7762,7 @@
|
|
7590
7762
|
/**
|
7591
7763
|
* Creates a function that is restricted to invoking `func` once. Repeat calls
|
7592
7764
|
* to the function return the value of the first call. The `func` is invoked
|
7593
|
-
* with the `this` binding of the created function.
|
7765
|
+
* with the `this` binding and arguments of the created function.
|
7594
7766
|
*
|
7595
7767
|
* @static
|
7596
7768
|
* @memberOf _
|
@@ -7623,7 +7795,7 @@
|
|
7623
7795
|
* @memberOf _
|
7624
7796
|
* @category Function
|
7625
7797
|
* @param {Function} func The function to partially apply arguments to.
|
7626
|
-
* @param {...*} [
|
7798
|
+
* @param {...*} [partials] The arguments to be partially applied.
|
7627
7799
|
* @returns {Function} Returns the new partially applied function.
|
7628
7800
|
* @example
|
7629
7801
|
*
|
@@ -7640,12 +7812,7 @@
|
|
7640
7812
|
* greetFred('hi');
|
7641
7813
|
* // => 'hi fred'
|
7642
7814
|
*/
|
7643
|
-
|
7644
|
-
var partials = baseSlice(arguments, 1),
|
7645
|
-
holders = replaceHolders(partials, partial.placeholder);
|
7646
|
-
|
7647
|
-
return createWrapper(func, PARTIAL_FLAG, null, partials, holders);
|
7648
|
-
}
|
7815
|
+
var partial = createPartial(PARTIAL_FLAG);
|
7649
7816
|
|
7650
7817
|
/**
|
7651
7818
|
* This method is like `_.partial` except that partially applied arguments
|
@@ -7661,7 +7828,7 @@
|
|
7661
7828
|
* @memberOf _
|
7662
7829
|
* @category Function
|
7663
7830
|
* @param {Function} func The function to partially apply arguments to.
|
7664
|
-
* @param {...*} [
|
7831
|
+
* @param {...*} [partials] The arguments to be partially applied.
|
7665
7832
|
* @returns {Function} Returns the new partially applied function.
|
7666
7833
|
* @example
|
7667
7834
|
*
|
@@ -7678,12 +7845,7 @@
|
|
7678
7845
|
* sayHelloTo('fred');
|
7679
7846
|
* // => 'hello fred'
|
7680
7847
|
*/
|
7681
|
-
|
7682
|
-
var partials = baseSlice(arguments, 1),
|
7683
|
-
holders = replaceHolders(partials, partialRight.placeholder);
|
7684
|
-
|
7685
|
-
return createWrapper(func, PARTIAL_RIGHT_FLAG, null, partials, holders);
|
7686
|
-
}
|
7848
|
+
var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
|
7687
7849
|
|
7688
7850
|
/**
|
7689
7851
|
* Creates a function that invokes `func` with arguments arranged according
|
@@ -7713,29 +7875,80 @@
|
|
7713
7875
|
* }, [1, 2, 3]);
|
7714
7876
|
* // => [3, 6, 9]
|
7715
7877
|
*/
|
7716
|
-
|
7717
|
-
|
7718
|
-
|
7719
|
-
}
|
7878
|
+
var rearg = restParam(function(func, indexes) {
|
7879
|
+
return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes));
|
7880
|
+
});
|
7720
7881
|
|
7721
7882
|
/**
|
7722
7883
|
* Creates a function that invokes `func` with the `this` binding of the
|
7723
|
-
* created function and
|
7724
|
-
*
|
7884
|
+
* created function and arguments from `start` and beyond provided as an array.
|
7885
|
+
*
|
7886
|
+
* **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
|
7887
|
+
*
|
7888
|
+
* @static
|
7889
|
+
* @memberOf _
|
7890
|
+
* @category Function
|
7891
|
+
* @param {Function} func The function to apply a rest parameter to.
|
7892
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
7893
|
+
* @returns {Function} Returns the new function.
|
7894
|
+
* @example
|
7895
|
+
*
|
7896
|
+
* var say = _.restParam(function(what, names) {
|
7897
|
+
* return what + ' ' + _.initial(names).join(', ') +
|
7898
|
+
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
|
7899
|
+
* });
|
7900
|
+
*
|
7901
|
+
* say('hello', 'fred', 'barney', 'pebbles');
|
7902
|
+
* // => 'hello fred, barney, & pebbles'
|
7903
|
+
*/
|
7904
|
+
function restParam(func, start) {
|
7905
|
+
if (typeof func != 'function') {
|
7906
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
7907
|
+
}
|
7908
|
+
start = nativeMax(typeof start == 'undefined' ? (func.length - 1) : (+start || 0), 0);
|
7909
|
+
return function() {
|
7910
|
+
var args = arguments,
|
7911
|
+
index = -1,
|
7912
|
+
length = nativeMax(args.length - start, 0),
|
7913
|
+
rest = Array(length);
|
7914
|
+
|
7915
|
+
while (++index < length) {
|
7916
|
+
rest[index] = args[start + index];
|
7917
|
+
}
|
7918
|
+
switch (start) {
|
7919
|
+
case 0: return func.call(this, rest);
|
7920
|
+
case 1: return func.call(this, args[0], rest);
|
7921
|
+
case 2: return func.call(this, args[0], args[1], rest);
|
7922
|
+
}
|
7923
|
+
var otherArgs = Array(start + 1);
|
7924
|
+
index = -1;
|
7925
|
+
while (++index < start) {
|
7926
|
+
otherArgs[index] = args[index];
|
7927
|
+
}
|
7928
|
+
otherArgs[start] = rest;
|
7929
|
+
return func.apply(this, otherArgs);
|
7930
|
+
};
|
7931
|
+
}
|
7932
|
+
|
7933
|
+
/**
|
7934
|
+
* Creates a function that invokes `func` with the `this` binding of the created
|
7935
|
+
* function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
|
7936
|
+
*
|
7937
|
+
* **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
|
7725
7938
|
*
|
7726
7939
|
* @static
|
7727
7940
|
* @memberOf _
|
7728
7941
|
* @category Function
|
7729
7942
|
* @param {Function} func The function to spread arguments over.
|
7730
|
-
* @returns {
|
7943
|
+
* @returns {Function} Returns the new function.
|
7731
7944
|
* @example
|
7732
7945
|
*
|
7733
|
-
* var
|
7946
|
+
* var say = _.spread(function(who, what) {
|
7734
7947
|
* return who + ' says ' + what;
|
7735
7948
|
* });
|
7736
7949
|
*
|
7737
|
-
*
|
7738
|
-
* // => '
|
7950
|
+
* say(['fred', 'hello']);
|
7951
|
+
* // => 'fred says hello'
|
7739
7952
|
*
|
7740
7953
|
* // with a Promise
|
7741
7954
|
* var numbers = Promise.all([
|
@@ -7850,12 +8063,12 @@
|
|
7850
8063
|
* cloning is handled by the method instead. The `customizer` is bound to
|
7851
8064
|
* `thisArg` and invoked with two argument; (value [, index|key, object]).
|
7852
8065
|
*
|
7853
|
-
* **Note:** This method is loosely based on the
|
8066
|
+
* **Note:** This method is loosely based on the
|
8067
|
+
* [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
|
7854
8068
|
* The enumerable properties of `arguments` objects and objects created by
|
7855
8069
|
* constructors other than `Object` are cloned to plain `Object` objects. An
|
7856
8070
|
* empty object is returned for uncloneable values such as functions, DOM nodes,
|
7857
|
-
* Maps, Sets, and WeakMaps.
|
7858
|
-
* for more details.
|
8071
|
+
* Maps, Sets, and WeakMaps.
|
7859
8072
|
*
|
7860
8073
|
* @static
|
7861
8074
|
* @memberOf _
|
@@ -7913,12 +8126,12 @@
|
|
7913
8126
|
* is handled by the method instead. The `customizer` is bound to `thisArg`
|
7914
8127
|
* and invoked with two argument; (value [, index|key, object]).
|
7915
8128
|
*
|
7916
|
-
* **Note:** This method is loosely based on the
|
8129
|
+
* **Note:** This method is loosely based on the
|
8130
|
+
* [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
|
7917
8131
|
* The enumerable properties of `arguments` objects and objects created by
|
7918
8132
|
* constructors other than `Object` are cloned to plain `Object` objects. An
|
7919
8133
|
* empty object is returned for uncloneable values such as functions, DOM nodes,
|
7920
|
-
* Maps, Sets, and WeakMaps.
|
7921
|
-
* for more details.
|
8134
|
+
* Maps, Sets, and WeakMaps.
|
7922
8135
|
*
|
7923
8136
|
* @static
|
7924
8137
|
* @memberOf _
|
@@ -7975,7 +8188,7 @@
|
|
7975
8188
|
*/
|
7976
8189
|
function isArguments(value) {
|
7977
8190
|
var length = isObjectLike(value) ? value.length : undefined;
|
7978
|
-
return
|
8191
|
+
return isLength(length) && objToString.call(value) == argsTag;
|
7979
8192
|
}
|
7980
8193
|
|
7981
8194
|
/**
|
@@ -7995,7 +8208,7 @@
|
|
7995
8208
|
* // => false
|
7996
8209
|
*/
|
7997
8210
|
var isArray = nativeIsArray || function(value) {
|
7998
|
-
return
|
8211
|
+
return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
|
7999
8212
|
};
|
8000
8213
|
|
8001
8214
|
/**
|
@@ -8015,7 +8228,7 @@
|
|
8015
8228
|
* // => false
|
8016
8229
|
*/
|
8017
8230
|
function isBoolean(value) {
|
8018
|
-
return
|
8231
|
+
return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
|
8019
8232
|
}
|
8020
8233
|
|
8021
8234
|
/**
|
@@ -8035,7 +8248,7 @@
|
|
8035
8248
|
* // => false
|
8036
8249
|
*/
|
8037
8250
|
function isDate(value) {
|
8038
|
-
return
|
8251
|
+
return isObjectLike(value) && objToString.call(value) == dateTag;
|
8039
8252
|
}
|
8040
8253
|
|
8041
8254
|
/**
|
@@ -8055,13 +8268,13 @@
|
|
8055
8268
|
* // => false
|
8056
8269
|
*/
|
8057
8270
|
function isElement(value) {
|
8058
|
-
return
|
8059
|
-
(objToString.call(value).indexOf('Element') > -1)
|
8271
|
+
return !!value && value.nodeType === 1 && isObjectLike(value) &&
|
8272
|
+
(objToString.call(value).indexOf('Element') > -1);
|
8060
8273
|
}
|
8061
8274
|
// Fallback for environments without DOM support.
|
8062
8275
|
if (!support.dom) {
|
8063
8276
|
isElement = function(value) {
|
8064
|
-
return
|
8277
|
+
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
|
8065
8278
|
};
|
8066
8279
|
}
|
8067
8280
|
|
@@ -8109,7 +8322,7 @@
|
|
8109
8322
|
* equivalent. If `customizer` is provided it is invoked to compare values.
|
8110
8323
|
* If `customizer` returns `undefined` comparisons are handled by the method
|
8111
8324
|
* instead. The `customizer` is bound to `thisArg` and invoked with three
|
8112
|
-
* arguments
|
8325
|
+
* arguments: (value, other [, index|key]).
|
8113
8326
|
*
|
8114
8327
|
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
|
8115
8328
|
* numbers, `Object` objects, regexes, and strings. Objects are compared by
|
@@ -8174,15 +8387,13 @@
|
|
8174
8387
|
* // => false
|
8175
8388
|
*/
|
8176
8389
|
function isError(value) {
|
8177
|
-
return
|
8390
|
+
return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
|
8178
8391
|
}
|
8179
8392
|
|
8180
8393
|
/**
|
8181
8394
|
* Checks if `value` is a finite primitive number.
|
8182
8395
|
*
|
8183
|
-
* **Note:** This method is based on
|
8184
|
-
* [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite)
|
8185
|
-
* for more details.
|
8396
|
+
* **Note:** This method is based on [`Number.isFinite`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).
|
8186
8397
|
*
|
8187
8398
|
* @static
|
8188
8399
|
* @memberOf _
|
@@ -8234,11 +8445,9 @@
|
|
8234
8445
|
};
|
8235
8446
|
|
8236
8447
|
/**
|
8237
|
-
* Checks if `value` is the language type of `Object`.
|
8448
|
+
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
8238
8449
|
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
8239
8450
|
*
|
8240
|
-
* **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details.
|
8241
|
-
*
|
8242
8451
|
* @static
|
8243
8452
|
* @memberOf _
|
8244
8453
|
* @category Lang
|
@@ -8259,7 +8468,7 @@
|
|
8259
8468
|
// Avoid a V8 JIT bug in Chrome 19-20.
|
8260
8469
|
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
8261
8470
|
var type = typeof value;
|
8262
|
-
return type == 'function' || (value && type == 'object')
|
8471
|
+
return type == 'function' || (!!value && type == 'object');
|
8263
8472
|
}
|
8264
8473
|
|
8265
8474
|
/**
|
@@ -8267,7 +8476,7 @@
|
|
8267
8476
|
* `object` contains equivalent property values. If `customizer` is provided
|
8268
8477
|
* it is invoked to compare values. If `customizer` returns `undefined`
|
8269
8478
|
* comparisons are handled by the method instead. The `customizer` is bound
|
8270
|
-
* to `thisArg` and invoked with three arguments
|
8479
|
+
* to `thisArg` and invoked with three arguments: (value, other, index|key).
|
8271
8480
|
*
|
8272
8481
|
* **Note:** This method supports comparing properties of arrays, booleans,
|
8273
8482
|
* `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
|
@@ -8305,13 +8514,19 @@
|
|
8305
8514
|
var props = keys(source),
|
8306
8515
|
length = props.length;
|
8307
8516
|
|
8517
|
+
if (!length) {
|
8518
|
+
return true;
|
8519
|
+
}
|
8520
|
+
if (object == null) {
|
8521
|
+
return false;
|
8522
|
+
}
|
8308
8523
|
customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3);
|
8309
8524
|
if (!customizer && length == 1) {
|
8310
8525
|
var key = props[0],
|
8311
8526
|
value = source[key];
|
8312
8527
|
|
8313
8528
|
if (isStrictComparable(value)) {
|
8314
|
-
return
|
8529
|
+
return value === object[key] && (typeof value != 'undefined' || (key in toObject(object)));
|
8315
8530
|
}
|
8316
8531
|
}
|
8317
8532
|
var values = Array(length),
|
@@ -8321,15 +8536,14 @@
|
|
8321
8536
|
value = values[length] = source[props[length]];
|
8322
8537
|
strictCompareFlags[length] = isStrictComparable(value);
|
8323
8538
|
}
|
8324
|
-
return baseIsMatch(object, props, values, strictCompareFlags, customizer);
|
8539
|
+
return baseIsMatch(toObject(object), props, values, strictCompareFlags, customizer);
|
8325
8540
|
}
|
8326
8541
|
|
8327
8542
|
/**
|
8328
8543
|
* Checks if `value` is `NaN`.
|
8329
8544
|
*
|
8330
|
-
* **Note:** This method is not the same as
|
8331
|
-
* for `undefined` and other non-numeric values.
|
8332
|
-
* for more details.
|
8545
|
+
* **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
|
8546
|
+
* which returns `true` for `undefined` and other non-numeric values.
|
8333
8547
|
*
|
8334
8548
|
* @static
|
8335
8549
|
* @memberOf _
|
@@ -8379,7 +8593,7 @@
|
|
8379
8593
|
if (objToString.call(value) == funcTag) {
|
8380
8594
|
return reNative.test(fnToString.call(value));
|
8381
8595
|
}
|
8382
|
-
return
|
8596
|
+
return isObjectLike(value) && reHostCtor.test(value);
|
8383
8597
|
}
|
8384
8598
|
|
8385
8599
|
/**
|
@@ -8425,7 +8639,7 @@
|
|
8425
8639
|
* // => false
|
8426
8640
|
*/
|
8427
8641
|
function isNumber(value) {
|
8428
|
-
return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag)
|
8642
|
+
return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
|
8429
8643
|
}
|
8430
8644
|
|
8431
8645
|
/**
|
@@ -8507,7 +8721,7 @@
|
|
8507
8721
|
* // => false
|
8508
8722
|
*/
|
8509
8723
|
function isString(value) {
|
8510
|
-
return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag)
|
8724
|
+
return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
|
8511
8725
|
}
|
8512
8726
|
|
8513
8727
|
/**
|
@@ -8527,7 +8741,7 @@
|
|
8527
8741
|
* // => false
|
8528
8742
|
*/
|
8529
8743
|
function isTypedArray(value) {
|
8530
|
-
return
|
8744
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
|
8531
8745
|
}
|
8532
8746
|
|
8533
8747
|
/**
|
@@ -8609,7 +8823,7 @@
|
|
8609
8823
|
* Assigns own enumerable properties of source object(s) to the destination
|
8610
8824
|
* object. Subsequent sources overwrite property assignments of previous sources.
|
8611
8825
|
* If `customizer` is provided it is invoked to produce the assigned values.
|
8612
|
-
* The `customizer` is bound to `thisArg` and invoked with five arguments
|
8826
|
+
* The `customizer` is bound to `thisArg` and invoked with five arguments:
|
8613
8827
|
* (objectValue, sourceValue, key, object, source).
|
8614
8828
|
*
|
8615
8829
|
* @static
|
@@ -8694,18 +8908,18 @@
|
|
8694
8908
|
* _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
|
8695
8909
|
* // => { 'user': 'barney', 'age': 36 }
|
8696
8910
|
*/
|
8697
|
-
|
8911
|
+
var defaults = restParam(function(args) {
|
8912
|
+
var object = args[0];
|
8698
8913
|
if (object == null) {
|
8699
8914
|
return object;
|
8700
8915
|
}
|
8701
|
-
var args = arrayCopy(arguments);
|
8702
8916
|
args.push(assignDefaults);
|
8703
8917
|
return assign.apply(undefined, args);
|
8704
|
-
}
|
8918
|
+
});
|
8705
8919
|
|
8706
8920
|
/**
|
8707
|
-
* This method is like `_.
|
8708
|
-
*
|
8921
|
+
* This method is like `_.find` except that it returns the key of the first
|
8922
|
+
* element `predicate` returns truthy for instead of the element itself.
|
8709
8923
|
*
|
8710
8924
|
* If a property name is provided for `predicate` the created `_.property`
|
8711
8925
|
* style callback returns the property value of the given element.
|
@@ -8751,10 +8965,7 @@
|
|
8751
8965
|
* _.findKey(users, 'active');
|
8752
8966
|
* // => 'barney'
|
8753
8967
|
*/
|
8754
|
-
|
8755
|
-
predicate = getCallback(predicate, thisArg, 3);
|
8756
|
-
return baseFind(object, predicate, baseForOwn, true);
|
8757
|
-
}
|
8968
|
+
var findKey = createFindKey(baseForOwn);
|
8758
8969
|
|
8759
8970
|
/**
|
8760
8971
|
* This method is like `_.findKey` except that it iterates over elements of
|
@@ -8804,15 +9015,12 @@
|
|
8804
9015
|
* _.findLastKey(users, 'active');
|
8805
9016
|
* // => 'pebbles'
|
8806
9017
|
*/
|
8807
|
-
|
8808
|
-
predicate = getCallback(predicate, thisArg, 3);
|
8809
|
-
return baseFind(object, predicate, baseForOwnRight, true);
|
8810
|
-
}
|
9018
|
+
var findLastKey = createFindKey(baseForOwnRight);
|
8811
9019
|
|
8812
9020
|
/**
|
8813
9021
|
* Iterates over own and inherited enumerable properties of an object invoking
|
8814
9022
|
* `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
|
8815
|
-
* with three arguments
|
9023
|
+
* with three arguments: (value, key, object). Iterator functions may exit
|
8816
9024
|
* iteration early by explicitly returning `false`.
|
8817
9025
|
*
|
8818
9026
|
* @static
|
@@ -8836,12 +9044,7 @@
|
|
8836
9044
|
* });
|
8837
9045
|
* // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
|
8838
9046
|
*/
|
8839
|
-
|
8840
|
-
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
|
8841
|
-
iteratee = bindCallback(iteratee, thisArg, 3);
|
8842
|
-
}
|
8843
|
-
return baseFor(object, iteratee, keysIn);
|
8844
|
-
}
|
9047
|
+
var forIn = createForIn(baseFor);
|
8845
9048
|
|
8846
9049
|
/**
|
8847
9050
|
* This method is like `_.forIn` except that it iterates over properties of
|
@@ -8868,15 +9071,12 @@
|
|
8868
9071
|
* });
|
8869
9072
|
* // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
|
8870
9073
|
*/
|
8871
|
-
|
8872
|
-
iteratee = bindCallback(iteratee, thisArg, 3);
|
8873
|
-
return baseForRight(object, iteratee, keysIn);
|
8874
|
-
}
|
9074
|
+
var forInRight = createForIn(baseForRight);
|
8875
9075
|
|
8876
9076
|
/**
|
8877
9077
|
* Iterates over own enumerable properties of an object invoking `iteratee`
|
8878
9078
|
* for each property. The `iteratee` is bound to `thisArg` and invoked with
|
8879
|
-
* three arguments
|
9079
|
+
* three arguments: (value, key, object). Iterator functions may exit iteration
|
8880
9080
|
* early by explicitly returning `false`.
|
8881
9081
|
*
|
8882
9082
|
* @static
|
@@ -8900,12 +9100,7 @@
|
|
8900
9100
|
* });
|
8901
9101
|
* // => logs 'a' and 'b' (iteration order is not guaranteed)
|
8902
9102
|
*/
|
8903
|
-
|
8904
|
-
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
|
8905
|
-
iteratee = bindCallback(iteratee, thisArg, 3);
|
8906
|
-
}
|
8907
|
-
return baseForOwn(object, iteratee);
|
8908
|
-
}
|
9103
|
+
var forOwn = createForOwn(baseForOwn);
|
8909
9104
|
|
8910
9105
|
/**
|
8911
9106
|
* This method is like `_.forOwn` except that it iterates over properties of
|
@@ -8932,10 +9127,7 @@
|
|
8932
9127
|
* });
|
8933
9128
|
* // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
|
8934
9129
|
*/
|
8935
|
-
|
8936
|
-
iteratee = bindCallback(iteratee, thisArg, 3);
|
8937
|
-
return baseForRight(object, iteratee, keys);
|
8938
|
-
}
|
9130
|
+
var forOwnRight = createForOwn(baseForOwnRight);
|
8939
9131
|
|
8940
9132
|
/**
|
8941
9133
|
* Creates an array of function property names from all enumerable properties,
|
@@ -9120,7 +9312,7 @@
|
|
9120
9312
|
/**
|
9121
9313
|
* Creates an object with the same keys as `object` and values generated by
|
9122
9314
|
* running each own enumerable property of `object` through `iteratee`. The
|
9123
|
-
* iteratee function is bound to `thisArg` and invoked with three arguments
|
9315
|
+
* iteratee function is bound to `thisArg` and invoked with three arguments:
|
9124
9316
|
* (value, key, object).
|
9125
9317
|
*
|
9126
9318
|
* If a property name is provided for `iteratee` the created `_.property`
|
@@ -9175,7 +9367,7 @@
|
|
9175
9367
|
* provided it is invoked to produce the merged values of the destination and
|
9176
9368
|
* source properties. If `customizer` returns `undefined` merging is handled
|
9177
9369
|
* by the method instead. The `customizer` is bound to `thisArg` and invoked
|
9178
|
-
* with five arguments
|
9370
|
+
* with five arguments: (objectValue, sourceValue, key, object, source).
|
9179
9371
|
*
|
9180
9372
|
* @static
|
9181
9373
|
* @memberOf _
|
@@ -9224,7 +9416,7 @@
|
|
9224
9416
|
* Property names may be specified as individual arguments or as arrays of
|
9225
9417
|
* property names. If `predicate` is provided it is invoked for each property
|
9226
9418
|
* of `object` omitting the properties `predicate` returns truthy for. The
|
9227
|
-
* predicate is bound to `thisArg` and invoked with three arguments
|
9419
|
+
* predicate is bound to `thisArg` and invoked with three arguments:
|
9228
9420
|
* (value, key, object).
|
9229
9421
|
*
|
9230
9422
|
* @static
|
@@ -9246,19 +9438,19 @@
|
|
9246
9438
|
* _.omit(object, _.isNumber);
|
9247
9439
|
* // => { 'user': 'fred' }
|
9248
9440
|
*/
|
9249
|
-
|
9441
|
+
var omit = restParam(function(object, props) {
|
9250
9442
|
if (object == null) {
|
9251
9443
|
return {};
|
9252
9444
|
}
|
9253
|
-
if (typeof
|
9254
|
-
var props = arrayMap(baseFlatten(
|
9445
|
+
if (typeof props[0] != 'function') {
|
9446
|
+
var props = arrayMap(baseFlatten(props), String);
|
9255
9447
|
return pickByArray(object, baseDifference(keysIn(object), props));
|
9256
9448
|
}
|
9257
|
-
predicate = bindCallback(
|
9449
|
+
var predicate = bindCallback(props[0], props[1], 3);
|
9258
9450
|
return pickByCallback(object, function(value, key, object) {
|
9259
9451
|
return !predicate(value, key, object);
|
9260
9452
|
});
|
9261
|
-
}
|
9453
|
+
});
|
9262
9454
|
|
9263
9455
|
/**
|
9264
9456
|
* Creates a two dimensional array of the key-value pairs for `object`,
|
@@ -9292,7 +9484,7 @@
|
|
9292
9484
|
* names may be specified as individual arguments or as arrays of property
|
9293
9485
|
* names. If `predicate` is provided it is invoked for each property of `object`
|
9294
9486
|
* picking the properties `predicate` returns truthy for. The predicate is
|
9295
|
-
* bound to `thisArg` and invoked with three arguments
|
9487
|
+
* bound to `thisArg` and invoked with three arguments: (value, key, object).
|
9296
9488
|
*
|
9297
9489
|
* @static
|
9298
9490
|
* @memberOf _
|
@@ -9313,14 +9505,14 @@
|
|
9313
9505
|
* _.pick(object, _.isString);
|
9314
9506
|
* // => { 'user': 'fred' }
|
9315
9507
|
*/
|
9316
|
-
|
9508
|
+
var pick = restParam(function(object, props) {
|
9317
9509
|
if (object == null) {
|
9318
9510
|
return {};
|
9319
9511
|
}
|
9320
|
-
return typeof
|
9321
|
-
? pickByCallback(object, bindCallback(
|
9322
|
-
: pickByArray(object, baseFlatten(
|
9323
|
-
}
|
9512
|
+
return typeof props[0] == 'function'
|
9513
|
+
? pickByCallback(object, bindCallback(props[0], props[1], 3))
|
9514
|
+
: pickByArray(object, baseFlatten(props));
|
9515
|
+
});
|
9324
9516
|
|
9325
9517
|
/**
|
9326
9518
|
* Resolves the value of property `key` on `object`. If the value of `key` is
|
@@ -9365,7 +9557,7 @@
|
|
9365
9557
|
* `accumulator` object which is the result of running each of its own enumerable
|
9366
9558
|
* properties through `iteratee`, with each invocation potentially mutating
|
9367
9559
|
* the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
|
9368
|
-
* with four arguments
|
9560
|
+
* with four arguments: (accumulator, value, key, object). Iterator functions
|
9369
9561
|
* may exit iteration early by explicitly returning `false`.
|
9370
9562
|
*
|
9371
9563
|
* @static
|
@@ -9576,8 +9768,7 @@
|
|
9576
9768
|
/*------------------------------------------------------------------------*/
|
9577
9769
|
|
9578
9770
|
/**
|
9579
|
-
* Converts `string` to camel case.
|
9580
|
-
* See [Wikipedia](https://en.wikipedia.org/wiki/CamelCase) for more details.
|
9771
|
+
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
|
9581
9772
|
*
|
9582
9773
|
* @static
|
9583
9774
|
* @memberOf _
|
@@ -9619,9 +9810,8 @@
|
|
9619
9810
|
}
|
9620
9811
|
|
9621
9812
|
/**
|
9622
|
-
* Deburrs `string` by converting latin-1 supplementary letters
|
9623
|
-
*
|
9624
|
-
* for more details.
|
9813
|
+
* Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
9814
|
+
* to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
9625
9815
|
*
|
9626
9816
|
* @static
|
9627
9817
|
* @memberOf _
|
@@ -9635,7 +9825,7 @@
|
|
9635
9825
|
*/
|
9636
9826
|
function deburr(string) {
|
9637
9827
|
string = baseToString(string);
|
9638
|
-
return string && string.replace(reLatin1, deburrLetter);
|
9828
|
+
return string && string.replace(reLatin1, deburrLetter).replace(reComboMarks, '');
|
9639
9829
|
}
|
9640
9830
|
|
9641
9831
|
/**
|
@@ -9690,9 +9880,8 @@
|
|
9690
9880
|
* [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133) of
|
9691
9881
|
* the [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
|
9692
9882
|
*
|
9693
|
-
* When working with HTML you should always quote attribute values
|
9694
|
-
* XSS vectors.
|
9695
|
-
* for more details.
|
9883
|
+
* When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
|
9884
|
+
* to reduce XSS vectors.
|
9696
9885
|
*
|
9697
9886
|
* @static
|
9698
9887
|
* @memberOf _
|
@@ -9713,8 +9902,8 @@
|
|
9713
9902
|
}
|
9714
9903
|
|
9715
9904
|
/**
|
9716
|
-
* Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?",
|
9717
|
-
* "+", "(", ")", "[", "]", "{" and "}" in `string`.
|
9905
|
+
* Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
|
9906
|
+
* "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
|
9718
9907
|
*
|
9719
9908
|
* @static
|
9720
9909
|
* @memberOf _
|
@@ -9724,7 +9913,7 @@
|
|
9724
9913
|
* @example
|
9725
9914
|
*
|
9726
9915
|
* _.escapeRegExp('[lodash](https://lodash.com/)');
|
9727
|
-
* // => '\[lodash\]\(https
|
9916
|
+
* // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
|
9728
9917
|
*/
|
9729
9918
|
function escapeRegExp(string) {
|
9730
9919
|
string = baseToString(string);
|
@@ -9734,9 +9923,7 @@
|
|
9734
9923
|
}
|
9735
9924
|
|
9736
9925
|
/**
|
9737
|
-
* Converts `string` to kebab case.
|
9738
|
-
* See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) for
|
9739
|
-
* more details.
|
9926
|
+
* Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
|
9740
9927
|
*
|
9741
9928
|
* @static
|
9742
9929
|
* @memberOf _
|
@@ -9759,9 +9946,8 @@
|
|
9759
9946
|
});
|
9760
9947
|
|
9761
9948
|
/**
|
9762
|
-
* Pads `string` on the left and right sides if it is shorter
|
9763
|
-
*
|
9764
|
-
* characters can't be evenly divided by the padding length.
|
9949
|
+
* Pads `string` on the left and right sides if it is shorter than `length`.
|
9950
|
+
* Padding characters are truncated if they can't be evenly divided by `length`.
|
9765
9951
|
*
|
9766
9952
|
* @static
|
9767
9953
|
* @memberOf _
|
@@ -9793,14 +9979,13 @@
|
|
9793
9979
|
leftLength = floor(mid),
|
9794
9980
|
rightLength = ceil(mid);
|
9795
9981
|
|
9796
|
-
chars =
|
9982
|
+
chars = createPadding('', rightLength, chars);
|
9797
9983
|
return chars.slice(0, leftLength) + string + chars;
|
9798
9984
|
}
|
9799
9985
|
|
9800
9986
|
/**
|
9801
|
-
* Pads `string` on the left side if it is shorter
|
9802
|
-
*
|
9803
|
-
* characters exceeds the padding length.
|
9987
|
+
* Pads `string` on the left side if it is shorter than `length`. Padding
|
9988
|
+
* characters are truncated if they exceed `length`.
|
9804
9989
|
*
|
9805
9990
|
* @static
|
9806
9991
|
* @memberOf _
|
@@ -9820,15 +10005,11 @@
|
|
9820
10005
|
* _.padLeft('abc', 3);
|
9821
10006
|
* // => 'abc'
|
9822
10007
|
*/
|
9823
|
-
|
9824
|
-
string = baseToString(string);
|
9825
|
-
return string && (createPad(string, length, chars) + string);
|
9826
|
-
}
|
10008
|
+
var padLeft = createPadDir();
|
9827
10009
|
|
9828
10010
|
/**
|
9829
|
-
* Pads `string` on the right side if it is shorter
|
9830
|
-
*
|
9831
|
-
* characters exceeds the padding length.
|
10011
|
+
* Pads `string` on the right side if it is shorter than `length`. Padding
|
10012
|
+
* characters are truncated if they exceed `length`.
|
9832
10013
|
*
|
9833
10014
|
* @static
|
9834
10015
|
* @memberOf _
|
@@ -9848,18 +10029,15 @@
|
|
9848
10029
|
* _.padRight('abc', 3);
|
9849
10030
|
* // => 'abc'
|
9850
10031
|
*/
|
9851
|
-
|
9852
|
-
string = baseToString(string);
|
9853
|
-
return string && (string + createPad(string, length, chars));
|
9854
|
-
}
|
10032
|
+
var padRight = createPadDir(true);
|
9855
10033
|
|
9856
10034
|
/**
|
9857
10035
|
* Converts `string` to an integer of the specified radix. If `radix` is
|
9858
10036
|
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
|
9859
10037
|
* in which case a `radix` of `16` is used.
|
9860
10038
|
*
|
9861
|
-
* **Note:** This method aligns with the ES5 implementation
|
9862
|
-
*
|
10039
|
+
* **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
|
10040
|
+
* of `parseInt`.
|
9863
10041
|
*
|
9864
10042
|
* @static
|
9865
10043
|
* @memberOf _
|
@@ -9939,8 +10117,7 @@
|
|
9939
10117
|
}
|
9940
10118
|
|
9941
10119
|
/**
|
9942
|
-
* Converts `string` to snake case.
|
9943
|
-
* See [Wikipedia](https://en.wikipedia.org/wiki/Snake_case) for more details.
|
10120
|
+
* Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
|
9944
10121
|
*
|
9945
10122
|
* @static
|
9946
10123
|
* @memberOf _
|
@@ -9963,9 +10140,7 @@
|
|
9963
10140
|
});
|
9964
10141
|
|
9965
10142
|
/**
|
9966
|
-
* Converts `string` to start case.
|
9967
|
-
* See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage)
|
9968
|
-
* for more details.
|
10143
|
+
* Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
|
9969
10144
|
*
|
9970
10145
|
* @static
|
9971
10146
|
* @memberOf _
|
@@ -10024,9 +10199,9 @@
|
|
10024
10199
|
* properties may be accessed as free variables in the template. If a setting
|
10025
10200
|
* object is provided it takes precedence over `_.templateSettings` values.
|
10026
10201
|
*
|
10027
|
-
* **Note:** In the development build `_.template` utilizes
|
10028
|
-
*
|
10029
|
-
* for
|
10202
|
+
* **Note:** In the development build `_.template` utilizes
|
10203
|
+
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
10204
|
+
* for easier debugging.
|
10030
10205
|
*
|
10031
10206
|
* For more information on precompiling templates see
|
10032
10207
|
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
|
@@ -10238,7 +10413,7 @@
|
|
10238
10413
|
* // => 'abc'
|
10239
10414
|
*
|
10240
10415
|
* _.map([' foo ', ' bar '], _.trim);
|
10241
|
-
* // => ['foo', 'bar]
|
10416
|
+
* // => ['foo', 'bar']
|
10242
10417
|
*/
|
10243
10418
|
function trim(string, chars, guard) {
|
10244
10419
|
var value = string;
|
@@ -10346,7 +10521,7 @@
|
|
10346
10521
|
* 'length': 24,
|
10347
10522
|
* 'separator': /,? +/
|
10348
10523
|
* });
|
10349
|
-
*
|
10524
|
+
* // => 'hi-diddly-ho there...'
|
10350
10525
|
*
|
10351
10526
|
* _.trunc('hi-diddly-ho there, neighborino', {
|
10352
10527
|
* 'omission': ' [...]'
|
@@ -10465,7 +10640,7 @@
|
|
10465
10640
|
* @static
|
10466
10641
|
* @memberOf _
|
10467
10642
|
* @category Utility
|
10468
|
-
* @param {
|
10643
|
+
* @param {Function} func The function to attempt.
|
10469
10644
|
* @returns {*} Returns the `func` result or error object.
|
10470
10645
|
* @example
|
10471
10646
|
*
|
@@ -10478,20 +10653,13 @@
|
|
10478
10653
|
* elements = [];
|
10479
10654
|
* }
|
10480
10655
|
*/
|
10481
|
-
|
10482
|
-
var func = arguments[0],
|
10483
|
-
length = arguments.length,
|
10484
|
-
args = Array(length ? (length - 1) : 0);
|
10485
|
-
|
10486
|
-
while (--length > 0) {
|
10487
|
-
args[length - 1] = arguments[length];
|
10488
|
-
}
|
10656
|
+
var attempt = restParam(function(func, args) {
|
10489
10657
|
try {
|
10490
10658
|
return func.apply(undefined, args);
|
10491
10659
|
} catch(e) {
|
10492
10660
|
return isError(e) ? e : new Error(e);
|
10493
10661
|
}
|
10494
|
-
}
|
10662
|
+
});
|
10495
10663
|
|
10496
10664
|
/**
|
10497
10665
|
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
@@ -10628,12 +10796,11 @@
|
|
10628
10796
|
*
|
10629
10797
|
* var users = [
|
10630
10798
|
* { 'user': 'barney' },
|
10631
|
-
* { 'user': 'fred' }
|
10632
|
-
* { 'user': 'pebbles' }
|
10799
|
+
* { 'user': 'fred' }
|
10633
10800
|
* ];
|
10634
10801
|
*
|
10635
10802
|
* _.find(users, _.matchesProperty('user', 'fred'));
|
10636
|
-
* // => { 'user': 'fred'
|
10803
|
+
* // => { 'user': 'fred' }
|
10637
10804
|
*/
|
10638
10805
|
function matchesProperty(key, value) {
|
10639
10806
|
return baseMatchesProperty(key + '', baseClone(value, true));
|
@@ -10644,6 +10811,9 @@
|
|
10644
10811
|
* destination object. If `object` is a function then methods are added to
|
10645
10812
|
* its prototype as well.
|
10646
10813
|
*
|
10814
|
+
* **Note:** Use `_.runInContext` to create a pristine `lodash` function
|
10815
|
+
* for mixins to avoid conflicts caused by modifying the original.
|
10816
|
+
*
|
10647
10817
|
* @static
|
10648
10818
|
* @memberOf _
|
10649
10819
|
* @category Utility
|
@@ -10661,7 +10831,7 @@
|
|
10661
10831
|
* });
|
10662
10832
|
* }
|
10663
10833
|
*
|
10664
|
-
* // use `_.runInContext` to avoid
|
10834
|
+
* // use `_.runInContext` to avoid conflicts (esp. in Node.js)
|
10665
10835
|
* var _ = require('lodash').runInContext();
|
10666
10836
|
*
|
10667
10837
|
* _.mixin({ 'vowels': vowels });
|
@@ -10711,12 +10881,10 @@
|
|
10711
10881
|
return function() {
|
10712
10882
|
var chainAll = this.__chain__;
|
10713
10883
|
if (chain || chainAll) {
|
10714
|
-
var result = object(this.__wrapped__)
|
10715
|
-
|
10716
|
-
|
10717
|
-
|
10718
|
-
'thisArg': object
|
10719
|
-
});
|
10884
|
+
var result = object(this.__wrapped__),
|
10885
|
+
actions = result.__actions__ = arrayCopy(this.__actions__);
|
10886
|
+
|
10887
|
+
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
|
10720
10888
|
result.__chain__ = chainAll;
|
10721
10889
|
return result;
|
10722
10890
|
}
|
@@ -10783,7 +10951,7 @@
|
|
10783
10951
|
* var getName = _.property('user');
|
10784
10952
|
*
|
10785
10953
|
* _.map(users, getName);
|
10786
|
-
* // => ['fred', barney']
|
10954
|
+
* // => ['fred', 'barney']
|
10787
10955
|
*
|
10788
10956
|
* _.pluck(_.sortBy(users, getName), 'user');
|
10789
10957
|
* // => ['barney', 'fred']
|
@@ -10793,7 +10961,7 @@
|
|
10793
10961
|
}
|
10794
10962
|
|
10795
10963
|
/**
|
10796
|
-
* The
|
10964
|
+
* The opposite of `_.property`; this method creates a function which returns
|
10797
10965
|
* the property value of a given key on `object`.
|
10798
10966
|
*
|
10799
10967
|
* @static
|
@@ -10971,16 +11139,16 @@
|
|
10971
11139
|
* `-Infinity` is returned. If an iteratee function is provided it is invoked
|
10972
11140
|
* for each value in `collection` to generate the criterion by which the value
|
10973
11141
|
* is ranked. The `iteratee` is bound to `thisArg` and invoked with three
|
10974
|
-
* arguments
|
11142
|
+
* arguments: (value, index, collection).
|
10975
11143
|
*
|
10976
|
-
* If a property name is provided for `
|
11144
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
10977
11145
|
* style callback returns the property value of the given element.
|
10978
11146
|
*
|
10979
11147
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
10980
11148
|
* style callback returns `true` for elements that have a matching property
|
10981
11149
|
* value, else `false`.
|
10982
11150
|
*
|
10983
|
-
* If an object is provided for `
|
11151
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
10984
11152
|
* callback returns `true` for elements that have the properties of the given
|
10985
11153
|
* object, else `false`.
|
10986
11154
|
*
|
@@ -11007,11 +11175,11 @@
|
|
11007
11175
|
* _.max(users, function(chr) {
|
11008
11176
|
* return chr.age;
|
11009
11177
|
* });
|
11010
|
-
* // => { 'user': 'fred', 'age': 40 }
|
11178
|
+
* // => { 'user': 'fred', 'age': 40 }
|
11011
11179
|
*
|
11012
11180
|
* // using the `_.property` callback shorthand
|
11013
11181
|
* _.max(users, 'age');
|
11014
|
-
* // => { 'user': 'fred', 'age': 40 }
|
11182
|
+
* // => { 'user': 'fred', 'age': 40 }
|
11015
11183
|
*/
|
11016
11184
|
var max = createExtremum(arrayMax);
|
11017
11185
|
|
@@ -11020,16 +11188,16 @@
|
|
11020
11188
|
* `Infinity` is returned. If an iteratee function is provided it is invoked
|
11021
11189
|
* for each value in `collection` to generate the criterion by which the value
|
11022
11190
|
* is ranked. The `iteratee` is bound to `thisArg` and invoked with three
|
11023
|
-
* arguments
|
11191
|
+
* arguments: (value, index, collection).
|
11024
11192
|
*
|
11025
|
-
* If a property name is provided for `
|
11193
|
+
* If a property name is provided for `iteratee` the created `_.property`
|
11026
11194
|
* style callback returns the property value of the given element.
|
11027
11195
|
*
|
11028
11196
|
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
11029
11197
|
* style callback returns `true` for elements that have a matching property
|
11030
11198
|
* value, else `false`.
|
11031
11199
|
*
|
11032
|
-
* If an object is provided for `
|
11200
|
+
* If an object is provided for `iteratee` the created `_.matches` style
|
11033
11201
|
* callback returns `true` for elements that have the properties of the given
|
11034
11202
|
* object, else `false`.
|
11035
11203
|
*
|
@@ -11056,11 +11224,11 @@
|
|
11056
11224
|
* _.min(users, function(chr) {
|
11057
11225
|
* return chr.age;
|
11058
11226
|
* });
|
11059
|
-
* // => { 'user': 'barney', 'age': 36 }
|
11227
|
+
* // => { 'user': 'barney', 'age': 36 }
|
11060
11228
|
*
|
11061
11229
|
* // using the `_.property` callback shorthand
|
11062
11230
|
* _.min(users, 'age');
|
11063
|
-
* // => { 'user': 'barney', 'age': 36 }
|
11231
|
+
* // => { 'user': 'barney', 'age': 36 }
|
11064
11232
|
*/
|
11065
11233
|
var min = createExtremum(arrayMin, true);
|
11066
11234
|
|
@@ -11071,26 +11239,45 @@
|
|
11071
11239
|
* @memberOf _
|
11072
11240
|
* @category Math
|
11073
11241
|
* @param {Array|Object|string} collection The collection to iterate over.
|
11242
|
+
* @param {Function|Object|string} [iteratee] The function invoked per iteration.
|
11243
|
+
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
11074
11244
|
* @returns {number} Returns the sum.
|
11075
11245
|
* @example
|
11076
11246
|
*
|
11077
|
-
* _.sum([4, 6
|
11078
|
-
* // =>
|
11247
|
+
* _.sum([4, 6]);
|
11248
|
+
* // => 10
|
11249
|
+
*
|
11250
|
+
* _.sum({ 'a': 4, 'b': 6 });
|
11251
|
+
* // => 10
|
11252
|
+
*
|
11253
|
+
* var objects = [
|
11254
|
+
* { 'n': 4 },
|
11255
|
+
* { 'n': 6 }
|
11256
|
+
* ];
|
11257
|
+
*
|
11258
|
+
* _.sum(objects, function(object) {
|
11259
|
+
* return object.n;
|
11260
|
+
* });
|
11261
|
+
* // => 10
|
11079
11262
|
*
|
11080
|
-
*
|
11081
|
-
*
|
11263
|
+
* // using the `_.property` callback shorthand
|
11264
|
+
* _.sum(objects, 'n');
|
11265
|
+
* // => 10
|
11082
11266
|
*/
|
11083
|
-
function sum(collection) {
|
11084
|
-
if (
|
11085
|
-
|
11267
|
+
function sum(collection, iteratee, thisArg) {
|
11268
|
+
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
|
11269
|
+
iteratee = null;
|
11086
11270
|
}
|
11087
|
-
var
|
11088
|
-
|
11271
|
+
var func = getCallback(),
|
11272
|
+
noIteratee = iteratee == null;
|
11089
11273
|
|
11090
|
-
|
11091
|
-
|
11274
|
+
if (!(func === baseCallback && noIteratee)) {
|
11275
|
+
noIteratee = false;
|
11276
|
+
iteratee = func(iteratee, thisArg, 3);
|
11092
11277
|
}
|
11093
|
-
return
|
11278
|
+
return noIteratee
|
11279
|
+
? arraySum(isArray(collection) ? collection : toIterable(collection))
|
11280
|
+
: baseSum(collection, iteratee);
|
11094
11281
|
}
|
11095
11282
|
|
11096
11283
|
/*------------------------------------------------------------------------*/
|
@@ -11189,6 +11376,7 @@
|
|
11189
11376
|
lodash.reject = reject;
|
11190
11377
|
lodash.remove = remove;
|
11191
11378
|
lodash.rest = rest;
|
11379
|
+
lodash.restParam = restParam;
|
11192
11380
|
lodash.shuffle = shuffle;
|
11193
11381
|
lodash.slice = slice;
|
11194
11382
|
lodash.sortBy = sortBy;
|
@@ -11480,8 +11668,11 @@
|
|
11480
11668
|
|
11481
11669
|
// Add `LazyWrapper` methods to `lodash.prototype`.
|
11482
11670
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
11483
|
-
var lodashFunc = lodash[methodName]
|
11484
|
-
|
11671
|
+
var lodashFunc = lodash[methodName];
|
11672
|
+
if (!lodashFunc) {
|
11673
|
+
return;
|
11674
|
+
}
|
11675
|
+
var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
|
11485
11676
|
retUnwrapped = /^(?:first|last)$/.test(methodName);
|
11486
11677
|
|
11487
11678
|
lodash.prototype[methodName] = function() {
|
@@ -11540,6 +11731,19 @@
|
|
11540
11731
|
};
|
11541
11732
|
});
|
11542
11733
|
|
11734
|
+
// Map minified function names to their real names.
|
11735
|
+
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
11736
|
+
var lodashFunc = lodash[methodName];
|
11737
|
+
if (lodashFunc) {
|
11738
|
+
var key = lodashFunc.name,
|
11739
|
+
names = realNames[key] || (realNames[key] = []);
|
11740
|
+
|
11741
|
+
names.push({ 'name': methodName, 'func': lodashFunc });
|
11742
|
+
}
|
11743
|
+
});
|
11744
|
+
|
11745
|
+
realNames[createHybridWrapper(null, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': null }];
|
11746
|
+
|
11543
11747
|
// Add functions to the lazy wrapper.
|
11544
11748
|
LazyWrapper.prototype.clone = lazyClone;
|
11545
11749
|
LazyWrapper.prototype.reverse = lazyReverse;
|