lodash-rails 4.17.5 → 4.17.21
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 +5 -5
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.core.js +141 -118
- data/vendor/assets/javascripts/lodash.core.min.js +20 -20
- data/vendor/assets/javascripts/lodash.js +813 -701
- data/vendor/assets/javascripts/lodash.min.js +137 -134
- metadata +6 -7
@@ -4,26 +4,26 @@
|
|
4
4
|
* Build: `lodash core -o ./dist/lodash.core.js`
|
5
5
|
*/
|
6
6
|
;(function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");
|
7
|
-
return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===Z?i===i:r(i,c)))var c=i,f=o}return f}function l(n,t){var r=[];return mn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function p(n,r,e,u,o){var i=-1,c=n.length;for(e||(e=R),o||(o=[]);++i<c;){var f=n[i];0<r&&e(f)?1<r?p(f,r-1,e,u,o):t(o,f):u||(o[o.length]=f)}return o}function s(n,t){return n&&On(n,t,Dn);
|
7
|
+
return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===Z?i===i:r(i,c)))var c=i,f=o}return f}function l(n,t){var r=[];return mn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function p(n,r,e,u,o){var i=-1,c=n.length;for(e||(e=R),o||(o=[]);++i<c;){var f=n[i];0<r&&e(f)?1<r?p(f,r-1,e,u,o):t(o,f):u||(o[o.length]=f)}return o}function s(n,t){return n&&On(n,t,Dn);
|
8
8
|
}function h(n,t){return l(t,function(t){return U(n[t])})}function v(n,t){return n>t}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!==n&&t!==t:y(n,t,r,e,b,u))}function y(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){
|
9
|
-
return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t,
|
10
|
-
r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return n<t}function j(n,t){var r=-1,e=M(n)?Array(n.length):[];return mn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function d(n){var t=_n(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&b(n[u],r[u],3)))return false}return true}}function m(n,t){return n=Object(n),C(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function O(n){return xn(I(n,void 0,X),n+"");
|
9
|
+
return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t,
|
10
|
+
r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return n<t}function j(n,t){var r=-1,e=M(n)?Array(n.length):[];return mn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function d(n){var t=_n(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&b(n[u],r[u],3)))return false}return true}}function m(n,t){return n=Object(n),C(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function O(n){return xn(I(n,void 0,X),n+"");
|
11
11
|
}function x(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function A(n){return x(n,0,n.length)}function E(n,t){var r;return mn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function w(n,r){return C(r,function(n,r){return r.func.apply(r.thisArg,t([n],r.args))},n)}function k(n,t,r){var e=!r;r||(r={});for(var u=-1,o=t.length;++u<o;){var i=t[u],c=Z;if(c===Z&&(c=n[i]),e)r[i]=c;else{var f=r,a=f[i];pn.call(f,i)&&J(a,c)&&(c!==Z||i in f)||(f[i]=c);
|
12
12
|
}}return r}function N(n){return O(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:Z,o=3<n.length&&typeof o=="function"?(u--,o):Z;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function F(n){return function(){var t=arguments,r=dn(n.prototype),t=n.apply(r,t);return V(t)?t:r}}function S(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==on&&this instanceof e?u:n;++c<f;)a[c]=r[c];for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");
|
13
|
-
var u=F(n);return e}function T(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return false;for(var c=-1,f=true,a=2&r?[]:Z;++c<i;){var l=n[c],p=t[c];if(void 0!==Z){f=false;break}if(a){if(!E(t,function(n,t){if(!P(a,t)&&(l===n||u(l,n,r,e,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!u(l,p,r,e,o)){f=false;break}}return f}function B(n,t,r,e,u,o){var i=1&r,c=Dn(n),f=c.length,a=Dn(t).length;if(f!=a&&!i)return false;for(
|
14
|
-
if(void 0!==Z||s!==h&&!u(s,h,r,e,o)){
|
15
|
-
o=Array(t+1);++u<t;)o[u]=e[u];return o[t]=r(i),n.apply(this,o)}}function $(n){return(null==n?0:n.length)?p(n,1):[]}function q(n){return n&&n.length?n[0]:Z}function P(n,t,r){var e=null==n?0:n.length;r=typeof r=="number"?0>r?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function z(n,t){return mn(n,g(t))}function C(n,t,r){return e(n,g(t),r,3>arguments.length,mn)
|
16
|
-
function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;
|
17
|
-
return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);
|
18
|
-
if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){
|
19
|
-
return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;
|
20
|
-
var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(s),On=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}(),xn=X,An=function(n){return function(t,r,e){var u=Object(t);if(!M(t)){var o=g(r);t=Dn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:Z}}(function(n,t,r){var e=null==n?0:n.length;
|
21
|
-
if(!e)return-1;r=null==r?0:Fn(r),0>r&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),En=O(function(n,t,r){return S(n,t,r)}),wn=O(function(n,t){return c(n,1,t)}),kn=O(function(n,t,r){return c(n,Sn(t)||0,r)}),Nn=Array.isArray,Fn=Number,Sn=Number,Tn=N(function(n,t){k(t,_n(t),n)}),Bn=N(function(n,t){k(t,D(t),n)}),Rn=O(function(n,t){n=Object(n);var r,e=-1,u=t.length,o=2<u?t[2]:Z;if(r=o){r=t[0];var i=t[1];if(V(o)){var c=typeof i;if("number"==c){if(c=M(o))var c=o.length,f=typeof i,c=null==c?9007199254740991:c,c=!!c&&("number"==f||"symbol"!=f&&en.test(i))&&-1<i&&0==i%1&&i<c;
|
22
|
-
}else c="string"==c&&i in o;r=!!c&&J(o[i],r)}else r=false}for(r&&(u=1);++e<u;)for(o=t[e],r=In(o),i=-1,c=r.length;++i<c;){var f=r[i],a=n[f];(a===Z||J(a,ln[f])&&!pn.call(n,f))&&(n[f]=o[f])}return n}),Dn=_n,In=D,$n=function(n){return xn(I(n,Z,$),n+"")}(function(n,t){return null==n?{}:m(n,t)});o.assignIn=Bn,o.before=G,o.bind=En,o.chain=function(n){return n=o(n),n.__chain__=true,n},o.compact=function(n){return l(n,Boolean)},o.concat=function(){var n=arguments.length;if(!n)return[];for(var r=Array(n-1),e=arguments[0];n--;)r[n-1]=arguments[n];
|
23
|
-
return t(Nn(e)?A(e):[e],p(r,1))},o.create=function(n,t){var r=dn(n);return null==t?r:Tn(r,t)},o.defaults=Rn,o.defer=wn,o.delay=kn,o.filter=function(n,t){return l(n,g(t))},o.flatten=$,o.flattenDeep=function(n){return(null==n?0:n.length)?p(n,nn):[]},o.iteratee=g,o.keys=Dn,o.map=function(n,t){return j(n,g(t))},o.matches=function(n){return d(Tn({},n))},o.mixin=Y,o.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},o.once=function(n){
|
24
|
-
return G(2,n)},o.pick=$n,o.slice=function(n,t,r){var e=null==n?0:n.length;return r=r===Z?e:+r,e?x(n,null==t?0:+t,r):[]},o.sortBy=function(n,t){var e=0;return t=g(t),j(j(n,function(n,r,u){return{value:n,index:e++,criteria:t(n,r,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==Z,o=null===r,i=r===r,c=e!==Z,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),r("value"))},o.tap=function(n,t){
|
25
|
-
return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return M(n)?n.length?A(n):[]:W(n)},o.values=W,o.extend=Bn,Y(o,o),o.clone=function(n){return V(n)?Nn(n)?A(n):k(n,_n(n)):n},o.escape=function(n){return(n=Q(n))&&rn.test(n)?n.replace(tn,fn):n},o.every=function(n,t,r){return t=r?Z:t,f(n,g(t))},o.find=An,o.forEach=z,o.has=function(n,t){return null!=n&&pn.call(n,t)},o.head=q,o.identity=X,o.indexOf=P,o.isArguments=n,o.isArray=Nn,o.isBoolean=function(n){return true===n||false===n||H(n)&&"[object Boolean]"==hn.call(n);
|
26
|
-
},o.isDate=function(n){return H(n)&&"[object Date]"==hn.call(n)},o.isEmpty=function(t){return M(t)&&(Nn(t)||L(t)||U(t.splice)||n(t))?!t.length:!_n(t).length},o.isEqual=function(n,t){return b(n,t)},o.isFinite=function(n){return typeof n=="number"&&gn(n)},o.isFunction=U,o.isNaN=function(n){return K(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=K,o.isObject=V,o.isRegExp=function(n){return H(n)&&"[object RegExp]"==hn.call(n)},o.isString=L,o.isUndefined=function(n){return n===Z},o.last=function(n){
|
27
|
-
var t=null==n?0:n.length;return t?n[t-1]:Z},o.max=function(n){return n&&n.length?a(n,X,v):Z},o.min=function(n){return n&&n.length?a(n,X,_):Z},o.noConflict=function(){return on._===this&&(on._=vn),this},o.noop=function(){},o.reduce=C,o.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=M(n)?n:_n(n),n.length)},o.some=function(n,t,r){return t=r?Z:t,E(n,g(t))},o.uniqueId=function(n){var t=++sn;return Q(n)+t},o.each=z,o.first=q,Y(o,function(){
|
28
|
-
var n={};return s(o,function(t,r){pn.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.17.
|
29
|
-
})}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return w(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o, define(function(){return o})):cn?((cn.exports=o)._=o,un._=o):on._=o}).call(this);
|
13
|
+
var u=F(n);return e}function T(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return false;var c=o.get(n),f=o.get(t);if(c&&f)return c==t&&f==n;for(var c=-1,f=true,a=2&r?[]:Z;++c<i;){var l=n[c],p=t[c];if(void 0!==Z){f=false;break}if(a){if(!E(t,function(n,t){if(!P(a,t)&&(l===n||u(l,n,r,e,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!u(l,p,r,e,o)){f=false;break}}return f}function B(n,t,r,e,u,o){var i=1&r,c=Dn(n),f=c.length,a=Dn(t).length;if(f!=a&&!i)return false;for(a=f;a--;){var l=c[a];if(!(i?l in t:pn.call(t,l)))return false;
|
14
|
+
}var p=o.get(n),l=o.get(t);if(p&&l)return p==t&&l==n;for(p=true;++a<f;){var l=c[a],s=n[l],h=t[l];if(void 0!==Z||s!==h&&!u(s,h,r,e,o)){p=false;break}i||(i="constructor"==l)}return p&&!i&&(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)&&(p=false)),p}function R(t){return Nn(t)||n(t)}function D(n){var t=[];if(null!=n)for(var r in Object(n))t.push(r);return t}function I(n,t,r){return t=jn(t===Z?n.length-1:t,0),
|
15
|
+
function(){for(var e=arguments,u=-1,o=jn(e.length-t,0),i=Array(o);++u<o;)i[u]=e[t+u];for(u=-1,o=Array(t+1);++u<t;)o[u]=e[u];return o[t]=r(i),n.apply(this,o)}}function $(n){return(null==n?0:n.length)?p(n,1):[]}function q(n){return n&&n.length?n[0]:Z}function P(n,t,r){var e=null==n?0:n.length;r=typeof r=="number"?0>r?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function z(n,t){return mn(n,g(t))}function C(n,t,r){return e(n,g(t),r,3>arguments.length,mn);
|
16
|
+
}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;
|
17
|
+
return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);
|
18
|
+
return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){
|
19
|
+
return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;
|
20
|
+
var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(s),On=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}(),xn=X,An=function(n){return function(t,r,e){var u=Object(t);if(!M(t)){var o=g(r);t=Dn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:Z}}(function(n,t,r){var e=null==n?0:n.length;
|
21
|
+
if(!e)return-1;r=null==r?0:Fn(r),0>r&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),En=O(function(n,t,r){return S(n,t,r)}),wn=O(function(n,t){return c(n,1,t)}),kn=O(function(n,t,r){return c(n,Sn(t)||0,r)}),Nn=Array.isArray,Fn=Number,Sn=Number,Tn=N(function(n,t){k(t,_n(t),n)}),Bn=N(function(n,t){k(t,D(t),n)}),Rn=O(function(n,t){n=Object(n);var r,e=-1,u=t.length,o=2<u?t[2]:Z;if(r=o){r=t[0];var i=t[1];if(V(o)){var c=typeof i;if("number"==c){if(c=M(o))var c=o.length,f=typeof i,c=null==c?9007199254740991:c,c=!!c&&("number"==f||"symbol"!=f&&en.test(i))&&-1<i&&0==i%1&&i<c;
|
22
|
+
}else c="string"==c&&i in o;r=!!c&&J(o[i],r)}else r=false}for(r&&(u=1);++e<u;)for(o=t[e],r=In(o),i=-1,c=r.length;++i<c;){var f=r[i],a=n[f];(a===Z||J(a,ln[f])&&!pn.call(n,f))&&(n[f]=o[f])}return n}),Dn=_n,In=D,$n=function(n){return xn(I(n,Z,$),n+"")}(function(n,t){return null==n?{}:m(n,t)});o.assignIn=Bn,o.before=G,o.bind=En,o.chain=function(n){return n=o(n),n.__chain__=true,n},o.compact=function(n){return l(n,Boolean)},o.concat=function(){var n=arguments.length;if(!n)return[];for(var r=Array(n-1),e=arguments[0];n--;)r[n-1]=arguments[n];
|
23
|
+
return t(Nn(e)?A(e):[e],p(r,1))},o.create=function(n,t){var r=dn(n);return null==t?r:Tn(r,t)},o.defaults=Rn,o.defer=wn,o.delay=kn,o.filter=function(n,t){return l(n,g(t))},o.flatten=$,o.flattenDeep=function(n){return(null==n?0:n.length)?p(n,nn):[]},o.iteratee=g,o.keys=Dn,o.map=function(n,t){return j(n,g(t))},o.matches=function(n){return d(Tn({},n))},o.mixin=Y,o.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},o.once=function(n){
|
24
|
+
return G(2,n)},o.pick=$n,o.slice=function(n,t,r){var e=null==n?0:n.length;return r=r===Z?e:+r,e?x(n,null==t?0:+t,r):[]},o.sortBy=function(n,t){var e=0;return t=g(t),j(j(n,function(n,r,u){return{value:n,index:e++,criteria:t(n,r,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==Z,o=null===r,i=r===r,c=e!==Z,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),r("value"))},o.tap=function(n,t){
|
25
|
+
return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return M(n)?n.length?A(n):[]:W(n)},o.values=W,o.extend=Bn,Y(o,o),o.clone=function(n){return V(n)?Nn(n)?A(n):k(n,_n(n)):n},o.escape=function(n){return(n=Q(n))&&rn.test(n)?n.replace(tn,fn):n},o.every=function(n,t,r){return t=r?Z:t,f(n,g(t))},o.find=An,o.forEach=z,o.has=function(n,t){return null!=n&&pn.call(n,t)},o.head=q,o.identity=X,o.indexOf=P,o.isArguments=n,o.isArray=Nn,o.isBoolean=function(n){return true===n||false===n||H(n)&&"[object Boolean]"==hn.call(n);
|
26
|
+
},o.isDate=function(n){return H(n)&&"[object Date]"==hn.call(n)},o.isEmpty=function(t){return M(t)&&(Nn(t)||L(t)||U(t.splice)||n(t))?!t.length:!_n(t).length},o.isEqual=function(n,t){return b(n,t)},o.isFinite=function(n){return typeof n=="number"&&gn(n)},o.isFunction=U,o.isNaN=function(n){return K(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=K,o.isObject=V,o.isRegExp=function(n){return H(n)&&"[object RegExp]"==hn.call(n)},o.isString=L,o.isUndefined=function(n){return n===Z},o.last=function(n){
|
27
|
+
var t=null==n?0:n.length;return t?n[t-1]:Z},o.max=function(n){return n&&n.length?a(n,X,v):Z},o.min=function(n){return n&&n.length?a(n,X,_):Z},o.noConflict=function(){return on._===this&&(on._=vn),this},o.noop=function(){},o.reduce=C,o.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=M(n)?n:_n(n),n.length)},o.some=function(n,t,r){return t=r?Z:t,E(n,g(t))},o.uniqueId=function(n){var t=++sn;return Q(n)+t},o.each=z,o.first=q,Y(o,function(){
|
28
|
+
var n={};return s(o,function(t,r){pn.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.17.21",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:an)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Nn(u)?u:[],n)}return this[r](function(r){return t.apply(Nn(r)?r:[],n);
|
29
|
+
})}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return w(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o, define(function(){return o})):cn?((cn.exports=o)._=o,un._=o):on._=o}).call(this);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @license
|
3
3
|
* Lodash <https://lodash.com/>
|
4
|
-
* Copyright
|
4
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
5
5
|
* Released under MIT license <https://lodash.com/license>
|
6
6
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
7
7
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
@@ -12,14 +12,15 @@
|
|
12
12
|
var undefined;
|
13
13
|
|
14
14
|
/** Used as the semantic version number. */
|
15
|
-
var VERSION = '4.17.
|
15
|
+
var VERSION = '4.17.21';
|
16
16
|
|
17
17
|
/** Used as the size to enable large array optimizations. */
|
18
18
|
var LARGE_ARRAY_SIZE = 200;
|
19
19
|
|
20
20
|
/** Error message constants. */
|
21
21
|
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
22
|
-
|
22
|
+
FUNC_ERROR_TEXT = 'Expected a function',
|
23
|
+
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
|
23
24
|
|
24
25
|
/** Used to stand-in for `undefined` hash values. */
|
25
26
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
@@ -32,48 +33,48 @@
|
|
32
33
|
|
33
34
|
/** Used to compose bitmasks for cloning. */
|
34
35
|
var CLONE_DEEP_FLAG = 1,
|
35
|
-
|
36
|
-
|
36
|
+
CLONE_FLAT_FLAG = 2,
|
37
|
+
CLONE_SYMBOLS_FLAG = 4;
|
37
38
|
|
38
39
|
/** Used to compose bitmasks for value comparisons. */
|
39
40
|
var COMPARE_PARTIAL_FLAG = 1,
|
40
|
-
|
41
|
+
COMPARE_UNORDERED_FLAG = 2;
|
41
42
|
|
42
43
|
/** Used to compose bitmasks for function metadata. */
|
43
44
|
var WRAP_BIND_FLAG = 1,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
WRAP_BIND_KEY_FLAG = 2,
|
46
|
+
WRAP_CURRY_BOUND_FLAG = 4,
|
47
|
+
WRAP_CURRY_FLAG = 8,
|
48
|
+
WRAP_CURRY_RIGHT_FLAG = 16,
|
49
|
+
WRAP_PARTIAL_FLAG = 32,
|
50
|
+
WRAP_PARTIAL_RIGHT_FLAG = 64,
|
51
|
+
WRAP_ARY_FLAG = 128,
|
52
|
+
WRAP_REARG_FLAG = 256,
|
53
|
+
WRAP_FLIP_FLAG = 512;
|
53
54
|
|
54
55
|
/** Used as default options for `_.truncate`. */
|
55
56
|
var DEFAULT_TRUNC_LENGTH = 30,
|
56
|
-
|
57
|
+
DEFAULT_TRUNC_OMISSION = '...';
|
57
58
|
|
58
59
|
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
59
60
|
var HOT_COUNT = 800,
|
60
|
-
|
61
|
+
HOT_SPAN = 16;
|
61
62
|
|
62
63
|
/** Used to indicate the type of lazy iteratees. */
|
63
64
|
var LAZY_FILTER_FLAG = 1,
|
64
|
-
|
65
|
-
|
65
|
+
LAZY_MAP_FLAG = 2,
|
66
|
+
LAZY_WHILE_FLAG = 3;
|
66
67
|
|
67
68
|
/** Used as references for various `Number` constants. */
|
68
69
|
var INFINITY = 1 / 0,
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
MAX_SAFE_INTEGER = 9007199254740991,
|
71
|
+
MAX_INTEGER = 1.7976931348623157e+308,
|
72
|
+
NAN = 0 / 0;
|
72
73
|
|
73
74
|
/** Used as references for the maximum length and index of an array. */
|
74
75
|
var MAX_ARRAY_LENGTH = 4294967295,
|
75
|
-
|
76
|
-
|
76
|
+
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
|
77
|
+
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
77
78
|
|
78
79
|
/** Used to associate wrap methods with their bit flags. */
|
79
80
|
var wrapFlags = [
|
@@ -90,81 +91,94 @@
|
|
90
91
|
|
91
92
|
/** `Object#toString` result references. */
|
92
93
|
var argsTag = '[object Arguments]',
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
94
|
+
arrayTag = '[object Array]',
|
95
|
+
asyncTag = '[object AsyncFunction]',
|
96
|
+
boolTag = '[object Boolean]',
|
97
|
+
dateTag = '[object Date]',
|
98
|
+
domExcTag = '[object DOMException]',
|
99
|
+
errorTag = '[object Error]',
|
100
|
+
funcTag = '[object Function]',
|
101
|
+
genTag = '[object GeneratorFunction]',
|
102
|
+
mapTag = '[object Map]',
|
103
|
+
numberTag = '[object Number]',
|
104
|
+
nullTag = '[object Null]',
|
105
|
+
objectTag = '[object Object]',
|
106
|
+
promiseTag = '[object Promise]',
|
107
|
+
proxyTag = '[object Proxy]',
|
108
|
+
regexpTag = '[object RegExp]',
|
109
|
+
setTag = '[object Set]',
|
110
|
+
stringTag = '[object String]',
|
111
|
+
symbolTag = '[object Symbol]',
|
112
|
+
undefinedTag = '[object Undefined]',
|
113
|
+
weakMapTag = '[object WeakMap]',
|
114
|
+
weakSetTag = '[object WeakSet]';
|
114
115
|
|
115
116
|
var arrayBufferTag = '[object ArrayBuffer]',
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
117
|
+
dataViewTag = '[object DataView]',
|
118
|
+
float32Tag = '[object Float32Array]',
|
119
|
+
float64Tag = '[object Float64Array]',
|
120
|
+
int8Tag = '[object Int8Array]',
|
121
|
+
int16Tag = '[object Int16Array]',
|
122
|
+
int32Tag = '[object Int32Array]',
|
123
|
+
uint8Tag = '[object Uint8Array]',
|
124
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
125
|
+
uint16Tag = '[object Uint16Array]',
|
126
|
+
uint32Tag = '[object Uint32Array]';
|
126
127
|
|
127
128
|
/** Used to match empty string literals in compiled template source. */
|
128
129
|
var reEmptyStringLeading = /\b__p \+= '';/g,
|
129
|
-
|
130
|
-
|
130
|
+
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
131
|
+
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
131
132
|
|
132
133
|
/** Used to match HTML entities and HTML characters. */
|
133
134
|
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
reUnescapedHtml = /[&<>"']/g,
|
136
|
+
reHasEscapedHtml = RegExp(reEscapedHtml.source),
|
137
|
+
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
137
138
|
|
138
139
|
/** Used to match template delimiters. */
|
139
140
|
var reEscape = /<%-([\s\S]+?)%>/g,
|
140
|
-
|
141
|
-
|
141
|
+
reEvaluate = /<%([\s\S]+?)%>/g,
|
142
|
+
reInterpolate = /<%=([\s\S]+?)%>/g;
|
142
143
|
|
143
144
|
/** Used to match property names within property paths. */
|
144
145
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
145
|
-
|
146
|
-
|
146
|
+
reIsPlainProp = /^\w*$/,
|
147
|
+
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
147
148
|
|
148
149
|
/**
|
149
150
|
* Used to match `RegExp`
|
150
151
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
151
152
|
*/
|
152
153
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
153
|
-
|
154
|
+
reHasRegExpChar = RegExp(reRegExpChar.source);
|
154
155
|
|
155
|
-
/** Used to match leading
|
156
|
-
var
|
157
|
-
|
158
|
-
|
156
|
+
/** Used to match leading whitespace. */
|
157
|
+
var reTrimStart = /^\s+/;
|
158
|
+
|
159
|
+
/** Used to match a single whitespace character. */
|
160
|
+
var reWhitespace = /\s/;
|
159
161
|
|
160
162
|
/** Used to match wrap detail comments. */
|
161
163
|
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
|
162
|
-
|
163
|
-
|
164
|
+
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
|
165
|
+
reSplitDetails = /,? & /;
|
164
166
|
|
165
167
|
/** Used to match words composed of alphanumeric characters. */
|
166
168
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
167
169
|
|
170
|
+
/**
|
171
|
+
* Used to validate the `validate` option in `_.template` variable.
|
172
|
+
*
|
173
|
+
* Forbids characters which could potentially change the meaning of the function argument definition:
|
174
|
+
* - "()," (modification of function parameters)
|
175
|
+
* - "=" (default value)
|
176
|
+
* - "[]{}" (destructuring of function parameters)
|
177
|
+
* - "/" (beginning of a comment)
|
178
|
+
* - whitespace
|
179
|
+
*/
|
180
|
+
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
|
181
|
+
|
168
182
|
/** Used to match backslashes in property paths. */
|
169
183
|
var reEscapeChar = /\\(\\)?/g;
|
170
184
|
|
@@ -203,50 +217,50 @@
|
|
203
217
|
|
204
218
|
/** Used to compose unicode character classes. */
|
205
219
|
var rsAstralRange = '\\ud800-\\udfff',
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
220
|
+
rsComboMarksRange = '\\u0300-\\u036f',
|
221
|
+
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
222
|
+
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
223
|
+
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
224
|
+
rsDingbatRange = '\\u2700-\\u27bf',
|
225
|
+
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
226
|
+
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
227
|
+
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
228
|
+
rsPunctuationRange = '\\u2000-\\u206f',
|
229
|
+
rsSpaceRange = ' \\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',
|
230
|
+
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
231
|
+
rsVarRange = '\\ufe0e\\ufe0f',
|
232
|
+
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
219
233
|
|
220
234
|
/** Used to compose unicode capture groups. */
|
221
235
|
var rsApos = "['\u2019]",
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
+
rsAstral = '[' + rsAstralRange + ']',
|
237
|
+
rsBreak = '[' + rsBreakRange + ']',
|
238
|
+
rsCombo = '[' + rsComboRange + ']',
|
239
|
+
rsDigits = '\\d+',
|
240
|
+
rsDingbat = '[' + rsDingbatRange + ']',
|
241
|
+
rsLower = '[' + rsLowerRange + ']',
|
242
|
+
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
243
|
+
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
244
|
+
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
245
|
+
rsNonAstral = '[^' + rsAstralRange + ']',
|
246
|
+
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
247
|
+
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
248
|
+
rsUpper = '[' + rsUpperRange + ']',
|
249
|
+
rsZWJ = '\\u200d';
|
236
250
|
|
237
251
|
/** Used to compose unicode regexes. */
|
238
252
|
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
253
|
+
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
254
|
+
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
|
255
|
+
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
|
256
|
+
reOptMod = rsModifier + '?',
|
257
|
+
rsOptVar = '[' + rsVarRange + ']?',
|
258
|
+
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
259
|
+
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
260
|
+
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
261
|
+
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
262
|
+
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
|
263
|
+
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
250
264
|
|
251
265
|
/** Used to match apostrophes. */
|
252
266
|
var reApos = RegExp(rsApos, 'g');
|
@@ -276,7 +290,7 @@
|
|
276
290
|
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
|
277
291
|
|
278
292
|
/** Used to detect strings that need a more robust regexp to match words. */
|
279
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2
|
293
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
280
294
|
|
281
295
|
/** Used to assign default `context` object properties. */
|
282
296
|
var contextProps = [
|
@@ -293,34 +307,34 @@
|
|
293
307
|
/** Used to identify `toStringTag` values of typed arrays. */
|
294
308
|
var typedArrayTags = {};
|
295
309
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
310
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
311
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
312
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
313
|
+
typedArrayTags[uint32Tag] = true;
|
300
314
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
315
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
316
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
317
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
318
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
319
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
320
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
321
|
+
typedArrayTags[weakMapTag] = false;
|
308
322
|
|
309
323
|
/** Used to identify `toStringTag` values supported by `_.clone`. */
|
310
324
|
var cloneableTags = {};
|
311
325
|
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
326
|
+
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
327
|
+
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
328
|
+
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
329
|
+
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
330
|
+
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
331
|
+
cloneableTags[numberTag] = cloneableTags[objectTag] =
|
332
|
+
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
333
|
+
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
334
|
+
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
335
|
+
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
322
336
|
cloneableTags[errorTag] = cloneableTags[funcTag] =
|
323
|
-
|
337
|
+
cloneableTags[weakMapTag] = false;
|
324
338
|
|
325
339
|
/** Used to map Latin Unicode letters to basic Latin letters. */
|
326
340
|
var deburredLetters = {
|
@@ -410,7 +424,7 @@
|
|
410
424
|
|
411
425
|
/** Built-in method references without a dependency on `root`. */
|
412
426
|
var freeParseFloat = parseFloat,
|
413
|
-
|
427
|
+
freeParseInt = parseInt;
|
414
428
|
|
415
429
|
/** Detect free variable `global` from Node.js. */
|
416
430
|
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
@@ -436,17 +450,25 @@
|
|
436
450
|
/** Used to access faster Node.js helpers. */
|
437
451
|
var nodeUtil = (function() {
|
438
452
|
try {
|
453
|
+
// Use `util.types` for Node.js 10+.
|
454
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
455
|
+
|
456
|
+
if (types) {
|
457
|
+
return types;
|
458
|
+
}
|
459
|
+
|
460
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
439
461
|
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
440
462
|
} catch (e) {}
|
441
463
|
}());
|
442
464
|
|
443
465
|
/* Node.js helper references. */
|
444
466
|
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
467
|
+
nodeIsDate = nodeUtil && nodeUtil.isDate,
|
468
|
+
nodeIsMap = nodeUtil && nodeUtil.isMap,
|
469
|
+
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
|
470
|
+
nodeIsSet = nodeUtil && nodeUtil.isSet,
|
471
|
+
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
450
472
|
|
451
473
|
/*--------------------------------------------------------------------------*/
|
452
474
|
|
@@ -482,7 +504,7 @@
|
|
482
504
|
*/
|
483
505
|
function arrayAggregator(array, setter, iteratee, accumulator) {
|
484
506
|
var index = -1,
|
485
|
-
|
507
|
+
length = array == null ? 0 : array.length;
|
486
508
|
|
487
509
|
while (++index < length) {
|
488
510
|
var value = array[index];
|
@@ -502,7 +524,7 @@
|
|
502
524
|
*/
|
503
525
|
function arrayEach(array, iteratee) {
|
504
526
|
var index = -1,
|
505
|
-
|
527
|
+
length = array == null ? 0 : array.length;
|
506
528
|
|
507
529
|
while (++index < length) {
|
508
530
|
if (iteratee(array[index], index, array) === false) {
|
@@ -544,7 +566,7 @@
|
|
544
566
|
*/
|
545
567
|
function arrayEvery(array, predicate) {
|
546
568
|
var index = -1,
|
547
|
-
|
569
|
+
length = array == null ? 0 : array.length;
|
548
570
|
|
549
571
|
while (++index < length) {
|
550
572
|
if (!predicate(array[index], index, array)) {
|
@@ -565,9 +587,9 @@
|
|
565
587
|
*/
|
566
588
|
function arrayFilter(array, predicate) {
|
567
589
|
var index = -1,
|
568
|
-
|
569
|
-
|
570
|
-
|
590
|
+
length = array == null ? 0 : array.length,
|
591
|
+
resIndex = 0,
|
592
|
+
result = [];
|
571
593
|
|
572
594
|
while (++index < length) {
|
573
595
|
var value = array[index];
|
@@ -603,7 +625,7 @@
|
|
603
625
|
*/
|
604
626
|
function arrayIncludesWith(array, value, comparator) {
|
605
627
|
var index = -1,
|
606
|
-
|
628
|
+
length = array == null ? 0 : array.length;
|
607
629
|
|
608
630
|
while (++index < length) {
|
609
631
|
if (comparator(value, array[index])) {
|
@@ -624,8 +646,8 @@
|
|
624
646
|
*/
|
625
647
|
function arrayMap(array, iteratee) {
|
626
648
|
var index = -1,
|
627
|
-
|
628
|
-
|
649
|
+
length = array == null ? 0 : array.length,
|
650
|
+
result = Array(length);
|
629
651
|
|
630
652
|
while (++index < length) {
|
631
653
|
result[index] = iteratee(array[index], index, array);
|
@@ -643,8 +665,8 @@
|
|
643
665
|
*/
|
644
666
|
function arrayPush(array, values) {
|
645
667
|
var index = -1,
|
646
|
-
|
647
|
-
|
668
|
+
length = values.length,
|
669
|
+
offset = array.length;
|
648
670
|
|
649
671
|
while (++index < length) {
|
650
672
|
array[offset + index] = values[index];
|
@@ -666,7 +688,7 @@
|
|
666
688
|
*/
|
667
689
|
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
668
690
|
var index = -1,
|
669
|
-
|
691
|
+
length = array == null ? 0 : array.length;
|
670
692
|
|
671
693
|
if (initAccum && length) {
|
672
694
|
accumulator = array[++index];
|
@@ -712,7 +734,7 @@
|
|
712
734
|
*/
|
713
735
|
function arraySome(array, predicate) {
|
714
736
|
var index = -1,
|
715
|
-
|
737
|
+
length = array == null ? 0 : array.length;
|
716
738
|
|
717
739
|
while (++index < length) {
|
718
740
|
if (predicate(array[index], index, array)) {
|
@@ -788,7 +810,7 @@
|
|
788
810
|
*/
|
789
811
|
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
790
812
|
var length = array.length,
|
791
|
-
|
813
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
792
814
|
|
793
815
|
while ((fromRight ? index-- : ++index < length)) {
|
794
816
|
if (predicate(array[index], index, array)) {
|
@@ -825,7 +847,7 @@
|
|
825
847
|
*/
|
826
848
|
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
827
849
|
var index = fromIndex - 1,
|
828
|
-
|
850
|
+
length = array.length;
|
829
851
|
|
830
852
|
while (++index < length) {
|
831
853
|
if (comparator(array[index], value)) {
|
@@ -939,8 +961,8 @@
|
|
939
961
|
*/
|
940
962
|
function baseSum(array, iteratee) {
|
941
963
|
var result,
|
942
|
-
|
943
|
-
|
964
|
+
index = -1,
|
965
|
+
length = array.length;
|
944
966
|
|
945
967
|
while (++index < length) {
|
946
968
|
var current = iteratee(array[index]);
|
@@ -962,7 +984,7 @@
|
|
962
984
|
*/
|
963
985
|
function baseTimes(n, iteratee) {
|
964
986
|
var index = -1,
|
965
|
-
|
987
|
+
result = Array(n);
|
966
988
|
|
967
989
|
while (++index < n) {
|
968
990
|
result[index] = iteratee(index);
|
@@ -985,6 +1007,19 @@
|
|
985
1007
|
});
|
986
1008
|
}
|
987
1009
|
|
1010
|
+
/**
|
1011
|
+
* The base implementation of `_.trim`.
|
1012
|
+
*
|
1013
|
+
* @private
|
1014
|
+
* @param {string} string The string to trim.
|
1015
|
+
* @returns {string} Returns the trimmed string.
|
1016
|
+
*/
|
1017
|
+
function baseTrim(string) {
|
1018
|
+
return string
|
1019
|
+
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
1020
|
+
: string;
|
1021
|
+
}
|
1022
|
+
|
988
1023
|
/**
|
989
1024
|
* The base implementation of `_.unary` without support for storing metadata.
|
990
1025
|
*
|
@@ -1037,7 +1072,7 @@
|
|
1037
1072
|
*/
|
1038
1073
|
function charsStartIndex(strSymbols, chrSymbols) {
|
1039
1074
|
var index = -1,
|
1040
|
-
|
1075
|
+
length = strSymbols.length;
|
1041
1076
|
|
1042
1077
|
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
|
1043
1078
|
return index;
|
@@ -1069,7 +1104,7 @@
|
|
1069
1104
|
*/
|
1070
1105
|
function countHolders(array, placeholder) {
|
1071
1106
|
var length = array.length,
|
1072
|
-
|
1107
|
+
result = 0;
|
1073
1108
|
|
1074
1109
|
while (length--) {
|
1075
1110
|
if (array[length] === placeholder) {
|
@@ -1152,7 +1187,7 @@
|
|
1152
1187
|
*/
|
1153
1188
|
function iteratorToArray(iterator) {
|
1154
1189
|
var data,
|
1155
|
-
|
1190
|
+
result = [];
|
1156
1191
|
|
1157
1192
|
while (!(data = iterator.next()).done) {
|
1158
1193
|
result.push(data.value);
|
@@ -1169,7 +1204,7 @@
|
|
1169
1204
|
*/
|
1170
1205
|
function mapToArray(map) {
|
1171
1206
|
var index = -1,
|
1172
|
-
|
1207
|
+
result = Array(map.size);
|
1173
1208
|
|
1174
1209
|
map.forEach(function(value, key) {
|
1175
1210
|
result[++index] = [key, value];
|
@@ -1202,9 +1237,9 @@
|
|
1202
1237
|
*/
|
1203
1238
|
function replaceHolders(array, placeholder) {
|
1204
1239
|
var index = -1,
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1240
|
+
length = array.length,
|
1241
|
+
resIndex = 0,
|
1242
|
+
result = [];
|
1208
1243
|
|
1209
1244
|
while (++index < length) {
|
1210
1245
|
var value = array[index];
|
@@ -1216,20 +1251,6 @@
|
|
1216
1251
|
return result;
|
1217
1252
|
}
|
1218
1253
|
|
1219
|
-
/**
|
1220
|
-
* Gets the value at `key`, unless `key` is "__proto__".
|
1221
|
-
*
|
1222
|
-
* @private
|
1223
|
-
* @param {Object} object The object to query.
|
1224
|
-
* @param {string} key The key of the property to get.
|
1225
|
-
* @returns {*} Returns the property value.
|
1226
|
-
*/
|
1227
|
-
function safeGet(object, key) {
|
1228
|
-
return key == '__proto__'
|
1229
|
-
? undefined
|
1230
|
-
: object[key];
|
1231
|
-
}
|
1232
|
-
|
1233
1254
|
/**
|
1234
1255
|
* Converts `set` to an array of its values.
|
1235
1256
|
*
|
@@ -1239,7 +1260,7 @@
|
|
1239
1260
|
*/
|
1240
1261
|
function setToArray(set) {
|
1241
1262
|
var index = -1,
|
1242
|
-
|
1263
|
+
result = Array(set.size);
|
1243
1264
|
|
1244
1265
|
set.forEach(function(value) {
|
1245
1266
|
result[++index] = value;
|
@@ -1256,7 +1277,7 @@
|
|
1256
1277
|
*/
|
1257
1278
|
function setToPairs(set) {
|
1258
1279
|
var index = -1,
|
1259
|
-
|
1280
|
+
result = Array(set.size);
|
1260
1281
|
|
1261
1282
|
set.forEach(function(value) {
|
1262
1283
|
result[++index] = [value, value];
|
@@ -1276,7 +1297,7 @@
|
|
1276
1297
|
*/
|
1277
1298
|
function strictIndexOf(array, value, fromIndex) {
|
1278
1299
|
var index = fromIndex - 1,
|
1279
|
-
|
1300
|
+
length = array.length;
|
1280
1301
|
|
1281
1302
|
while (++index < length) {
|
1282
1303
|
if (array[index] === value) {
|
@@ -1332,6 +1353,21 @@
|
|
1332
1353
|
: asciiToArray(string);
|
1333
1354
|
}
|
1334
1355
|
|
1356
|
+
/**
|
1357
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
1358
|
+
* character of `string`.
|
1359
|
+
*
|
1360
|
+
* @private
|
1361
|
+
* @param {string} string The string to inspect.
|
1362
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
1363
|
+
*/
|
1364
|
+
function trimmedEndIndex(string) {
|
1365
|
+
var index = string.length;
|
1366
|
+
|
1367
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
1368
|
+
return index;
|
1369
|
+
}
|
1370
|
+
|
1335
1371
|
/**
|
1336
1372
|
* Used by `_.unescape` to convert HTML entities to characters.
|
1337
1373
|
*
|
@@ -1414,19 +1450,19 @@
|
|
1414
1450
|
|
1415
1451
|
/** Built-in constructor references. */
|
1416
1452
|
var Array = context.Array,
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1453
|
+
Date = context.Date,
|
1454
|
+
Error = context.Error,
|
1455
|
+
Function = context.Function,
|
1456
|
+
Math = context.Math,
|
1457
|
+
Object = context.Object,
|
1458
|
+
RegExp = context.RegExp,
|
1459
|
+
String = context.String,
|
1460
|
+
TypeError = context.TypeError;
|
1425
1461
|
|
1426
1462
|
/** Used for built-in method references. */
|
1427
1463
|
var arrayProto = Array.prototype,
|
1428
|
-
|
1429
|
-
|
1464
|
+
funcProto = Function.prototype,
|
1465
|
+
objectProto = Object.prototype;
|
1430
1466
|
|
1431
1467
|
/** Used to detect overreaching core-js shims. */
|
1432
1468
|
var coreJsData = context['__core-js_shared__'];
|
@@ -1462,21 +1498,21 @@
|
|
1462
1498
|
/** Used to detect if a method is native. */
|
1463
1499
|
var reIsNative = RegExp('^' +
|
1464
1500
|
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
1465
|
-
|
1501
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
1466
1502
|
);
|
1467
1503
|
|
1468
1504
|
/** Built-in value references. */
|
1469
1505
|
var Buffer = moduleExports ? context.Buffer : undefined,
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1506
|
+
Symbol = context.Symbol,
|
1507
|
+
Uint8Array = context.Uint8Array,
|
1508
|
+
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
|
1509
|
+
getPrototype = overArg(Object.getPrototypeOf, Object),
|
1510
|
+
objectCreate = Object.create,
|
1511
|
+
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
1512
|
+
splice = arrayProto.splice,
|
1513
|
+
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
|
1514
|
+
symIterator = Symbol ? Symbol.iterator : undefined,
|
1515
|
+
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
1480
1516
|
|
1481
1517
|
var defineProperty = (function() {
|
1482
1518
|
try {
|
@@ -1488,31 +1524,31 @@
|
|
1488
1524
|
|
1489
1525
|
/** Mocked built-ins. */
|
1490
1526
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
|
1491
|
-
|
1492
|
-
|
1527
|
+
ctxNow = Date && Date.now !== root.Date.now && Date.now,
|
1528
|
+
ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
1493
1529
|
|
1494
1530
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
1495
1531
|
var nativeCeil = Math.ceil,
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1532
|
+
nativeFloor = Math.floor,
|
1533
|
+
nativeGetSymbols = Object.getOwnPropertySymbols,
|
1534
|
+
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
|
1535
|
+
nativeIsFinite = context.isFinite,
|
1536
|
+
nativeJoin = arrayProto.join,
|
1537
|
+
nativeKeys = overArg(Object.keys, Object),
|
1538
|
+
nativeMax = Math.max,
|
1539
|
+
nativeMin = Math.min,
|
1540
|
+
nativeNow = Date.now,
|
1541
|
+
nativeParseInt = context.parseInt,
|
1542
|
+
nativeRandom = Math.random,
|
1543
|
+
nativeReverse = arrayProto.reverse;
|
1508
1544
|
|
1509
1545
|
/* Built-in method references that are verified to be native. */
|
1510
1546
|
var DataView = getNative(context, 'DataView'),
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1547
|
+
Map = getNative(context, 'Map'),
|
1548
|
+
Promise = getNative(context, 'Promise'),
|
1549
|
+
Set = getNative(context, 'Set'),
|
1550
|
+
WeakMap = getNative(context, 'WeakMap'),
|
1551
|
+
nativeCreate = getNative(Object, 'create');
|
1516
1552
|
|
1517
1553
|
/** Used to store function metadata. */
|
1518
1554
|
var metaMap = WeakMap && new WeakMap;
|
@@ -1522,15 +1558,15 @@
|
|
1522
1558
|
|
1523
1559
|
/** Used to detect maps, sets, and weakmaps. */
|
1524
1560
|
var dataViewCtorString = toSource(DataView),
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1561
|
+
mapCtorString = toSource(Map),
|
1562
|
+
promiseCtorString = toSource(Promise),
|
1563
|
+
setCtorString = toSource(Set),
|
1564
|
+
weakMapCtorString = toSource(WeakMap);
|
1529
1565
|
|
1530
1566
|
/** Used to convert symbols to primitives and strings. */
|
1531
1567
|
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
1532
|
-
|
1533
|
-
|
1568
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
|
1569
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
1534
1570
|
|
1535
1571
|
/*------------------------------------------------------------------------*/
|
1536
1572
|
|
@@ -1847,19 +1883,19 @@
|
|
1847
1883
|
*/
|
1848
1884
|
function lazyValue() {
|
1849
1885
|
var array = this.__wrapped__.value(),
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1886
|
+
dir = this.__dir__,
|
1887
|
+
isArr = isArray(array),
|
1888
|
+
isRight = dir < 0,
|
1889
|
+
arrLength = isArr ? array.length : 0,
|
1890
|
+
view = getView(0, arrLength, this.__views__),
|
1891
|
+
start = view.start,
|
1892
|
+
end = view.end,
|
1893
|
+
length = end - start,
|
1894
|
+
index = isRight ? end : (start - 1),
|
1895
|
+
iteratees = this.__iteratees__,
|
1896
|
+
iterLength = iteratees.length,
|
1897
|
+
resIndex = 0,
|
1898
|
+
takeCount = nativeMin(length, this.__takeCount__);
|
1863
1899
|
|
1864
1900
|
if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
|
1865
1901
|
return baseWrapperValue(array, this.__actions__);
|
@@ -1867,30 +1903,30 @@
|
|
1867
1903
|
var result = [];
|
1868
1904
|
|
1869
1905
|
outer:
|
1870
|
-
|
1871
|
-
|
1906
|
+
while (length-- && resIndex < takeCount) {
|
1907
|
+
index += dir;
|
1872
1908
|
|
1873
|
-
|
1909
|
+
var iterIndex = -1,
|
1874
1910
|
value = array[index];
|
1875
1911
|
|
1876
|
-
|
1877
|
-
|
1912
|
+
while (++iterIndex < iterLength) {
|
1913
|
+
var data = iteratees[iterIndex],
|
1878
1914
|
iteratee = data.iteratee,
|
1879
1915
|
type = data.type,
|
1880
1916
|
computed = iteratee(value);
|
1881
1917
|
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1918
|
+
if (type == LAZY_MAP_FLAG) {
|
1919
|
+
value = computed;
|
1920
|
+
} else if (!computed) {
|
1921
|
+
if (type == LAZY_FILTER_FLAG) {
|
1922
|
+
continue outer;
|
1923
|
+
} else {
|
1924
|
+
break outer;
|
1925
|
+
}
|
1889
1926
|
}
|
1890
1927
|
}
|
1928
|
+
result[resIndex++] = value;
|
1891
1929
|
}
|
1892
|
-
result[resIndex++] = value;
|
1893
|
-
}
|
1894
1930
|
return result;
|
1895
1931
|
}
|
1896
1932
|
|
@@ -1909,7 +1945,7 @@
|
|
1909
1945
|
*/
|
1910
1946
|
function Hash(entries) {
|
1911
1947
|
var index = -1,
|
1912
|
-
|
1948
|
+
length = entries == null ? 0 : entries.length;
|
1913
1949
|
|
1914
1950
|
this.clear();
|
1915
1951
|
while (++index < length) {
|
@@ -2013,7 +2049,7 @@
|
|
2013
2049
|
*/
|
2014
2050
|
function ListCache(entries) {
|
2015
2051
|
var index = -1,
|
2016
|
-
|
2052
|
+
length = entries == null ? 0 : entries.length;
|
2017
2053
|
|
2018
2054
|
this.clear();
|
2019
2055
|
while (++index < length) {
|
@@ -2045,7 +2081,7 @@
|
|
2045
2081
|
*/
|
2046
2082
|
function listCacheDelete(key) {
|
2047
2083
|
var data = this.__data__,
|
2048
|
-
|
2084
|
+
index = assocIndexOf(data, key);
|
2049
2085
|
|
2050
2086
|
if (index < 0) {
|
2051
2087
|
return false;
|
@@ -2071,7 +2107,7 @@
|
|
2071
2107
|
*/
|
2072
2108
|
function listCacheGet(key) {
|
2073
2109
|
var data = this.__data__,
|
2074
|
-
|
2110
|
+
index = assocIndexOf(data, key);
|
2075
2111
|
|
2076
2112
|
return index < 0 ? undefined : data[index][1];
|
2077
2113
|
}
|
@@ -2101,7 +2137,7 @@
|
|
2101
2137
|
*/
|
2102
2138
|
function listCacheSet(key, value) {
|
2103
2139
|
var data = this.__data__,
|
2104
|
-
|
2140
|
+
index = assocIndexOf(data, key);
|
2105
2141
|
|
2106
2142
|
if (index < 0) {
|
2107
2143
|
++this.size;
|
@@ -2130,7 +2166,7 @@
|
|
2130
2166
|
*/
|
2131
2167
|
function MapCache(entries) {
|
2132
2168
|
var index = -1,
|
2133
|
-
|
2169
|
+
length = entries == null ? 0 : entries.length;
|
2134
2170
|
|
2135
2171
|
this.clear();
|
2136
2172
|
while (++index < length) {
|
@@ -2208,7 +2244,7 @@
|
|
2208
2244
|
*/
|
2209
2245
|
function mapCacheSet(key, value) {
|
2210
2246
|
var data = getMapData(this, key),
|
2211
|
-
|
2247
|
+
size = data.size;
|
2212
2248
|
|
2213
2249
|
data.set(key, value);
|
2214
2250
|
this.size += data.size == size ? 0 : 1;
|
@@ -2234,7 +2270,7 @@
|
|
2234
2270
|
*/
|
2235
2271
|
function SetCache(values) {
|
2236
2272
|
var index = -1,
|
2237
|
-
|
2273
|
+
length = values == null ? 0 : values.length;
|
2238
2274
|
|
2239
2275
|
this.__data__ = new MapCache;
|
2240
2276
|
while (++index < length) {
|
@@ -2311,7 +2347,7 @@
|
|
2311
2347
|
*/
|
2312
2348
|
function stackDelete(key) {
|
2313
2349
|
var data = this.__data__,
|
2314
|
-
|
2350
|
+
result = data['delete'](key);
|
2315
2351
|
|
2316
2352
|
this.size = data.size;
|
2317
2353
|
return result;
|
@@ -2388,25 +2424,25 @@
|
|
2388
2424
|
*/
|
2389
2425
|
function arrayLikeKeys(value, inherited) {
|
2390
2426
|
var isArr = isArray(value),
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2427
|
+
isArg = !isArr && isArguments(value),
|
2428
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
2429
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
2430
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
2431
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
2432
|
+
length = result.length;
|
2397
2433
|
|
2398
2434
|
for (var key in value) {
|
2399
2435
|
if ((inherited || hasOwnProperty.call(value, key)) &&
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
|
2436
|
+
!(skipIndexes && (
|
2437
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
2438
|
+
key == 'length' ||
|
2439
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
2440
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
2441
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
2442
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
2443
|
+
// Skip index properties.
|
2444
|
+
isIndex(key, length)
|
2445
|
+
))) {
|
2410
2446
|
result.push(key);
|
2411
2447
|
}
|
2412
2448
|
}
|
@@ -2459,7 +2495,7 @@
|
|
2459
2495
|
*/
|
2460
2496
|
function assignMergeValue(object, key, value) {
|
2461
2497
|
if ((value !== undefined && !eq(object[key], value)) ||
|
2462
|
-
|
2498
|
+
(value === undefined && !(key in object))) {
|
2463
2499
|
baseAssignValue(object, key, value);
|
2464
2500
|
}
|
2465
2501
|
}
|
@@ -2477,7 +2513,7 @@
|
|
2477
2513
|
function assignValue(object, key, value) {
|
2478
2514
|
var objValue = object[key];
|
2479
2515
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
2480
|
-
|
2516
|
+
(value === undefined && !(key in object))) {
|
2481
2517
|
baseAssignValue(object, key, value);
|
2482
2518
|
}
|
2483
2519
|
}
|
@@ -2576,9 +2612,9 @@
|
|
2576
2612
|
*/
|
2577
2613
|
function baseAt(object, paths) {
|
2578
2614
|
var index = -1,
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2615
|
+
length = paths.length,
|
2616
|
+
result = Array(length),
|
2617
|
+
skip = object == null;
|
2582
2618
|
|
2583
2619
|
while (++index < length) {
|
2584
2620
|
result[index] = skip ? undefined : get(object, paths[index]);
|
@@ -2625,9 +2661,9 @@
|
|
2625
2661
|
*/
|
2626
2662
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
2627
2663
|
var result,
|
2628
|
-
|
2629
|
-
|
2630
|
-
|
2664
|
+
isDeep = bitmask & CLONE_DEEP_FLAG,
|
2665
|
+
isFlat = bitmask & CLONE_FLAT_FLAG,
|
2666
|
+
isFull = bitmask & CLONE_SYMBOLS_FLAG;
|
2631
2667
|
|
2632
2668
|
if (customizer) {
|
2633
2669
|
result = object ? customizer(value, key, object, stack) : customizer(value);
|
@@ -2646,7 +2682,7 @@
|
|
2646
2682
|
}
|
2647
2683
|
} else {
|
2648
2684
|
var tag = getTag(value),
|
2649
|
-
|
2685
|
+
isFunc = tag == funcTag || tag == genTag;
|
2650
2686
|
|
2651
2687
|
if (isBuffer(value)) {
|
2652
2688
|
return cloneBuffer(value, isDeep);
|
@@ -2677,16 +2713,10 @@
|
|
2677
2713
|
value.forEach(function(subValue) {
|
2678
2714
|
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
2679
2715
|
});
|
2680
|
-
|
2681
|
-
return result;
|
2682
|
-
}
|
2683
|
-
|
2684
|
-
if (isMap(value)) {
|
2716
|
+
} else if (isMap(value)) {
|
2685
2717
|
value.forEach(function(subValue, key) {
|
2686
2718
|
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
|
2687
2719
|
});
|
2688
|
-
|
2689
|
-
return result;
|
2690
2720
|
}
|
2691
2721
|
|
2692
2722
|
var keysFunc = isFull
|
@@ -2735,8 +2765,8 @@
|
|
2735
2765
|
object = Object(object);
|
2736
2766
|
while (length--) {
|
2737
2767
|
var key = props[length],
|
2738
|
-
|
2739
|
-
|
2768
|
+
predicate = source[key],
|
2769
|
+
value = object[key];
|
2740
2770
|
|
2741
2771
|
if ((value === undefined && !(key in object)) || !predicate(value)) {
|
2742
2772
|
return false;
|
@@ -2775,11 +2805,11 @@
|
|
2775
2805
|
*/
|
2776
2806
|
function baseDifference(array, values, iteratee, comparator) {
|
2777
2807
|
var index = -1,
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2808
|
+
includes = arrayIncludes,
|
2809
|
+
isCommon = true,
|
2810
|
+
length = array.length,
|
2811
|
+
result = [],
|
2812
|
+
valuesLength = values.length;
|
2783
2813
|
|
2784
2814
|
if (!length) {
|
2785
2815
|
return result;
|
@@ -2797,24 +2827,24 @@
|
|
2797
2827
|
values = new SetCache(values);
|
2798
2828
|
}
|
2799
2829
|
outer:
|
2800
|
-
|
2801
|
-
|
2830
|
+
while (++index < length) {
|
2831
|
+
var value = array[index],
|
2802
2832
|
computed = iteratee == null ? value : iteratee(value);
|
2803
2833
|
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2834
|
+
value = (comparator || value !== 0) ? value : 0;
|
2835
|
+
if (isCommon && computed === computed) {
|
2836
|
+
var valuesIndex = valuesLength;
|
2837
|
+
while (valuesIndex--) {
|
2838
|
+
if (values[valuesIndex] === computed) {
|
2839
|
+
continue outer;
|
2840
|
+
}
|
2810
2841
|
}
|
2842
|
+
result.push(value);
|
2843
|
+
}
|
2844
|
+
else if (!includes(values, computed, comparator)) {
|
2845
|
+
result.push(value);
|
2811
2846
|
}
|
2812
|
-
result.push(value);
|
2813
|
-
}
|
2814
|
-
else if (!includes(values, computed, comparator)) {
|
2815
|
-
result.push(value);
|
2816
2847
|
}
|
2817
|
-
}
|
2818
2848
|
return result;
|
2819
2849
|
}
|
2820
2850
|
|
@@ -2868,18 +2898,18 @@
|
|
2868
2898
|
*/
|
2869
2899
|
function baseExtremum(array, iteratee, comparator) {
|
2870
2900
|
var index = -1,
|
2871
|
-
|
2901
|
+
length = array.length;
|
2872
2902
|
|
2873
2903
|
while (++index < length) {
|
2874
2904
|
var value = array[index],
|
2875
|
-
|
2905
|
+
current = iteratee(value);
|
2876
2906
|
|
2877
2907
|
if (current != null && (computed === undefined
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2908
|
+
? (current === current && !isSymbol(current))
|
2909
|
+
: comparator(current, computed)
|
2910
|
+
)) {
|
2881
2911
|
var computed = current,
|
2882
|
-
|
2912
|
+
result = value;
|
2883
2913
|
}
|
2884
2914
|
}
|
2885
2915
|
return result;
|
@@ -2944,7 +2974,7 @@
|
|
2944
2974
|
*/
|
2945
2975
|
function baseFlatten(array, depth, predicate, isStrict, result) {
|
2946
2976
|
var index = -1,
|
2947
|
-
|
2977
|
+
length = array.length;
|
2948
2978
|
|
2949
2979
|
predicate || (predicate = isFlattenable);
|
2950
2980
|
result || (result = []);
|
@@ -3041,7 +3071,7 @@
|
|
3041
3071
|
path = castPath(path, object);
|
3042
3072
|
|
3043
3073
|
var index = 0,
|
3044
|
-
|
3074
|
+
length = path.length;
|
3045
3075
|
|
3046
3076
|
while (object != null && index < length) {
|
3047
3077
|
object = object[toKey(path[index++])];
|
@@ -3143,12 +3173,12 @@
|
|
3143
3173
|
*/
|
3144
3174
|
function baseIntersection(arrays, iteratee, comparator) {
|
3145
3175
|
var includes = comparator ? arrayIncludesWith : arrayIncludes,
|
3146
|
-
|
3147
|
-
|
3148
|
-
|
3149
|
-
|
3150
|
-
|
3151
|
-
|
3176
|
+
length = arrays[0].length,
|
3177
|
+
othLength = arrays.length,
|
3178
|
+
othIndex = othLength,
|
3179
|
+
caches = Array(othLength),
|
3180
|
+
maxLength = Infinity,
|
3181
|
+
result = [];
|
3152
3182
|
|
3153
3183
|
while (othIndex--) {
|
3154
3184
|
var array = arrays[othIndex];
|
@@ -3163,34 +3193,34 @@
|
|
3163
3193
|
array = arrays[0];
|
3164
3194
|
|
3165
3195
|
var index = -1,
|
3166
|
-
|
3196
|
+
seen = caches[0];
|
3167
3197
|
|
3168
3198
|
outer:
|
3169
|
-
|
3170
|
-
|
3199
|
+
while (++index < length && result.length < maxLength) {
|
3200
|
+
var value = array[index],
|
3171
3201
|
computed = iteratee ? iteratee(value) : value;
|
3172
3202
|
|
3173
|
-
|
3174
|
-
|
3203
|
+
value = (comparator || value !== 0) ? value : 0;
|
3204
|
+
if (!(seen
|
3175
3205
|
? cacheHas(seen, computed)
|
3176
3206
|
: includes(result, computed, comparator)
|
3177
|
-
|
3178
|
-
|
3179
|
-
|
3180
|
-
|
3181
|
-
|
3182
|
-
|
3183
|
-
|
3184
|
-
|
3185
|
-
|
3207
|
+
)) {
|
3208
|
+
othIndex = othLength;
|
3209
|
+
while (--othIndex) {
|
3210
|
+
var cache = caches[othIndex];
|
3211
|
+
if (!(cache
|
3212
|
+
? cacheHas(cache, computed)
|
3213
|
+
: includes(arrays[othIndex], computed, comparator))
|
3214
|
+
) {
|
3215
|
+
continue outer;
|
3216
|
+
}
|
3186
3217
|
}
|
3218
|
+
if (seen) {
|
3219
|
+
seen.push(computed);
|
3220
|
+
}
|
3221
|
+
result.push(value);
|
3187
3222
|
}
|
3188
|
-
if (seen) {
|
3189
|
-
seen.push(computed);
|
3190
|
-
}
|
3191
|
-
result.push(value);
|
3192
3223
|
}
|
3193
|
-
}
|
3194
3224
|
return result;
|
3195
3225
|
}
|
3196
3226
|
|
@@ -3302,16 +3332,16 @@
|
|
3302
3332
|
*/
|
3303
3333
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
3304
3334
|
var objIsArr = isArray(object),
|
3305
|
-
|
3306
|
-
|
3307
|
-
|
3335
|
+
othIsArr = isArray(other),
|
3336
|
+
objTag = objIsArr ? arrayTag : getTag(object),
|
3337
|
+
othTag = othIsArr ? arrayTag : getTag(other);
|
3308
3338
|
|
3309
3339
|
objTag = objTag == argsTag ? objectTag : objTag;
|
3310
3340
|
othTag = othTag == argsTag ? objectTag : othTag;
|
3311
3341
|
|
3312
3342
|
var objIsObj = objTag == objectTag,
|
3313
|
-
|
3314
|
-
|
3343
|
+
othIsObj = othTag == objectTag,
|
3344
|
+
isSameTag = objTag == othTag;
|
3315
3345
|
|
3316
3346
|
if (isSameTag && isBuffer(object)) {
|
3317
3347
|
if (!isBuffer(other)) {
|
@@ -3328,11 +3358,11 @@
|
|
3328
3358
|
}
|
3329
3359
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
3330
3360
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
3331
|
-
|
3361
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
3332
3362
|
|
3333
3363
|
if (objIsWrapped || othIsWrapped) {
|
3334
3364
|
var objUnwrapped = objIsWrapped ? object.value() : object,
|
3335
|
-
|
3365
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
3336
3366
|
|
3337
3367
|
stack || (stack = new Stack);
|
3338
3368
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
@@ -3368,8 +3398,8 @@
|
|
3368
3398
|
*/
|
3369
3399
|
function baseIsMatch(object, source, matchData, customizer) {
|
3370
3400
|
var index = matchData.length,
|
3371
|
-
|
3372
|
-
|
3401
|
+
length = index,
|
3402
|
+
noCustomizer = !customizer;
|
3373
3403
|
|
3374
3404
|
if (object == null) {
|
3375
3405
|
return !length;
|
@@ -3378,17 +3408,17 @@
|
|
3378
3408
|
while (index--) {
|
3379
3409
|
var data = matchData[index];
|
3380
3410
|
if ((noCustomizer && data[2])
|
3381
|
-
|
3382
|
-
|
3383
|
-
|
3411
|
+
? data[1] !== object[data[0]]
|
3412
|
+
: !(data[0] in object)
|
3413
|
+
) {
|
3384
3414
|
return false;
|
3385
3415
|
}
|
3386
3416
|
}
|
3387
3417
|
while (++index < length) {
|
3388
3418
|
data = matchData[index];
|
3389
3419
|
var key = data[0],
|
3390
|
-
|
3391
|
-
|
3420
|
+
objValue = object[key],
|
3421
|
+
srcValue = data[1];
|
3392
3422
|
|
3393
3423
|
if (noCustomizer && data[2]) {
|
3394
3424
|
if (objValue === undefined && !(key in object)) {
|
@@ -3400,9 +3430,9 @@
|
|
3400
3430
|
var result = customizer(objValue, srcValue, key, object, source, stack);
|
3401
3431
|
}
|
3402
3432
|
if (!(result === undefined
|
3403
|
-
|
3404
|
-
|
3405
|
-
|
3433
|
+
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
|
3434
|
+
: result
|
3435
|
+
)) {
|
3406
3436
|
return false;
|
3407
3437
|
}
|
3408
3438
|
}
|
@@ -3516,7 +3546,7 @@
|
|
3516
3546
|
return nativeKeysIn(object);
|
3517
3547
|
}
|
3518
3548
|
var isProto = isPrototype(object),
|
3519
|
-
|
3549
|
+
result = [];
|
3520
3550
|
|
3521
3551
|
for (var key in object) {
|
3522
3552
|
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
@@ -3549,7 +3579,7 @@
|
|
3549
3579
|
*/
|
3550
3580
|
function baseMap(collection, iteratee) {
|
3551
3581
|
var index = -1,
|
3552
|
-
|
3582
|
+
result = isArrayLike(collection) ? Array(collection.length) : [];
|
3553
3583
|
|
3554
3584
|
baseEach(collection, function(value, key, collection) {
|
3555
3585
|
result[++index] = iteratee(value, key, collection);
|
@@ -3610,8 +3640,8 @@
|
|
3610
3640
|
return;
|
3611
3641
|
}
|
3612
3642
|
baseFor(source, function(srcValue, key) {
|
3643
|
+
stack || (stack = new Stack);
|
3613
3644
|
if (isObject(srcValue)) {
|
3614
|
-
stack || (stack = new Stack);
|
3615
3645
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
3616
3646
|
}
|
3617
3647
|
else {
|
@@ -3644,8 +3674,8 @@
|
|
3644
3674
|
*/
|
3645
3675
|
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
3646
3676
|
var objValue = safeGet(object, key),
|
3647
|
-
|
3648
|
-
|
3677
|
+
srcValue = safeGet(source, key),
|
3678
|
+
stacked = stack.get(srcValue);
|
3649
3679
|
|
3650
3680
|
if (stacked) {
|
3651
3681
|
assignMergeValue(object, key, stacked);
|
@@ -3659,8 +3689,8 @@
|
|
3659
3689
|
|
3660
3690
|
if (isCommon) {
|
3661
3691
|
var isArr = isArray(srcValue),
|
3662
|
-
|
3663
|
-
|
3692
|
+
isBuff = !isArr && isBuffer(srcValue),
|
3693
|
+
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
3664
3694
|
|
3665
3695
|
newValue = srcValue;
|
3666
3696
|
if (isArr || isBuff || isTyped) {
|
@@ -3687,7 +3717,7 @@
|
|
3687
3717
|
if (isArguments(objValue)) {
|
3688
3718
|
newValue = toPlainObject(objValue);
|
3689
3719
|
}
|
3690
|
-
else if (!isObject(objValue) ||
|
3720
|
+
else if (!isObject(objValue) || isFunction(objValue)) {
|
3691
3721
|
newValue = initCloneObject(srcValue);
|
3692
3722
|
}
|
3693
3723
|
}
|
@@ -3731,8 +3761,21 @@
|
|
3731
3761
|
* @returns {Array} Returns the new sorted array.
|
3732
3762
|
*/
|
3733
3763
|
function baseOrderBy(collection, iteratees, orders) {
|
3764
|
+
if (iteratees.length) {
|
3765
|
+
iteratees = arrayMap(iteratees, function(iteratee) {
|
3766
|
+
if (isArray(iteratee)) {
|
3767
|
+
return function(value) {
|
3768
|
+
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
3769
|
+
}
|
3770
|
+
}
|
3771
|
+
return iteratee;
|
3772
|
+
});
|
3773
|
+
} else {
|
3774
|
+
iteratees = [identity];
|
3775
|
+
}
|
3776
|
+
|
3734
3777
|
var index = -1;
|
3735
|
-
iteratees = arrayMap(iteratees
|
3778
|
+
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
3736
3779
|
|
3737
3780
|
var result = baseMap(collection, function(value, key, collection) {
|
3738
3781
|
var criteria = arrayMap(iteratees, function(iteratee) {
|
@@ -3772,12 +3815,12 @@
|
|
3772
3815
|
*/
|
3773
3816
|
function basePickBy(object, paths, predicate) {
|
3774
3817
|
var index = -1,
|
3775
|
-
|
3776
|
-
|
3818
|
+
length = paths.length,
|
3819
|
+
result = {};
|
3777
3820
|
|
3778
3821
|
while (++index < length) {
|
3779
3822
|
var path = paths[index],
|
3780
|
-
|
3823
|
+
value = baseGet(object, path);
|
3781
3824
|
|
3782
3825
|
if (predicate(value, path)) {
|
3783
3826
|
baseSet(result, castPath(path, object), value);
|
@@ -3812,9 +3855,9 @@
|
|
3812
3855
|
*/
|
3813
3856
|
function basePullAll(array, values, iteratee, comparator) {
|
3814
3857
|
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
|
3815
|
-
|
3816
|
-
|
3817
|
-
|
3858
|
+
index = -1,
|
3859
|
+
length = values.length,
|
3860
|
+
seen = array;
|
3818
3861
|
|
3819
3862
|
if (array === values) {
|
3820
3863
|
values = copyArray(values);
|
@@ -3824,8 +3867,8 @@
|
|
3824
3867
|
}
|
3825
3868
|
while (++index < length) {
|
3826
3869
|
var fromIndex = 0,
|
3827
|
-
|
3828
|
-
|
3870
|
+
value = values[index],
|
3871
|
+
computed = iteratee ? iteratee(value) : value;
|
3829
3872
|
|
3830
3873
|
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
|
3831
3874
|
if (seen !== array) {
|
@@ -3848,7 +3891,7 @@
|
|
3848
3891
|
*/
|
3849
3892
|
function basePullAt(array, indexes) {
|
3850
3893
|
var length = array ? indexes.length : 0,
|
3851
|
-
|
3894
|
+
lastIndex = length - 1;
|
3852
3895
|
|
3853
3896
|
while (length--) {
|
3854
3897
|
var index = indexes[length];
|
@@ -3890,8 +3933,8 @@
|
|
3890
3933
|
*/
|
3891
3934
|
function baseRange(start, end, step, fromRight) {
|
3892
3935
|
var index = -1,
|
3893
|
-
|
3894
|
-
|
3936
|
+
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
|
3937
|
+
result = Array(length);
|
3895
3938
|
|
3896
3939
|
while (length--) {
|
3897
3940
|
result[fromRight ? length : ++index] = start;
|
@@ -3981,13 +4024,17 @@
|
|
3981
4024
|
path = castPath(path, object);
|
3982
4025
|
|
3983
4026
|
var index = -1,
|
3984
|
-
|
3985
|
-
|
3986
|
-
|
4027
|
+
length = path.length,
|
4028
|
+
lastIndex = length - 1,
|
4029
|
+
nested = object;
|
3987
4030
|
|
3988
4031
|
while (nested != null && ++index < length) {
|
3989
4032
|
var key = toKey(path[index]),
|
3990
|
-
|
4033
|
+
newValue = value;
|
4034
|
+
|
4035
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
4036
|
+
return object;
|
4037
|
+
}
|
3991
4038
|
|
3992
4039
|
if (index != lastIndex) {
|
3993
4040
|
var objValue = nested[key];
|
@@ -4056,7 +4103,7 @@
|
|
4056
4103
|
*/
|
4057
4104
|
function baseSlice(array, start, end) {
|
4058
4105
|
var index = -1,
|
4059
|
-
|
4106
|
+
length = array.length;
|
4060
4107
|
|
4061
4108
|
if (start < 0) {
|
4062
4109
|
start = -start > length ? 0 : (length + start);
|
@@ -4108,15 +4155,15 @@
|
|
4108
4155
|
*/
|
4109
4156
|
function baseSortedIndex(array, value, retHighest) {
|
4110
4157
|
var low = 0,
|
4111
|
-
|
4158
|
+
high = array == null ? low : array.length;
|
4112
4159
|
|
4113
4160
|
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
4114
4161
|
while (low < high) {
|
4115
4162
|
var mid = (low + high) >>> 1,
|
4116
|
-
|
4163
|
+
computed = array[mid];
|
4117
4164
|
|
4118
4165
|
if (computed !== null && !isSymbol(computed) &&
|
4119
|
-
|
4166
|
+
(retHighest ? (computed <= value) : (computed < value))) {
|
4120
4167
|
low = mid + 1;
|
4121
4168
|
} else {
|
4122
4169
|
high = mid;
|
@@ -4141,22 +4188,25 @@
|
|
4141
4188
|
* into `array`.
|
4142
4189
|
*/
|
4143
4190
|
function baseSortedIndexBy(array, value, iteratee, retHighest) {
|
4144
|
-
value = iteratee(value);
|
4145
|
-
|
4146
4191
|
var low = 0,
|
4147
|
-
|
4148
|
-
|
4149
|
-
|
4150
|
-
|
4151
|
-
|
4192
|
+
high = array == null ? 0 : array.length;
|
4193
|
+
if (high === 0) {
|
4194
|
+
return 0;
|
4195
|
+
}
|
4196
|
+
|
4197
|
+
value = iteratee(value);
|
4198
|
+
var valIsNaN = value !== value,
|
4199
|
+
valIsNull = value === null,
|
4200
|
+
valIsSymbol = isSymbol(value),
|
4201
|
+
valIsUndefined = value === undefined;
|
4152
4202
|
|
4153
4203
|
while (low < high) {
|
4154
4204
|
var mid = nativeFloor((low + high) / 2),
|
4155
|
-
|
4156
|
-
|
4157
|
-
|
4158
|
-
|
4159
|
-
|
4205
|
+
computed = iteratee(array[mid]),
|
4206
|
+
othIsDefined = computed !== undefined,
|
4207
|
+
othIsNull = computed === null,
|
4208
|
+
othIsReflexive = computed === computed,
|
4209
|
+
othIsSymbol = isSymbol(computed);
|
4160
4210
|
|
4161
4211
|
if (valIsNaN) {
|
4162
4212
|
var setLow = retHighest || othIsReflexive;
|
@@ -4191,13 +4241,13 @@
|
|
4191
4241
|
*/
|
4192
4242
|
function baseSortedUniq(array, iteratee) {
|
4193
4243
|
var index = -1,
|
4194
|
-
|
4195
|
-
|
4196
|
-
|
4244
|
+
length = array.length,
|
4245
|
+
resIndex = 0,
|
4246
|
+
result = [];
|
4197
4247
|
|
4198
4248
|
while (++index < length) {
|
4199
4249
|
var value = array[index],
|
4200
|
-
|
4250
|
+
computed = iteratee ? iteratee(value) : value;
|
4201
4251
|
|
4202
4252
|
if (!index || !eq(computed, seen)) {
|
4203
4253
|
var seen = computed;
|
@@ -4260,11 +4310,11 @@
|
|
4260
4310
|
*/
|
4261
4311
|
function baseUniq(array, iteratee, comparator) {
|
4262
4312
|
var index = -1,
|
4263
|
-
|
4264
|
-
|
4265
|
-
|
4266
|
-
|
4267
|
-
|
4313
|
+
includes = arrayIncludes,
|
4314
|
+
length = array.length,
|
4315
|
+
isCommon = true,
|
4316
|
+
result = [],
|
4317
|
+
seen = result;
|
4268
4318
|
|
4269
4319
|
if (comparator) {
|
4270
4320
|
isCommon = false;
|
@@ -4283,30 +4333,30 @@
|
|
4283
4333
|
seen = iteratee ? [] : result;
|
4284
4334
|
}
|
4285
4335
|
outer:
|
4286
|
-
|
4287
|
-
|
4336
|
+
while (++index < length) {
|
4337
|
+
var value = array[index],
|
4288
4338
|
computed = iteratee ? iteratee(value) : value;
|
4289
4339
|
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4294
|
-
|
4295
|
-
|
4340
|
+
value = (comparator || value !== 0) ? value : 0;
|
4341
|
+
if (isCommon && computed === computed) {
|
4342
|
+
var seenIndex = seen.length;
|
4343
|
+
while (seenIndex--) {
|
4344
|
+
if (seen[seenIndex] === computed) {
|
4345
|
+
continue outer;
|
4346
|
+
}
|
4296
4347
|
}
|
4348
|
+
if (iteratee) {
|
4349
|
+
seen.push(computed);
|
4350
|
+
}
|
4351
|
+
result.push(value);
|
4297
4352
|
}
|
4298
|
-
if (
|
4299
|
-
seen
|
4300
|
-
|
4301
|
-
|
4302
|
-
|
4303
|
-
else if (!includes(seen, computed, comparator)) {
|
4304
|
-
if (seen !== result) {
|
4305
|
-
seen.push(computed);
|
4353
|
+
else if (!includes(seen, computed, comparator)) {
|
4354
|
+
if (seen !== result) {
|
4355
|
+
seen.push(computed);
|
4356
|
+
}
|
4357
|
+
result.push(value);
|
4306
4358
|
}
|
4307
|
-
result.push(value);
|
4308
4359
|
}
|
4309
|
-
}
|
4310
4360
|
return result;
|
4311
4361
|
}
|
4312
4362
|
|
@@ -4351,10 +4401,10 @@
|
|
4351
4401
|
*/
|
4352
4402
|
function baseWhile(array, predicate, isDrop, fromRight) {
|
4353
4403
|
var length = array.length,
|
4354
|
-
|
4404
|
+
index = fromRight ? length : -1;
|
4355
4405
|
|
4356
4406
|
while ((fromRight ? index-- : ++index < length) &&
|
4357
|
-
|
4407
|
+
predicate(array[index], index, array)) {}
|
4358
4408
|
|
4359
4409
|
return isDrop
|
4360
4410
|
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
|
@@ -4397,11 +4447,11 @@
|
|
4397
4447
|
return length ? baseUniq(arrays[0]) : [];
|
4398
4448
|
}
|
4399
4449
|
var index = -1,
|
4400
|
-
|
4450
|
+
result = Array(length);
|
4401
4451
|
|
4402
4452
|
while (++index < length) {
|
4403
4453
|
var array = arrays[index],
|
4404
|
-
|
4454
|
+
othIndex = -1;
|
4405
4455
|
|
4406
4456
|
while (++othIndex < length) {
|
4407
4457
|
if (othIndex != index) {
|
@@ -4423,9 +4473,9 @@
|
|
4423
4473
|
*/
|
4424
4474
|
function baseZipObject(props, values, assignFunc) {
|
4425
4475
|
var index = -1,
|
4426
|
-
|
4427
|
-
|
4428
|
-
|
4476
|
+
length = props.length,
|
4477
|
+
valsLength = values.length,
|
4478
|
+
result = {};
|
4429
4479
|
|
4430
4480
|
while (++index < length) {
|
4431
4481
|
var value = index < valsLength ? values[index] : undefined;
|
@@ -4520,7 +4570,7 @@
|
|
4520
4570
|
return buffer.slice();
|
4521
4571
|
}
|
4522
4572
|
var length = buffer.length,
|
4523
|
-
|
4573
|
+
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
4524
4574
|
|
4525
4575
|
buffer.copy(result);
|
4526
4576
|
return result;
|
@@ -4600,27 +4650,27 @@
|
|
4600
4650
|
function compareAscending(value, other) {
|
4601
4651
|
if (value !== other) {
|
4602
4652
|
var valIsDefined = value !== undefined,
|
4603
|
-
|
4604
|
-
|
4605
|
-
|
4653
|
+
valIsNull = value === null,
|
4654
|
+
valIsReflexive = value === value,
|
4655
|
+
valIsSymbol = isSymbol(value);
|
4606
4656
|
|
4607
4657
|
var othIsDefined = other !== undefined,
|
4608
|
-
|
4609
|
-
|
4610
|
-
|
4658
|
+
othIsNull = other === null,
|
4659
|
+
othIsReflexive = other === other,
|
4660
|
+
othIsSymbol = isSymbol(other);
|
4611
4661
|
|
4612
4662
|
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
4613
|
-
|
4614
|
-
|
4615
|
-
|
4616
|
-
|
4663
|
+
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
4664
|
+
(valIsNull && othIsDefined && othIsReflexive) ||
|
4665
|
+
(!valIsDefined && othIsReflexive) ||
|
4666
|
+
!valIsReflexive) {
|
4617
4667
|
return 1;
|
4618
4668
|
}
|
4619
4669
|
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
4620
|
-
|
4621
|
-
|
4622
|
-
|
4623
|
-
|
4670
|
+
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
4671
|
+
(othIsNull && valIsDefined && valIsReflexive) ||
|
4672
|
+
(!othIsDefined && valIsReflexive) ||
|
4673
|
+
!othIsReflexive) {
|
4624
4674
|
return -1;
|
4625
4675
|
}
|
4626
4676
|
}
|
@@ -4643,10 +4693,10 @@
|
|
4643
4693
|
*/
|
4644
4694
|
function compareMultiple(object, other, orders) {
|
4645
4695
|
var index = -1,
|
4646
|
-
|
4647
|
-
|
4648
|
-
|
4649
|
-
|
4696
|
+
objCriteria = object.criteria,
|
4697
|
+
othCriteria = other.criteria,
|
4698
|
+
length = objCriteria.length,
|
4699
|
+
ordersLength = orders.length;
|
4650
4700
|
|
4651
4701
|
while (++index < length) {
|
4652
4702
|
var result = compareAscending(objCriteria[index], othCriteria[index]);
|
@@ -4681,13 +4731,13 @@
|
|
4681
4731
|
*/
|
4682
4732
|
function composeArgs(args, partials, holders, isCurried) {
|
4683
4733
|
var argsIndex = -1,
|
4684
|
-
|
4685
|
-
|
4686
|
-
|
4687
|
-
|
4688
|
-
|
4689
|
-
|
4690
|
-
|
4734
|
+
argsLength = args.length,
|
4735
|
+
holdersLength = holders.length,
|
4736
|
+
leftIndex = -1,
|
4737
|
+
leftLength = partials.length,
|
4738
|
+
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
4739
|
+
result = Array(leftLength + rangeLength),
|
4740
|
+
isUncurried = !isCurried;
|
4691
4741
|
|
4692
4742
|
while (++leftIndex < leftLength) {
|
4693
4743
|
result[leftIndex] = partials[leftIndex];
|
@@ -4716,14 +4766,14 @@
|
|
4716
4766
|
*/
|
4717
4767
|
function composeArgsRight(args, partials, holders, isCurried) {
|
4718
4768
|
var argsIndex = -1,
|
4719
|
-
|
4720
|
-
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4769
|
+
argsLength = args.length,
|
4770
|
+
holdersIndex = -1,
|
4771
|
+
holdersLength = holders.length,
|
4772
|
+
rightIndex = -1,
|
4773
|
+
rightLength = partials.length,
|
4774
|
+
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
4775
|
+
result = Array(rangeLength + rightLength),
|
4776
|
+
isUncurried = !isCurried;
|
4727
4777
|
|
4728
4778
|
while (++argsIndex < rangeLength) {
|
4729
4779
|
result[argsIndex] = args[argsIndex];
|
@@ -4750,7 +4800,7 @@
|
|
4750
4800
|
*/
|
4751
4801
|
function copyArray(source, array) {
|
4752
4802
|
var index = -1,
|
4753
|
-
|
4803
|
+
length = source.length;
|
4754
4804
|
|
4755
4805
|
array || (array = Array(length));
|
4756
4806
|
while (++index < length) {
|
@@ -4774,7 +4824,7 @@
|
|
4774
4824
|
object || (object = {});
|
4775
4825
|
|
4776
4826
|
var index = -1,
|
4777
|
-
|
4827
|
+
length = props.length;
|
4778
4828
|
|
4779
4829
|
while (++index < length) {
|
4780
4830
|
var key = props[index];
|
@@ -4830,7 +4880,7 @@
|
|
4830
4880
|
function createAggregator(setter, initializer) {
|
4831
4881
|
return function(collection, iteratee) {
|
4832
4882
|
var func = isArray(collection) ? arrayAggregator : baseAggregator,
|
4833
|
-
|
4883
|
+
accumulator = initializer ? initializer() : {};
|
4834
4884
|
|
4835
4885
|
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
|
4836
4886
|
};
|
@@ -4846,9 +4896,9 @@
|
|
4846
4896
|
function createAssigner(assigner) {
|
4847
4897
|
return baseRest(function(object, sources) {
|
4848
4898
|
var index = -1,
|
4849
|
-
|
4850
|
-
|
4851
|
-
|
4899
|
+
length = sources.length,
|
4900
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
4901
|
+
guard = length > 2 ? sources[2] : undefined;
|
4852
4902
|
|
4853
4903
|
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
4854
4904
|
? (length--, customizer)
|
@@ -4886,8 +4936,8 @@
|
|
4886
4936
|
return eachFunc(collection, iteratee);
|
4887
4937
|
}
|
4888
4938
|
var length = collection.length,
|
4889
|
-
|
4890
|
-
|
4939
|
+
index = fromRight ? length : -1,
|
4940
|
+
iterable = Object(collection);
|
4891
4941
|
|
4892
4942
|
while ((fromRight ? index-- : ++index < length)) {
|
4893
4943
|
if (iteratee(iterable[index], index, iterable) === false) {
|
@@ -4908,9 +4958,9 @@
|
|
4908
4958
|
function createBaseFor(fromRight) {
|
4909
4959
|
return function(object, iteratee, keysFunc) {
|
4910
4960
|
var index = -1,
|
4911
|
-
|
4912
|
-
|
4913
|
-
|
4961
|
+
iterable = Object(object),
|
4962
|
+
props = keysFunc(object),
|
4963
|
+
length = props.length;
|
4914
4964
|
|
4915
4965
|
while (length--) {
|
4916
4966
|
var key = props[fromRight ? length : ++index];
|
@@ -4934,7 +4984,7 @@
|
|
4934
4984
|
*/
|
4935
4985
|
function createBind(func, bitmask, thisArg) {
|
4936
4986
|
var isBind = bitmask & WRAP_BIND_FLAG,
|
4937
|
-
|
4987
|
+
Ctor = createCtor(func);
|
4938
4988
|
|
4939
4989
|
function wrapper() {
|
4940
4990
|
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
@@ -5008,7 +5058,7 @@
|
|
5008
5058
|
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
5009
5059
|
}
|
5010
5060
|
var thisBinding = baseCreate(Ctor.prototype),
|
5011
|
-
|
5061
|
+
result = Ctor.apply(thisBinding, args);
|
5012
5062
|
|
5013
5063
|
// Mimic the constructor's `return` behavior.
|
5014
5064
|
// See https://es5.github.io/#x13.2.2 for more details.
|
@@ -5030,9 +5080,9 @@
|
|
5030
5080
|
|
5031
5081
|
function wrapper() {
|
5032
5082
|
var length = arguments.length,
|
5033
|
-
|
5034
|
-
|
5035
|
-
|
5083
|
+
args = Array(length),
|
5084
|
+
index = length,
|
5085
|
+
placeholder = getHolder(wrapper);
|
5036
5086
|
|
5037
5087
|
while (index--) {
|
5038
5088
|
args[index] = arguments[index];
|
@@ -5083,8 +5133,8 @@
|
|
5083
5133
|
function createFlow(fromRight) {
|
5084
5134
|
return flatRest(function(funcs) {
|
5085
5135
|
var length = funcs.length,
|
5086
|
-
|
5087
|
-
|
5136
|
+
index = length,
|
5137
|
+
prereq = LodashWrapper.prototype.thru;
|
5088
5138
|
|
5089
5139
|
if (fromRight) {
|
5090
5140
|
funcs.reverse();
|
@@ -5103,12 +5153,12 @@
|
|
5103
5153
|
func = funcs[index];
|
5104
5154
|
|
5105
5155
|
var funcName = getFuncName(func),
|
5106
|
-
|
5156
|
+
data = funcName == 'wrapper' ? getData(func) : undefined;
|
5107
5157
|
|
5108
5158
|
if (data && isLaziable(data[0]) &&
|
5109
|
-
|
5110
|
-
|
5111
|
-
|
5159
|
+
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
|
5160
|
+
!data[4].length && data[9] == 1
|
5161
|
+
) {
|
5112
5162
|
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
5113
5163
|
} else {
|
5114
5164
|
wrapper = (func.length == 1 && isLaziable(func))
|
@@ -5118,13 +5168,13 @@
|
|
5118
5168
|
}
|
5119
5169
|
return function() {
|
5120
5170
|
var args = arguments,
|
5121
|
-
|
5171
|
+
value = args[0];
|
5122
5172
|
|
5123
5173
|
if (wrapper && args.length == 1 && isArray(value)) {
|
5124
5174
|
return wrapper.plant(value).value();
|
5125
5175
|
}
|
5126
5176
|
var index = 0,
|
5127
|
-
|
5177
|
+
result = length ? funcs[index].apply(this, args) : value;
|
5128
5178
|
|
5129
5179
|
while (++index < length) {
|
5130
5180
|
result = funcs[index].call(this, result);
|
@@ -5155,23 +5205,23 @@
|
|
5155
5205
|
*/
|
5156
5206
|
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
|
5157
5207
|
var isAry = bitmask & WRAP_ARY_FLAG,
|
5158
|
-
|
5159
|
-
|
5160
|
-
|
5161
|
-
|
5162
|
-
|
5208
|
+
isBind = bitmask & WRAP_BIND_FLAG,
|
5209
|
+
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
|
5210
|
+
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
|
5211
|
+
isFlip = bitmask & WRAP_FLIP_FLAG,
|
5212
|
+
Ctor = isBindKey ? undefined : createCtor(func);
|
5163
5213
|
|
5164
5214
|
function wrapper() {
|
5165
5215
|
var length = arguments.length,
|
5166
|
-
|
5167
|
-
|
5216
|
+
args = Array(length),
|
5217
|
+
index = length;
|
5168
5218
|
|
5169
5219
|
while (index--) {
|
5170
5220
|
args[index] = arguments[index];
|
5171
5221
|
}
|
5172
5222
|
if (isCurried) {
|
5173
5223
|
var placeholder = getHolder(wrapper),
|
5174
|
-
|
5224
|
+
holdersCount = countHolders(args, placeholder);
|
5175
5225
|
}
|
5176
5226
|
if (partials) {
|
5177
5227
|
args = composeArgs(args, partials, holders, isCurried);
|
@@ -5188,7 +5238,7 @@
|
|
5188
5238
|
);
|
5189
5239
|
}
|
5190
5240
|
var thisBinding = isBind ? thisArg : this,
|
5191
|
-
|
5241
|
+
fn = isBindKey ? thisBinding[func] : func;
|
5192
5242
|
|
5193
5243
|
length = args.length;
|
5194
5244
|
if (argPos) {
|
@@ -5310,15 +5360,15 @@
|
|
5310
5360
|
*/
|
5311
5361
|
function createPartial(func, bitmask, thisArg, partials) {
|
5312
5362
|
var isBind = bitmask & WRAP_BIND_FLAG,
|
5313
|
-
|
5363
|
+
Ctor = createCtor(func);
|
5314
5364
|
|
5315
5365
|
function wrapper() {
|
5316
5366
|
var argsIndex = -1,
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5367
|
+
argsLength = arguments.length,
|
5368
|
+
leftIndex = -1,
|
5369
|
+
leftLength = partials.length,
|
5370
|
+
args = Array(leftLength + argsLength),
|
5371
|
+
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
5322
5372
|
|
5323
5373
|
while (++leftIndex < leftLength) {
|
5324
5374
|
args[leftIndex] = partials[leftIndex];
|
@@ -5392,10 +5442,10 @@
|
|
5392
5442
|
*/
|
5393
5443
|
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
5394
5444
|
var isCurry = bitmask & WRAP_CURRY_FLAG,
|
5395
|
-
|
5396
|
-
|
5397
|
-
|
5398
|
-
|
5445
|
+
newHolders = isCurry ? holders : undefined,
|
5446
|
+
newHoldersRight = isCurry ? undefined : holders,
|
5447
|
+
newPartials = isCurry ? partials : undefined,
|
5448
|
+
newPartialsRight = isCurry ? undefined : partials;
|
5399
5449
|
|
5400
5450
|
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
|
5401
5451
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
|
@@ -5428,11 +5478,11 @@
|
|
5428
5478
|
return function(number, precision) {
|
5429
5479
|
number = toNumber(number);
|
5430
5480
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
5431
|
-
if (precision) {
|
5481
|
+
if (precision && nativeIsFinite(number)) {
|
5432
5482
|
// Shift with exponential notation to avoid floating-point issues.
|
5433
5483
|
// See [MDN](https://mdn.io/round#Examples) for more details.
|
5434
5484
|
var pair = (toString(number) + 'e').split('e'),
|
5435
|
-
|
5485
|
+
value = func(pair[0] + 'e' + (+pair[1] + precision));
|
5436
5486
|
|
5437
5487
|
pair = (toString(value) + 'e').split('e');
|
5438
5488
|
return +(pair[0] + 'e' + (+pair[1] - precision));
|
@@ -5513,7 +5563,7 @@
|
|
5513
5563
|
|
5514
5564
|
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
|
5515
5565
|
var partialsRight = partials,
|
5516
|
-
|
5566
|
+
holdersRight = holders;
|
5517
5567
|
|
5518
5568
|
partials = holders = undefined;
|
5519
5569
|
}
|
@@ -5566,7 +5616,7 @@
|
|
5566
5616
|
*/
|
5567
5617
|
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
5568
5618
|
if (objValue === undefined ||
|
5569
|
-
|
5619
|
+
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
5570
5620
|
return srcValue;
|
5571
5621
|
}
|
5572
5622
|
return objValue;
|
@@ -5624,20 +5674,21 @@
|
|
5624
5674
|
*/
|
5625
5675
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
5626
5676
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
5627
|
-
|
5628
|
-
|
5677
|
+
arrLength = array.length,
|
5678
|
+
othLength = other.length;
|
5629
5679
|
|
5630
5680
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
5631
5681
|
return false;
|
5632
5682
|
}
|
5633
|
-
//
|
5634
|
-
var
|
5635
|
-
|
5636
|
-
|
5683
|
+
// Check that cyclic values are equal.
|
5684
|
+
var arrStacked = stack.get(array);
|
5685
|
+
var othStacked = stack.get(other);
|
5686
|
+
if (arrStacked && othStacked) {
|
5687
|
+
return arrStacked == other && othStacked == array;
|
5637
5688
|
}
|
5638
5689
|
var index = -1,
|
5639
|
-
|
5640
|
-
|
5690
|
+
result = true,
|
5691
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
|
5641
5692
|
|
5642
5693
|
stack.set(array, other);
|
5643
5694
|
stack.set(other, array);
|
@@ -5645,7 +5696,7 @@
|
|
5645
5696
|
// Ignore non-index properties.
|
5646
5697
|
while (++index < arrLength) {
|
5647
5698
|
var arrValue = array[index],
|
5648
|
-
|
5699
|
+
othValue = other[index];
|
5649
5700
|
|
5650
5701
|
if (customizer) {
|
5651
5702
|
var compared = isPartial
|
@@ -5662,18 +5713,18 @@
|
|
5662
5713
|
// Recursively compare arrays (susceptible to call stack limits).
|
5663
5714
|
if (seen) {
|
5664
5715
|
if (!arraySome(other, function(othValue, othIndex) {
|
5665
|
-
|
5666
|
-
|
5667
|
-
|
5668
|
-
|
5669
|
-
|
5716
|
+
if (!cacheHas(seen, othIndex) &&
|
5717
|
+
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
5718
|
+
return seen.push(othIndex);
|
5719
|
+
}
|
5720
|
+
})) {
|
5670
5721
|
result = false;
|
5671
5722
|
break;
|
5672
5723
|
}
|
5673
5724
|
} else if (!(
|
5674
|
-
|
5675
|
-
|
5676
|
-
|
5725
|
+
arrValue === othValue ||
|
5726
|
+
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
5727
|
+
)) {
|
5677
5728
|
result = false;
|
5678
5729
|
break;
|
5679
5730
|
}
|
@@ -5704,7 +5755,7 @@
|
|
5704
5755
|
switch (tag) {
|
5705
5756
|
case dataViewTag:
|
5706
5757
|
if ((object.byteLength != other.byteLength) ||
|
5707
|
-
|
5758
|
+
(object.byteOffset != other.byteOffset)) {
|
5708
5759
|
return false;
|
5709
5760
|
}
|
5710
5761
|
object = object.buffer;
|
@@ -5712,7 +5763,7 @@
|
|
5712
5763
|
|
5713
5764
|
case arrayBufferTag:
|
5714
5765
|
if ((object.byteLength != other.byteLength) ||
|
5715
|
-
|
5766
|
+
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
5716
5767
|
return false;
|
5717
5768
|
}
|
5718
5769
|
return true;
|
@@ -5780,10 +5831,10 @@
|
|
5780
5831
|
*/
|
5781
5832
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
5782
5833
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
5783
|
-
|
5784
|
-
|
5785
|
-
|
5786
|
-
|
5834
|
+
objProps = getAllKeys(object),
|
5835
|
+
objLength = objProps.length,
|
5836
|
+
othProps = getAllKeys(other),
|
5837
|
+
othLength = othProps.length;
|
5787
5838
|
|
5788
5839
|
if (objLength != othLength && !isPartial) {
|
5789
5840
|
return false;
|
@@ -5795,10 +5846,11 @@
|
|
5795
5846
|
return false;
|
5796
5847
|
}
|
5797
5848
|
}
|
5798
|
-
//
|
5799
|
-
var
|
5800
|
-
|
5801
|
-
|
5849
|
+
// Check that cyclic values are equal.
|
5850
|
+
var objStacked = stack.get(object);
|
5851
|
+
var othStacked = stack.get(other);
|
5852
|
+
if (objStacked && othStacked) {
|
5853
|
+
return objStacked == other && othStacked == object;
|
5802
5854
|
}
|
5803
5855
|
var result = true;
|
5804
5856
|
stack.set(object, other);
|
@@ -5808,7 +5860,7 @@
|
|
5808
5860
|
while (++index < objLength) {
|
5809
5861
|
key = objProps[index];
|
5810
5862
|
var objValue = object[key],
|
5811
|
-
|
5863
|
+
othValue = other[key];
|
5812
5864
|
|
5813
5865
|
if (customizer) {
|
5814
5866
|
var compared = isPartial
|
@@ -5817,9 +5869,9 @@
|
|
5817
5869
|
}
|
5818
5870
|
// Recursively compare objects (susceptible to call stack limits).
|
5819
5871
|
if (!(compared === undefined
|
5820
|
-
|
5821
|
-
|
5822
|
-
|
5872
|
+
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
5873
|
+
: compared
|
5874
|
+
)) {
|
5823
5875
|
result = false;
|
5824
5876
|
break;
|
5825
5877
|
}
|
@@ -5827,13 +5879,13 @@
|
|
5827
5879
|
}
|
5828
5880
|
if (result && !skipCtor) {
|
5829
5881
|
var objCtor = object.constructor,
|
5830
|
-
|
5882
|
+
othCtor = other.constructor;
|
5831
5883
|
|
5832
5884
|
// Non `Object` object instances with different constructors are not equal.
|
5833
5885
|
if (objCtor != othCtor &&
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5886
|
+
('constructor' in object && 'constructor' in other) &&
|
5887
|
+
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
5888
|
+
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
5837
5889
|
result = false;
|
5838
5890
|
}
|
5839
5891
|
}
|
@@ -5896,12 +5948,12 @@
|
|
5896
5948
|
*/
|
5897
5949
|
function getFuncName(func) {
|
5898
5950
|
var result = (func.name + ''),
|
5899
|
-
|
5900
|
-
|
5951
|
+
array = realNames[result],
|
5952
|
+
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
|
5901
5953
|
|
5902
5954
|
while (length--) {
|
5903
5955
|
var data = array[length],
|
5904
|
-
|
5956
|
+
otherFunc = data.func;
|
5905
5957
|
if (otherFunc == null || otherFunc == func) {
|
5906
5958
|
return data.name;
|
5907
5959
|
}
|
@@ -5962,11 +6014,11 @@
|
|
5962
6014
|
*/
|
5963
6015
|
function getMatchData(object) {
|
5964
6016
|
var result = keys(object),
|
5965
|
-
|
6017
|
+
length = result.length;
|
5966
6018
|
|
5967
6019
|
while (length--) {
|
5968
6020
|
var key = result[length],
|
5969
|
-
|
6021
|
+
value = object[key];
|
5970
6022
|
|
5971
6023
|
result[length] = [key, value, isStrictComparable(value)];
|
5972
6024
|
}
|
@@ -5995,7 +6047,7 @@
|
|
5995
6047
|
*/
|
5996
6048
|
function getRawTag(value) {
|
5997
6049
|
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
5998
|
-
|
6050
|
+
tag = value[symToStringTag];
|
5999
6051
|
|
6000
6052
|
try {
|
6001
6053
|
value[symToStringTag] = undefined;
|
@@ -6057,14 +6109,14 @@
|
|
6057
6109
|
|
6058
6110
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
6059
6111
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
6060
|
-
|
6061
|
-
|
6062
|
-
|
6063
|
-
|
6112
|
+
(Map && getTag(new Map) != mapTag) ||
|
6113
|
+
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
6114
|
+
(Set && getTag(new Set) != setTag) ||
|
6115
|
+
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
6064
6116
|
getTag = function(value) {
|
6065
6117
|
var result = baseGetTag(value),
|
6066
|
-
|
6067
|
-
|
6118
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
6119
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
6068
6120
|
|
6069
6121
|
if (ctorString) {
|
6070
6122
|
switch (ctorString) {
|
@@ -6091,11 +6143,11 @@
|
|
6091
6143
|
*/
|
6092
6144
|
function getView(start, end, transforms) {
|
6093
6145
|
var index = -1,
|
6094
|
-
|
6146
|
+
length = transforms.length;
|
6095
6147
|
|
6096
6148
|
while (++index < length) {
|
6097
6149
|
var data = transforms[index],
|
6098
|
-
|
6150
|
+
size = data.size;
|
6099
6151
|
|
6100
6152
|
switch (data.type) {
|
6101
6153
|
case 'drop': start += size; break;
|
@@ -6132,8 +6184,8 @@
|
|
6132
6184
|
path = castPath(path, object);
|
6133
6185
|
|
6134
6186
|
var index = -1,
|
6135
|
-
|
6136
|
-
|
6187
|
+
length = path.length,
|
6188
|
+
result = false;
|
6137
6189
|
|
6138
6190
|
while (++index < length) {
|
6139
6191
|
var key = toKey(path[index]);
|
@@ -6159,7 +6211,7 @@
|
|
6159
6211
|
*/
|
6160
6212
|
function initCloneArray(array) {
|
6161
6213
|
var length = array.length,
|
6162
|
-
|
6214
|
+
result = new array.constructor(length);
|
6163
6215
|
|
6164
6216
|
// Add properties assigned by `RegExp#exec`.
|
6165
6217
|
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
@@ -6276,7 +6328,7 @@
|
|
6276
6328
|
return !!length &&
|
6277
6329
|
(type == 'number' ||
|
6278
6330
|
(type != 'symbol' && reIsUint.test(value))) &&
|
6279
|
-
|
6331
|
+
(value > -1 && value % 1 == 0 && value < length);
|
6280
6332
|
}
|
6281
6333
|
|
6282
6334
|
/**
|
@@ -6295,9 +6347,9 @@
|
|
6295
6347
|
}
|
6296
6348
|
var type = typeof index;
|
6297
6349
|
if (type == 'number'
|
6298
|
-
|
6299
|
-
|
6300
|
-
|
6350
|
+
? (isArrayLike(object) && isIndex(index, object.length))
|
6351
|
+
: (type == 'string' && index in object)
|
6352
|
+
) {
|
6301
6353
|
return eq(object[index], value);
|
6302
6354
|
}
|
6303
6355
|
return false;
|
@@ -6317,7 +6369,7 @@
|
|
6317
6369
|
}
|
6318
6370
|
var type = typeof value;
|
6319
6371
|
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
6320
|
-
|
6372
|
+
value == null || isSymbol(value)) {
|
6321
6373
|
return true;
|
6322
6374
|
}
|
6323
6375
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
@@ -6348,7 +6400,7 @@
|
|
6348
6400
|
*/
|
6349
6401
|
function isLaziable(func) {
|
6350
6402
|
var funcName = getFuncName(func),
|
6351
|
-
|
6403
|
+
other = lodash[funcName];
|
6352
6404
|
|
6353
6405
|
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
|
6354
6406
|
return false;
|
@@ -6389,7 +6441,7 @@
|
|
6389
6441
|
*/
|
6390
6442
|
function isPrototype(value) {
|
6391
6443
|
var Ctor = value && value.constructor,
|
6392
|
-
|
6444
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
6393
6445
|
|
6394
6446
|
return value === proto;
|
6395
6447
|
}
|
@@ -6463,9 +6515,9 @@
|
|
6463
6515
|
*/
|
6464
6516
|
function mergeData(data, source) {
|
6465
6517
|
var bitmask = data[1],
|
6466
|
-
|
6467
|
-
|
6468
|
-
|
6518
|
+
srcBitmask = source[1],
|
6519
|
+
newBitmask = bitmask | srcBitmask,
|
6520
|
+
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
|
6469
6521
|
|
6470
6522
|
var isCombo =
|
6471
6523
|
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
|
@@ -6559,9 +6611,9 @@
|
|
6559
6611
|
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
6560
6612
|
return function() {
|
6561
6613
|
var args = arguments,
|
6562
|
-
|
6563
|
-
|
6564
|
-
|
6614
|
+
index = -1,
|
6615
|
+
length = nativeMax(args.length - start, 0),
|
6616
|
+
array = Array(length);
|
6565
6617
|
|
6566
6618
|
while (++index < length) {
|
6567
6619
|
array[index] = args[start + index];
|
@@ -6600,8 +6652,8 @@
|
|
6600
6652
|
*/
|
6601
6653
|
function reorder(array, indexes) {
|
6602
6654
|
var arrLength = array.length,
|
6603
|
-
|
6604
|
-
|
6655
|
+
length = nativeMin(indexes.length, arrLength),
|
6656
|
+
oldArray = copyArray(array);
|
6605
6657
|
|
6606
6658
|
while (length--) {
|
6607
6659
|
var index = indexes[length];
|
@@ -6610,6 +6662,26 @@
|
|
6610
6662
|
return array;
|
6611
6663
|
}
|
6612
6664
|
|
6665
|
+
/**
|
6666
|
+
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
6667
|
+
*
|
6668
|
+
* @private
|
6669
|
+
* @param {Object} object The object to query.
|
6670
|
+
* @param {string} key The key of the property to get.
|
6671
|
+
* @returns {*} Returns the property value.
|
6672
|
+
*/
|
6673
|
+
function safeGet(object, key) {
|
6674
|
+
if (key === 'constructor' && typeof object[key] === 'function') {
|
6675
|
+
return;
|
6676
|
+
}
|
6677
|
+
|
6678
|
+
if (key == '__proto__') {
|
6679
|
+
return;
|
6680
|
+
}
|
6681
|
+
|
6682
|
+
return object[key];
|
6683
|
+
}
|
6684
|
+
|
6613
6685
|
/**
|
6614
6686
|
* Sets metadata for `func`.
|
6615
6687
|
*
|
@@ -6674,11 +6746,11 @@
|
|
6674
6746
|
*/
|
6675
6747
|
function shortOut(func) {
|
6676
6748
|
var count = 0,
|
6677
|
-
|
6749
|
+
lastCalled = 0;
|
6678
6750
|
|
6679
6751
|
return function() {
|
6680
6752
|
var stamp = nativeNow(),
|
6681
|
-
|
6753
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
6682
6754
|
|
6683
6755
|
lastCalled = stamp;
|
6684
6756
|
if (remaining > 0) {
|
@@ -6702,13 +6774,13 @@
|
|
6702
6774
|
*/
|
6703
6775
|
function shuffleSelf(array, size) {
|
6704
6776
|
var index = -1,
|
6705
|
-
|
6706
|
-
|
6777
|
+
length = array.length,
|
6778
|
+
lastIndex = length - 1;
|
6707
6779
|
|
6708
6780
|
size = size === undefined ? length : size;
|
6709
6781
|
while (++index < size) {
|
6710
6782
|
var rand = baseRandom(index, lastIndex),
|
6711
|
-
|
6783
|
+
value = array[rand];
|
6712
6784
|
|
6713
6785
|
array[rand] = array[index];
|
6714
6786
|
array[index] = value;
|
@@ -6839,8 +6911,8 @@
|
|
6839
6911
|
return [];
|
6840
6912
|
}
|
6841
6913
|
var index = 0,
|
6842
|
-
|
6843
|
-
|
6914
|
+
resIndex = 0,
|
6915
|
+
result = Array(nativeCeil(length / size));
|
6844
6916
|
|
6845
6917
|
while (index < length) {
|
6846
6918
|
result[resIndex++] = baseSlice(array, index, (index += size));
|
@@ -6865,9 +6937,9 @@
|
|
6865
6937
|
*/
|
6866
6938
|
function compact(array) {
|
6867
6939
|
var index = -1,
|
6868
|
-
|
6869
|
-
|
6870
|
-
|
6940
|
+
length = array == null ? 0 : array.length,
|
6941
|
+
resIndex = 0,
|
6942
|
+
result = [];
|
6871
6943
|
|
6872
6944
|
while (++index < length) {
|
6873
6945
|
var value = array[index];
|
@@ -6906,8 +6978,8 @@
|
|
6906
6978
|
return [];
|
6907
6979
|
}
|
6908
6980
|
var args = Array(length - 1),
|
6909
|
-
|
6910
|
-
|
6981
|
+
array = arguments[0],
|
6982
|
+
index = length;
|
6911
6983
|
|
6912
6984
|
while (index--) {
|
6913
6985
|
args[index - 1] = arguments[index];
|
@@ -7384,8 +7456,8 @@
|
|
7384
7456
|
*/
|
7385
7457
|
function fromPairs(pairs) {
|
7386
7458
|
var index = -1,
|
7387
|
-
|
7388
|
-
|
7459
|
+
length = pairs == null ? 0 : pairs.length,
|
7460
|
+
result = {};
|
7389
7461
|
|
7390
7462
|
while (++index < length) {
|
7391
7463
|
var pair = pairs[index];
|
@@ -7519,7 +7591,7 @@
|
|
7519
7591
|
*/
|
7520
7592
|
var intersectionBy = baseRest(function(arrays) {
|
7521
7593
|
var iteratee = last(arrays),
|
7522
|
-
|
7594
|
+
mapped = arrayMap(arrays, castArrayLikeObject);
|
7523
7595
|
|
7524
7596
|
if (iteratee === last(mapped)) {
|
7525
7597
|
iteratee = undefined;
|
@@ -7554,7 +7626,7 @@
|
|
7554
7626
|
*/
|
7555
7627
|
var intersectionWith = baseRest(function(arrays) {
|
7556
7628
|
var comparator = last(arrays),
|
7557
|
-
|
7629
|
+
mapped = arrayMap(arrays, castArrayLikeObject);
|
7558
7630
|
|
7559
7631
|
comparator = typeof comparator == 'function' ? comparator : undefined;
|
7560
7632
|
if (comparator) {
|
@@ -7799,7 +7871,7 @@
|
|
7799
7871
|
*/
|
7800
7872
|
var pullAt = flatRest(function(array, indexes) {
|
7801
7873
|
var length = array == null ? 0 : array.length,
|
7802
|
-
|
7874
|
+
result = baseAt(array, indexes);
|
7803
7875
|
|
7804
7876
|
basePullAt(array, arrayMap(indexes, function(index) {
|
7805
7877
|
return isIndex(index, length) ? +index : index;
|
@@ -7842,8 +7914,8 @@
|
|
7842
7914
|
return result;
|
7843
7915
|
}
|
7844
7916
|
var index = -1,
|
7845
|
-
|
7846
|
-
|
7917
|
+
indexes = [],
|
7918
|
+
length = array.length;
|
7847
7919
|
|
7848
7920
|
predicate = getIteratee(predicate, 3);
|
7849
7921
|
while (++index < length) {
|
@@ -8689,7 +8761,7 @@
|
|
8689
8761
|
*/
|
8690
8762
|
var zipWith = baseRest(function(arrays) {
|
8691
8763
|
var length = arrays.length,
|
8692
|
-
|
8764
|
+
iteratee = length > 1 ? arrays[length - 1] : undefined;
|
8693
8765
|
|
8694
8766
|
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
|
8695
8767
|
return unzipWith(arrays, iteratee);
|
@@ -8805,12 +8877,12 @@
|
|
8805
8877
|
*/
|
8806
8878
|
var wrapperAt = flatRest(function(paths) {
|
8807
8879
|
var length = paths.length,
|
8808
|
-
|
8809
|
-
|
8810
|
-
|
8880
|
+
start = length ? paths[0] : 0,
|
8881
|
+
value = this.__wrapped__,
|
8882
|
+
interceptor = function(object) { return baseAt(object, paths); };
|
8811
8883
|
|
8812
8884
|
if (length > 1 || this.__actions__.length ||
|
8813
|
-
|
8885
|
+
!(value instanceof LazyWrapper) || !isIndex(start)) {
|
8814
8886
|
return this.thru(interceptor);
|
8815
8887
|
}
|
8816
8888
|
value = value.slice(start, +start + (length ? 1 : 0));
|
@@ -8915,7 +8987,7 @@
|
|
8915
8987
|
this.__values__ = toArray(this.value());
|
8916
8988
|
}
|
8917
8989
|
var done = this.__index__ >= this.__values__.length,
|
8918
|
-
|
8990
|
+
value = done ? undefined : this.__values__[this.__index__++];
|
8919
8991
|
|
8920
8992
|
return { 'done': done, 'value': value };
|
8921
8993
|
}
|
@@ -8968,7 +9040,7 @@
|
|
8968
9040
|
*/
|
8969
9041
|
function wrapperPlant(value) {
|
8970
9042
|
var result,
|
8971
|
-
|
9043
|
+
parent = this;
|
8972
9044
|
|
8973
9045
|
while (parent instanceof baseLodash) {
|
8974
9046
|
var clone = wrapperClone(parent);
|
@@ -9159,6 +9231,10 @@
|
|
9159
9231
|
* // The `_.property` iteratee shorthand.
|
9160
9232
|
* _.filter(users, 'active');
|
9161
9233
|
* // => objects for ['barney']
|
9234
|
+
*
|
9235
|
+
* // Combining several predicates using `_.overEvery` or `_.overSome`.
|
9236
|
+
* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
|
9237
|
+
* // => objects for ['fred', 'barney']
|
9162
9238
|
*/
|
9163
9239
|
function filter(collection, predicate) {
|
9164
9240
|
var func = isArray(collection) ? arrayFilter : baseFilter;
|
@@ -9458,8 +9534,8 @@
|
|
9458
9534
|
*/
|
9459
9535
|
var invokeMap = baseRest(function(collection, path, args) {
|
9460
9536
|
var index = -1,
|
9461
|
-
|
9462
|
-
|
9537
|
+
isFunc = typeof path == 'function',
|
9538
|
+
result = isArrayLike(collection) ? Array(collection.length) : [];
|
9463
9539
|
|
9464
9540
|
baseEach(collection, function(value) {
|
9465
9541
|
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
|
@@ -9668,7 +9744,7 @@
|
|
9668
9744
|
*/
|
9669
9745
|
function reduce(collection, iteratee, accumulator) {
|
9670
9746
|
var func = isArray(collection) ? arrayReduce : baseReduce,
|
9671
|
-
|
9747
|
+
initAccum = arguments.length < 3;
|
9672
9748
|
|
9673
9749
|
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
|
9674
9750
|
}
|
@@ -9697,7 +9773,7 @@
|
|
9697
9773
|
*/
|
9698
9774
|
function reduceRight(collection, iteratee, accumulator) {
|
9699
9775
|
var func = isArray(collection) ? arrayReduceRight : baseReduce,
|
9700
|
-
|
9776
|
+
initAccum = arguments.length < 3;
|
9701
9777
|
|
9702
9778
|
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
|
9703
9779
|
}
|
@@ -9908,15 +9984,15 @@
|
|
9908
9984
|
* var users = [
|
9909
9985
|
* { 'user': 'fred', 'age': 48 },
|
9910
9986
|
* { 'user': 'barney', 'age': 36 },
|
9911
|
-
* { 'user': 'fred', 'age':
|
9987
|
+
* { 'user': 'fred', 'age': 30 },
|
9912
9988
|
* { 'user': 'barney', 'age': 34 }
|
9913
9989
|
* ];
|
9914
9990
|
*
|
9915
9991
|
* _.sortBy(users, [function(o) { return o.user; }]);
|
9916
|
-
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred',
|
9992
|
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
|
9917
9993
|
*
|
9918
9994
|
* _.sortBy(users, ['user', 'age']);
|
9919
|
-
* // => objects for [['barney', 34], ['barney', 36], ['fred',
|
9995
|
+
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
|
9920
9996
|
*/
|
9921
9997
|
var sortBy = baseRest(function(collection, iteratees) {
|
9922
9998
|
if (collection == null) {
|
@@ -10295,15 +10371,15 @@
|
|
10295
10371
|
*/
|
10296
10372
|
function debounce(func, wait, options) {
|
10297
10373
|
var lastArgs,
|
10298
|
-
|
10299
|
-
|
10300
|
-
|
10301
|
-
|
10302
|
-
|
10303
|
-
|
10304
|
-
|
10305
|
-
|
10306
|
-
|
10374
|
+
lastThis,
|
10375
|
+
maxWait,
|
10376
|
+
result,
|
10377
|
+
timerId,
|
10378
|
+
lastCallTime,
|
10379
|
+
lastInvokeTime = 0,
|
10380
|
+
leading = false,
|
10381
|
+
maxing = false,
|
10382
|
+
trailing = true;
|
10307
10383
|
|
10308
10384
|
if (typeof func != 'function') {
|
10309
10385
|
throw new TypeError(FUNC_ERROR_TEXT);
|
@@ -10318,7 +10394,7 @@
|
|
10318
10394
|
|
10319
10395
|
function invokeFunc(time) {
|
10320
10396
|
var args = lastArgs,
|
10321
|
-
|
10397
|
+
thisArg = lastThis;
|
10322
10398
|
|
10323
10399
|
lastArgs = lastThis = undefined;
|
10324
10400
|
lastInvokeTime = time;
|
@@ -10337,8 +10413,8 @@
|
|
10337
10413
|
|
10338
10414
|
function remainingWait(time) {
|
10339
10415
|
var timeSinceLastCall = time - lastCallTime,
|
10340
|
-
|
10341
|
-
|
10416
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
10417
|
+
timeWaiting = wait - timeSinceLastCall;
|
10342
10418
|
|
10343
10419
|
return maxing
|
10344
10420
|
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
@@ -10347,7 +10423,7 @@
|
|
10347
10423
|
|
10348
10424
|
function shouldInvoke(time) {
|
10349
10425
|
var timeSinceLastCall = time - lastCallTime,
|
10350
|
-
|
10426
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
10351
10427
|
|
10352
10428
|
// Either this is the first call, activity has stopped and we're at the
|
10353
10429
|
// trailing edge, the system time has gone backwards and we're treating
|
@@ -10391,7 +10467,7 @@
|
|
10391
10467
|
|
10392
10468
|
function debounced() {
|
10393
10469
|
var time = now(),
|
10394
|
-
|
10470
|
+
isInvoking = shouldInvoke(time);
|
10395
10471
|
|
10396
10472
|
lastArgs = arguments;
|
10397
10473
|
lastThis = this;
|
@@ -10403,6 +10479,7 @@
|
|
10403
10479
|
}
|
10404
10480
|
if (maxing) {
|
10405
10481
|
// Handle invocations in a tight loop.
|
10482
|
+
clearTimeout(timerId);
|
10406
10483
|
timerId = setTimeout(timerExpired, wait);
|
10407
10484
|
return invokeFunc(lastCallTime);
|
10408
10485
|
}
|
@@ -10534,8 +10611,8 @@
|
|
10534
10611
|
}
|
10535
10612
|
var memoized = function() {
|
10536
10613
|
var args = arguments,
|
10537
|
-
|
10538
|
-
|
10614
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
10615
|
+
cache = memoized.cache;
|
10539
10616
|
|
10540
10617
|
if (cache.has(key)) {
|
10541
10618
|
return cache.get(key);
|
@@ -10648,7 +10725,7 @@
|
|
10648
10725
|
var funcsLength = transforms.length;
|
10649
10726
|
return baseRest(function(args) {
|
10650
10727
|
var index = -1,
|
10651
|
-
|
10728
|
+
length = nativeMin(args.length, funcsLength);
|
10652
10729
|
|
10653
10730
|
while (++index < length) {
|
10654
10731
|
args[index] = transforms[index].call(this, args[index]);
|
@@ -10832,7 +10909,7 @@
|
|
10832
10909
|
start = start == null ? 0 : nativeMax(toInteger(start), 0);
|
10833
10910
|
return baseRest(function(args) {
|
10834
10911
|
var array = args[start],
|
10835
|
-
|
10912
|
+
otherArgs = castSlice(args, 0, start);
|
10836
10913
|
|
10837
10914
|
if (array) {
|
10838
10915
|
arrayPush(otherArgs, array);
|
@@ -10887,7 +10964,7 @@
|
|
10887
10964
|
*/
|
10888
10965
|
function throttle(func, wait, options) {
|
10889
10966
|
var leading = true,
|
10890
|
-
|
10967
|
+
trailing = true;
|
10891
10968
|
|
10892
10969
|
if (typeof func != 'function') {
|
10893
10970
|
throw new TypeError(FUNC_ERROR_TEXT);
|
@@ -11472,8 +11549,8 @@
|
|
11472
11549
|
return true;
|
11473
11550
|
}
|
11474
11551
|
if (isArrayLike(value) &&
|
11475
|
-
|
11476
|
-
|
11552
|
+
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
11553
|
+
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
11477
11554
|
return !value.length;
|
11478
11555
|
}
|
11479
11556
|
var tag = getTag(value);
|
@@ -12318,7 +12395,7 @@
|
|
12318
12395
|
return iteratorToArray(value[symIterator]());
|
12319
12396
|
}
|
12320
12397
|
var tag = getTag(value),
|
12321
|
-
|
12398
|
+
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
|
12322
12399
|
|
12323
12400
|
return func(value);
|
12324
12401
|
}
|
@@ -12386,7 +12463,7 @@
|
|
12386
12463
|
*/
|
12387
12464
|
function toInteger(value) {
|
12388
12465
|
var result = toFinite(value),
|
12389
|
-
|
12466
|
+
remainder = result % 1;
|
12390
12467
|
|
12391
12468
|
return result === result ? (remainder ? result - remainder : result) : 0;
|
12392
12469
|
}
|
@@ -12459,7 +12536,7 @@
|
|
12459
12536
|
if (typeof value != 'string') {
|
12460
12537
|
return value === 0 ? value : +value;
|
12461
12538
|
}
|
12462
|
-
value = value
|
12539
|
+
value = baseTrim(value);
|
12463
12540
|
var isBinary = reIsBinary.test(value);
|
12464
12541
|
return (isBinary || reIsOctal.test(value))
|
12465
12542
|
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
@@ -12796,7 +12873,7 @@
|
|
12796
12873
|
var value = object[key];
|
12797
12874
|
|
12798
12875
|
if (value === undefined ||
|
12799
|
-
|
12876
|
+
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
12800
12877
|
object[key] = source[key];
|
12801
12878
|
}
|
12802
12879
|
}
|
@@ -13200,7 +13277,7 @@
|
|
13200
13277
|
*/
|
13201
13278
|
var invert = createInverter(function(result, value, key) {
|
13202
13279
|
if (value != null &&
|
13203
|
-
|
13280
|
+
typeof value.toString != 'function') {
|
13204
13281
|
value = nativeObjectToString.call(value);
|
13205
13282
|
}
|
13206
13283
|
|
@@ -13235,7 +13312,7 @@
|
|
13235
13312
|
*/
|
13236
13313
|
var invertBy = createInverter(function(result, value, key) {
|
13237
13314
|
if (value != null &&
|
13238
|
-
|
13315
|
+
typeof value.toString != 'function') {
|
13239
13316
|
value = nativeObjectToString.call(value);
|
13240
13317
|
}
|
13241
13318
|
|
@@ -13615,7 +13692,7 @@
|
|
13615
13692
|
path = castPath(path, object);
|
13616
13693
|
|
13617
13694
|
var index = -1,
|
13618
|
-
|
13695
|
+
length = path.length;
|
13619
13696
|
|
13620
13697
|
// Ensure the loop is entered when path is empty.
|
13621
13698
|
if (!length) {
|
@@ -13778,7 +13855,7 @@
|
|
13778
13855
|
*/
|
13779
13856
|
function transform(object, iteratee, accumulator) {
|
13780
13857
|
var isArr = isArray(object),
|
13781
|
-
|
13858
|
+
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
13782
13859
|
|
13783
13860
|
iteratee = getIteratee(iteratee, 4);
|
13784
13861
|
if (accumulator == null) {
|
@@ -14526,7 +14603,7 @@
|
|
14526
14603
|
*/
|
14527
14604
|
function replace() {
|
14528
14605
|
var args = arguments,
|
14529
|
-
|
14606
|
+
string = toString(args[0]);
|
14530
14607
|
|
14531
14608
|
return args.length < 3 ? string : string.replace(args[1], args[2]);
|
14532
14609
|
}
|
@@ -14585,9 +14662,9 @@
|
|
14585
14662
|
}
|
14586
14663
|
string = toString(string);
|
14587
14664
|
if (string && (
|
14588
|
-
|
14589
|
-
|
14590
|
-
|
14665
|
+
typeof separator == 'string' ||
|
14666
|
+
(separator != null && !isRegExp(separator))
|
14667
|
+
)) {
|
14591
14668
|
separator = baseToString(separator);
|
14592
14669
|
if (!separator && hasUnicode(string)) {
|
14593
14670
|
return castSlice(stringToArray(string), 0, limit);
|
@@ -14771,14 +14848,14 @@
|
|
14771
14848
|
options = assignInWith({}, options, settings, customDefaultsAssignIn);
|
14772
14849
|
|
14773
14850
|
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
|
14774
|
-
|
14775
|
-
|
14851
|
+
importsKeys = keys(imports),
|
14852
|
+
importsValues = baseValues(imports, importsKeys);
|
14776
14853
|
|
14777
14854
|
var isEscaping,
|
14778
|
-
|
14779
|
-
|
14780
|
-
|
14781
|
-
|
14855
|
+
isEvaluating,
|
14856
|
+
index = 0,
|
14857
|
+
interpolate = options.interpolate || reNoMatch,
|
14858
|
+
source = "__p += '";
|
14782
14859
|
|
14783
14860
|
// Compile the regexp to match each delimiter.
|
14784
14861
|
var reDelimiters = RegExp(
|
@@ -14786,13 +14863,16 @@
|
|
14786
14863
|
interpolate.source + '|' +
|
14787
14864
|
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
|
14788
14865
|
(options.evaluate || reNoMatch).source + '|$'
|
14789
|
-
|
14866
|
+
, 'g');
|
14790
14867
|
|
14791
14868
|
// Use a sourceURL for easier debugging.
|
14869
|
+
// The sourceURL gets injected into the source that's eval-ed, so be careful
|
14870
|
+
// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
|
14871
|
+
// and escape the comment, thus injecting code that gets evaled.
|
14792
14872
|
var sourceURL = '//# sourceURL=' +
|
14793
|
-
('sourceURL'
|
14794
|
-
|
14795
|
-
|
14873
|
+
(hasOwnProperty.call(options, 'sourceURL')
|
14874
|
+
? (options.sourceURL + '').replace(/\s/g, ' ')
|
14875
|
+
: ('lodash.templateSources[' + (++templateCounter) + ']')
|
14796
14876
|
) + '\n';
|
14797
14877
|
|
14798
14878
|
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
@@ -14824,10 +14904,16 @@
|
|
14824
14904
|
|
14825
14905
|
// If `variable` is not specified wrap a with-statement around the generated
|
14826
14906
|
// code to add the data object to the top of the scope chain.
|
14827
|
-
var variable = options.variable;
|
14907
|
+
var variable = hasOwnProperty.call(options, 'variable') && options.variable;
|
14828
14908
|
if (!variable) {
|
14829
14909
|
source = 'with (obj) {\n' + source + '\n}\n';
|
14830
14910
|
}
|
14911
|
+
// Throw an error if a forbidden character was found in `variable`, to prevent
|
14912
|
+
// potential command injection attacks.
|
14913
|
+
else if (reForbiddenIdentifierChars.test(variable)) {
|
14914
|
+
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
|
14915
|
+
}
|
14916
|
+
|
14831
14917
|
// Cleanup code by stripping empty strings.
|
14832
14918
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
|
14833
14919
|
.replace(reEmptyStringMiddle, '$1')
|
@@ -14836,18 +14922,18 @@
|
|
14836
14922
|
// Frame code as the function body.
|
14837
14923
|
source = 'function(' + (variable || 'obj') + ') {\n' +
|
14838
14924
|
(variable
|
14839
|
-
|
14840
|
-
|
14925
|
+
? ''
|
14926
|
+
: 'obj || (obj = {});\n'
|
14841
14927
|
) +
|
14842
14928
|
"var __t, __p = ''" +
|
14843
14929
|
(isEscaping
|
14844
|
-
|
14845
|
-
|
14930
|
+
? ', __e = _.escape'
|
14931
|
+
: ''
|
14846
14932
|
) +
|
14847
14933
|
(isEvaluating
|
14848
|
-
|
14934
|
+
? ', __j = Array.prototype.join;\n' +
|
14849
14935
|
"function print() { __p += __j.call(arguments, '') }\n"
|
14850
|
-
|
14936
|
+
: ';\n'
|
14851
14937
|
) +
|
14852
14938
|
source +
|
14853
14939
|
'return __p\n}';
|
@@ -14941,15 +15027,15 @@
|
|
14941
15027
|
function trim(string, chars, guard) {
|
14942
15028
|
string = toString(string);
|
14943
15029
|
if (string && (guard || chars === undefined)) {
|
14944
|
-
return string
|
15030
|
+
return baseTrim(string);
|
14945
15031
|
}
|
14946
15032
|
if (!string || !(chars = baseToString(chars))) {
|
14947
15033
|
return string;
|
14948
15034
|
}
|
14949
15035
|
var strSymbols = stringToArray(string),
|
14950
|
-
|
14951
|
-
|
14952
|
-
|
15036
|
+
chrSymbols = stringToArray(chars),
|
15037
|
+
start = charsStartIndex(strSymbols, chrSymbols),
|
15038
|
+
end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
14953
15039
|
|
14954
15040
|
return castSlice(strSymbols, start, end).join('');
|
14955
15041
|
}
|
@@ -14976,13 +15062,13 @@
|
|
14976
15062
|
function trimEnd(string, chars, guard) {
|
14977
15063
|
string = toString(string);
|
14978
15064
|
if (string && (guard || chars === undefined)) {
|
14979
|
-
return string.
|
15065
|
+
return string.slice(0, trimmedEndIndex(string) + 1);
|
14980
15066
|
}
|
14981
15067
|
if (!string || !(chars = baseToString(chars))) {
|
14982
15068
|
return string;
|
14983
15069
|
}
|
14984
15070
|
var strSymbols = stringToArray(string),
|
14985
|
-
|
15071
|
+
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
|
14986
15072
|
|
14987
15073
|
return castSlice(strSymbols, 0, end).join('');
|
14988
15074
|
}
|
@@ -15015,7 +15101,7 @@
|
|
15015
15101
|
return string;
|
15016
15102
|
}
|
15017
15103
|
var strSymbols = stringToArray(string),
|
15018
|
-
|
15104
|
+
start = charsStartIndex(strSymbols, stringToArray(chars));
|
15019
15105
|
|
15020
15106
|
return castSlice(strSymbols, start).join('');
|
15021
15107
|
}
|
@@ -15059,7 +15145,7 @@
|
|
15059
15145
|
*/
|
15060
15146
|
function truncate(string, options) {
|
15061
15147
|
var length = DEFAULT_TRUNC_LENGTH,
|
15062
|
-
|
15148
|
+
omission = DEFAULT_TRUNC_OMISSION;
|
15063
15149
|
|
15064
15150
|
if (isObject(options)) {
|
15065
15151
|
var separator = 'separator' in options ? options.separator : separator;
|
@@ -15093,7 +15179,7 @@
|
|
15093
15179
|
if (isRegExp(separator)) {
|
15094
15180
|
if (string.slice(end).search(separator)) {
|
15095
15181
|
var match,
|
15096
|
-
|
15182
|
+
substring = result;
|
15097
15183
|
|
15098
15184
|
if (!separator.global) {
|
15099
15185
|
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
|
@@ -15308,7 +15394,7 @@
|
|
15308
15394
|
*/
|
15309
15395
|
function cond(pairs) {
|
15310
15396
|
var length = pairs == null ? 0 : pairs.length,
|
15311
|
-
|
15397
|
+
toIteratee = getIteratee();
|
15312
15398
|
|
15313
15399
|
pairs = !length ? [] : arrayMap(pairs, function(pair) {
|
15314
15400
|
if (typeof pair[1] != 'function') {
|
@@ -15530,6 +15616,9 @@
|
|
15530
15616
|
* values against any array or object value, respectively. See `_.isEqual`
|
15531
15617
|
* for a list of supported value comparisons.
|
15532
15618
|
*
|
15619
|
+
* **Note:** Multiple values can be checked by combining several matchers
|
15620
|
+
* using `_.overSome`
|
15621
|
+
*
|
15533
15622
|
* @static
|
15534
15623
|
* @memberOf _
|
15535
15624
|
* @since 3.0.0
|
@@ -15545,6 +15634,10 @@
|
|
15545
15634
|
*
|
15546
15635
|
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
|
15547
15636
|
* // => [{ 'a': 4, 'b': 5, 'c': 6 }]
|
15637
|
+
*
|
15638
|
+
* // Checking for several possible values
|
15639
|
+
* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
|
15640
|
+
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
|
15548
15641
|
*/
|
15549
15642
|
function matches(source) {
|
15550
15643
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
@@ -15559,6 +15652,9 @@
|
|
15559
15652
|
* `srcValue` values against any array or object value, respectively. See
|
15560
15653
|
* `_.isEqual` for a list of supported value comparisons.
|
15561
15654
|
*
|
15655
|
+
* **Note:** Multiple values can be checked by combining several matchers
|
15656
|
+
* using `_.overSome`
|
15657
|
+
*
|
15562
15658
|
* @static
|
15563
15659
|
* @memberOf _
|
15564
15660
|
* @since 3.2.0
|
@@ -15575,6 +15671,10 @@
|
|
15575
15671
|
*
|
15576
15672
|
* _.find(objects, _.matchesProperty('a', 4));
|
15577
15673
|
* // => { 'a': 4, 'b': 5, 'c': 6 }
|
15674
|
+
*
|
15675
|
+
* // Checking for several possible values
|
15676
|
+
* _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
|
15677
|
+
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
|
15578
15678
|
*/
|
15579
15679
|
function matchesProperty(path, srcValue) {
|
15580
15680
|
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
|
@@ -15677,17 +15777,17 @@
|
|
15677
15777
|
*/
|
15678
15778
|
function mixin(object, source, options) {
|
15679
15779
|
var props = keys(source),
|
15680
|
-
|
15780
|
+
methodNames = baseFunctions(source, props);
|
15681
15781
|
|
15682
15782
|
if (options == null &&
|
15683
|
-
|
15783
|
+
!(isObject(source) && (methodNames.length || !props.length))) {
|
15684
15784
|
options = source;
|
15685
15785
|
source = object;
|
15686
15786
|
object = this;
|
15687
15787
|
methodNames = baseFunctions(source, keys(source));
|
15688
15788
|
}
|
15689
15789
|
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
|
15690
|
-
|
15790
|
+
isFunc = isFunction(object);
|
15691
15791
|
|
15692
15792
|
arrayEach(methodNames, function(methodName) {
|
15693
15793
|
var func = source[methodName];
|
@@ -15697,7 +15797,7 @@
|
|
15697
15797
|
var chainAll = this.__chain__;
|
15698
15798
|
if (chain || chainAll) {
|
15699
15799
|
var result = object(this.__wrapped__),
|
15700
|
-
|
15800
|
+
actions = result.__actions__ = copyArray(this.__actions__);
|
15701
15801
|
|
15702
15802
|
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
|
15703
15803
|
result.__chain__ = chainAll;
|
@@ -15798,6 +15898,10 @@
|
|
15798
15898
|
* Creates a function that checks if **all** of the `predicates` return
|
15799
15899
|
* truthy when invoked with the arguments it receives.
|
15800
15900
|
*
|
15901
|
+
* Following shorthands are possible for providing predicates.
|
15902
|
+
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
|
15903
|
+
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
|
15904
|
+
*
|
15801
15905
|
* @static
|
15802
15906
|
* @memberOf _
|
15803
15907
|
* @since 4.0.0
|
@@ -15824,6 +15928,10 @@
|
|
15824
15928
|
* Creates a function that checks if **any** of the `predicates` return
|
15825
15929
|
* truthy when invoked with the arguments it receives.
|
15826
15930
|
*
|
15931
|
+
* Following shorthands are possible for providing predicates.
|
15932
|
+
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
|
15933
|
+
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
|
15934
|
+
*
|
15827
15935
|
* @static
|
15828
15936
|
* @memberOf _
|
15829
15937
|
* @since 4.0.0
|
@@ -15843,6 +15951,9 @@
|
|
15843
15951
|
*
|
15844
15952
|
* func(NaN);
|
15845
15953
|
* // => false
|
15954
|
+
*
|
15955
|
+
* var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
|
15956
|
+
* var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
|
15846
15957
|
*/
|
15847
15958
|
var overSome = createOver(arraySome);
|
15848
15959
|
|
@@ -16100,7 +16211,7 @@
|
|
16100
16211
|
return [];
|
16101
16212
|
}
|
16102
16213
|
var index = MAX_ARRAY_LENGTH,
|
16103
|
-
|
16214
|
+
length = nativeMin(n, MAX_ARRAY_LENGTH);
|
16104
16215
|
|
16105
16216
|
iteratee = getIteratee(iteratee);
|
16106
16217
|
n -= MAX_ARRAY_LENGTH;
|
@@ -16879,7 +16990,7 @@
|
|
16879
16990
|
// Add `LazyWrapper` methods that accept an `iteratee` value.
|
16880
16991
|
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
|
16881
16992
|
var type = index + 1,
|
16882
|
-
|
16993
|
+
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
|
16883
16994
|
|
16884
16995
|
LazyWrapper.prototype[methodName] = function(iteratee) {
|
16885
16996
|
var result = this.clone();
|
@@ -16965,19 +17076,19 @@
|
|
16965
17076
|
// Add `LazyWrapper` methods to `lodash.prototype`.
|
16966
17077
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
16967
17078
|
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
|
16968
|
-
|
16969
|
-
|
16970
|
-
|
17079
|
+
isTaker = /^(?:head|last)$/.test(methodName),
|
17080
|
+
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
|
17081
|
+
retUnwrapped = isTaker || /^find/.test(methodName);
|
16971
17082
|
|
16972
17083
|
if (!lodashFunc) {
|
16973
17084
|
return;
|
16974
17085
|
}
|
16975
17086
|
lodash.prototype[methodName] = function() {
|
16976
17087
|
var value = this.__wrapped__,
|
16977
|
-
|
16978
|
-
|
16979
|
-
|
16980
|
-
|
17088
|
+
args = isTaker ? [1] : arguments,
|
17089
|
+
isLazy = value instanceof LazyWrapper,
|
17090
|
+
iteratee = args[0],
|
17091
|
+
useLazy = isLazy || isArray(value);
|
16981
17092
|
|
16982
17093
|
var interceptor = function(value) {
|
16983
17094
|
var result = lodashFunc.apply(lodash, arrayPush([value], args));
|
@@ -16989,9 +17100,9 @@
|
|
16989
17100
|
isLazy = useLazy = false;
|
16990
17101
|
}
|
16991
17102
|
var chainAll = this.__chain__,
|
16992
|
-
|
16993
|
-
|
16994
|
-
|
17103
|
+
isHybrid = !!this.__actions__.length,
|
17104
|
+
isUnwrapped = retUnwrapped && !chainAll,
|
17105
|
+
onlyLazy = isLazy && !isHybrid;
|
16995
17106
|
|
16996
17107
|
if (!retUnwrapped && useLazy) {
|
16997
17108
|
value = onlyLazy ? value : new LazyWrapper(this);
|
@@ -17010,8 +17121,8 @@
|
|
17010
17121
|
// Add `Array` methods to `lodash.prototype`.
|
17011
17122
|
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
17012
17123
|
var func = arrayProto[methodName],
|
17013
|
-
|
17014
|
-
|
17124
|
+
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
|
17125
|
+
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
17015
17126
|
|
17016
17127
|
lodash.prototype[methodName] = function() {
|
17017
17128
|
var args = arguments;
|
@@ -17029,10 +17140,11 @@
|
|
17029
17140
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
17030
17141
|
var lodashFunc = lodash[methodName];
|
17031
17142
|
if (lodashFunc) {
|
17032
|
-
var key =
|
17033
|
-
|
17034
|
-
|
17035
|
-
|
17143
|
+
var key = lodashFunc.name + '';
|
17144
|
+
if (!hasOwnProperty.call(realNames, key)) {
|
17145
|
+
realNames[key] = [];
|
17146
|
+
}
|
17147
|
+
realNames[key].push({ 'name': methodName, 'func': lodashFunc });
|
17036
17148
|
}
|
17037
17149
|
});
|
17038
17150
|
|