forked from lodash/lodash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lodash.core.min.js
29 lines (29 loc) · 12.8 KB
/
lodash.core.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @license
* lodash 3.10.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
* Build: `lodash core exports="global,amd" -o ./lodash.core.js`
*/
;(function(){function n(n){return n&&n.Object===Object?n:null}function t(n){return _n[n]}function r(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function e(n){return!!n&&typeof n=="object"}function u(n){if(e(n)&&!Xn(n)){if(n instanceof o)return n;if(In.call(n,"__wrapped__"))return new o(n.__wrapped__,n.__chain__,A(n.__actions__))}return new o(n)}function o(n,t,r){this.__wrapped__=n,this.__actions__=r||[],this.__chain__=!!t}function i(n,t,r,e){for(var u=-1,o=n.length,i=e,c=i;++u<o;){
var f=n[u],a=+t(f);(r(a,i)||a===e&&a===c)&&(i=a,c=f)}return c}function c(n,t){return n.push.apply(n,t)}function f(n,t,r){var e=n[t];(r===r?r===e:e!==e)&&(r!==nn||t in n)||(n[t]=r)}function a(n,t,r){if(typeof n!="function")throw new TypeError(rn);return setTimeout(function(){n.apply(nn,r)},t)}function l(n,t){var r=true;return zn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function p(n,t){var r=[];return zn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function s(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,
!1):void 0}),e}function h(n,t,r,e){e||(e=[]);for(var u=-1,o=n.length;++u<o;){var i=n[u];W(i)&&R(i)&&(r||Xn(i)||G(i))?t?h(i,t,r,e):c(e,i):r||(e[e.length]=i)}return e}function v(n,t){return n&&Cn(n,t,L)}function y(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];J(n[i])&&(o[++u]=i)}return o}function g(n,t,u,o,i,c){if(n===t)n=true;else if(null==n||null==t||!W(n)&&!e(t))n=n!==n&&t!==t;else n:{var f=Xn(n),a=Xn(t),l=un,p=un;f||(l=kn.call(n),l==en&&(l=pn)),a||(p=kn.call(t),p==en&&(p=pn));var s=l==pn&&!r(n),a=p==pn&&!r(t),p=l==p;
if(!p||f||s){if(!o&&(l=s&&In.call(n,"__wrapped__"),a=a&&In.call(t,"__wrapped__"),l||a)){n=g(l?n.value():n,a?t.value():t,u,o,i,c);break n}if(p){for(i||(i=[]),c||(c=[]),l=i.length;l--;)if(i[l]==n){n=c[l]==t;break n}i.push(n),c.push(t),n=(f?k:S)(n,t,g,u,o,i,c),i.pop(),c.pop()}else n=false}else n=N(n,t,l)}return n}function _(n){var t=typeof n;return"function"==t?n:null==n?X:("object"==t?w:d)(n)}function b(n){var t,r=[];for(t in n)r.push(t);return r}function m(n,t){var r=-1,e=R(n)?Array(n.length):[];return zn(n,function(n,u,o){
e[++r]=t(n,u,o)}),e}function w(n){return function(t){var r=L(t),e=r.length;if(null==t)return!e;for(t=Object(t);e--;){var u=r[e];if(!(u in t&&g(n[u],t[u],nn,true)))return false}return true}}function d(n){return function(t){return null==t?nn:t[n]}}function j(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function O(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function A(n){var t,r=-1,e=n.length;for(t||(t=Array(e));++r<e;)t[r]=n[r];return t}function E(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){
var o=t[e];f(r,o,n[o])}return r}function x(n){return z(function(t,r){var e=-1,u=null==t?0:r.length,o=1<u?r[u-1]:nn,o=typeof o=="function"?(u--,o):nn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,o)}return t})}function I(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);
case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Yn(n.prototype),t=n.apply(r,t);return W(t)?t:r}}function T(n,t,r,e){function u(){for(var t=-1,c=arguments.length,f=-1,a=e.length,l=Array(a+c);++f<a;)l[f]=e[f];for(;c--;)l[f++]=arguments[++t];return(this&&this!==On&&this instanceof u?i:n).apply(o?r:this,l)}if(typeof n!="function")throw new TypeError(rn);var o=t&tn,i=I(n);return u}function k(n,t,r,e,u,o,i){var c=-1,f=n.length,a=t.length;if(f!=a&&(!u||a<=f))return false;for(;++c<f;){var l=n[c],a=t[c],p=e?e(u?a:l,u?l:a,c):nn;
if(p!==nn){if(p)continue;return false}if(u){if(!O(t,function(n){return l===n||r(l,n,e,u,o,i)}))return false}else if(l!==a&&!r(l,a,e,u,o,i))return false}return true}function N(n,t,r){switch(r){case on:case cn:return+n==+t;case fn:return n.name==t.name&&n.message==t.message;case ln:return n!=+n?t!=+t:n==+t;case sn:case hn:return n==t+""}return false}function S(n,t,r,e,u,o,i){var c=L(n),f=c.length,a=L(t).length;if(f!=a&&!u)return false;for(a=f;a--;){var l=c[a];if(!(u?l in t:In.call(t,l)))return false}for(var p=u;++a<f;){var l=c[a],s=n[l],h=t[l],v=e?e(u?h:s,u?s:h,l):nn;
if(v===nn?!r(s,h,e,u,o,i):!v)return false;p||(p="constructor"==l)}return p||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function F(n,t){return n===nn?t:n}function D(n){var t=n.length,t=t&&q(t)&&(Xn(n)||G(n)||H(n))&&t||0;n=-1;for(var r=Array(t);++n<t;)r[n]=n+"";return r}function R(n){return null!=n&&!(typeof n=="function"&&kn.call(n)==an)&&q(Gn(n))}function $(n,t){return n=typeof n=="number"||gn.test(n)?+n:-1,
t=null==t?Mn:t,-1<n&&0==n%1&&n<t}function q(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=Mn}function B(n){var t=!!n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function P(n){return n=u(n),n.__chain__=true,n}function V(n,t){return zn(n,typeof t=="function"?t:X)}function M(n){return null==n?0:(n=R(n)?n:L(n),n.length)}function Y(n,t){var r;if(typeof t!="function")throw new TypeError(rn);return function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=nn),r}}function z(n,t){if(typeof n!="function")throw new TypeError(rn);
return t=Bn(t===nn?n.length-1:Rn(t)||0,0),function(){for(var r=arguments,e=-1,u=Bn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function C(n,t){return n>t}function G(n){return e(n)&&R(n)&&In.call(n,"callee")&&!Dn.call(n,"callee")}function J(n){return W(n)&&kn.call(n)==an}function W(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function H(n){return typeof n=="string"||e(n)&&kn.call(n)==hn}function K(n,t){return n<t}function L(n){
n=Object(n);var t=B(n);if(!t&&!R(n))return qn(n);var r,e=D(n),u=e.length,o=!!u;for(r in n)!In.call(n,r)||o&&$(r,u)||t&&"constructor"==r||e.push(r);return e}function Q(n){n=Object(n);for(var t=-1,r=B(n),e=b(n),u=e.length,o=D(n),i=o.length,c=!!i;++t<u;){var f=e[t];c&&$(f,i)||"constructor"==f&&(r||!In.call(n,f))||o.push(f)}return o}function U(n){if(n){for(var t=L(n),r=-1,e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];n=u}else n=[];return n}function X(n){return n}function Z(n,t,r){var e=L(t),u=y(t,e);null!=r||W(t)&&(u.length||!e.length)||(r=t,
t=n,n=this,u=y(t,L(t)));var o=W(r)&&"chain"in r?r.chain:true,i=J(n);return zn(u,function(r){var e=t[r];n[r]=e,i&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=A(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,c([this.value()],arguments))})}),n}var nn,tn=1,rn="Expected a function",en="[object Arguments]",un="[object Array]",on="[object Boolean]",cn="[object Date]",fn="[object Error]",an="[object Function]",ln="[object Number]",pn="[object Object]",sn="[object RegExp]",hn="[object String]",vn=/[&<>"'`]/g,yn=RegExp(vn.source),gn=/^\d+$/,_n={
"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},mn=bn[typeof module]&&module&&!module.nodeType?module:null,wn=n(bn[typeof self]&&self),dn=n(bn[typeof window]&&window),jn=n(bn[typeof this]&&this),On=n((bn[typeof exports]&&exports&&!exports.nodeType?exports:null)&&mn&&typeof global=="object"&&global)||dn!==(jn&&jn.window)&&dn||wn||jn||Function("return this")(),An=Array.prototype,En=Object.prototype,xn=String.prototype,In=En.hasOwnProperty,Tn=0,kn=En.toString,Nn=On._,Sn=On.d,Fn=Sn?Sn.e:nn,Dn=En.propertyIsEnumerable,Rn=Math.floor,$n=On.isFinite,qn=Object.keys,Bn=Math.max,Pn=Number.NEGATIVE_INFINITY,Vn=Number.POSITIVE_INFINITY,Mn=9007199254740991,Yn=function(){
function n(){}return function(t){if(W(t)){n.prototype=t;var r=new n;n.prototype=nn}return r||{}}}(),zn=function(n,t){return function(r,e){if(null==r)return r;if(!R(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}}(v),Cn=function(n){return function(t,r,e){var u=Object(t);e=e(t);for(var o=e.length,i=n?o:-1;n?i--:++i<o;){var c=e[i];if(false===r(u[c],c,u))break}return t}}();Fn&&!Dn.call({valueOf:1},"valueOf")&&(b=function(n){for(var t=Fn(n),r=[];!(n=t.next()).done;)r.push(n.value);
return r});var Gn=d("length"),Jn=z(function(n){return n=h(n),this.thru(function(n){return n=Xn(n)?n:[Object(n)],c(A(n),U)})}),Wn=z(function(n,t,r){var e=typeof t=="function";return m(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})}),Hn=Date.now,Kn=z(function(n,t,r){return T(n,32|tn,t,r)}),Ln=z(function(n,t){return a(n,1,t)}),Qn=z(function(n,t,r){return a(n,t,r)}),Un=z(function(n,t){return T(n,32,nn,t)}),Xn=Array.isArray,Zn=z(function(n){return n.push(nn,F),tt.apply(nn,n)}),nt=x(function(n,t){
E(t,Q(t),n)}),tt=x(function(n,t,r){var e=Q(t);n||(n={});for(var u=-1,o=e.length;++u<o;){var i=e[u],c=r?r(n[i],t[i],i,n,t):t[i];f(n,i,c)}}),rt=z(function(n,t){var r;if(null==n)r={};else{r=n;var e=h(t);r=Object(r);for(var u=-1,o=e.length,i={};++u<o;){var c=e[u];c in r&&(i[c]=r[c])}r=i}return r});o.prototype=Yn(u.prototype),o.prototype.constructor=o,u.before=Y,u.bind=Kn,u.chain=P,u.compact=function(n){return p(n,Boolean)},u.defaults=Zn,u.defer=Ln,u.delay=Qn,u.extend=nt,u.extendWith=tt,u.filter=function(n,t){
return p(n,_(t))},u.flatten=function(n){return n&&n.length?h(n):[]},u.flattenDeep=function(n){return n&&n.length?h(n,true):[]},u.functions=function(n){return null==n?[]:y(n,Q(n))},u.invoke=Wn,u.iteratee=_,u.keys=L,u.keysIn=Q,u.map=function(n,t){return m(n,_(t))},u.mixin=Z,u.negate=function(n){if(typeof n!="function")throw new TypeError(rn);return function(){return!n.apply(this,arguments)}},u.once=function(n){return Y(2,n)},u.partial=Un,u.pick=rt,u.restParam=z,u.slice=function(n,t,r){if(n&&n.length){
var e=r;r=-1;var u=n.length;for(t=null==t?0:Rn(t)||0,0>t&&(t=-t>u?0:u+t),e=e===nn||e>u?u:Rn(e)||0,0>e&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0,e=Array(u);++r<u;)e[r]=n[r+t];n=e}else n=[];return n},u.sortBy=function(n,t){var r=0;return t=_(t),m(m(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===nn,i=r===r,c=null===e,f=e===nn,a=e===e;if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(r<e&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b;
}),d("c"))},u.tap=function(n,t){return t(n),n},u.thru=function(n,t){return t(n)},u.toArray=function(n){return R(n)?n.length?A(n):[]:U(n)},u.values=U,u.wrap=function(n,t){return t=null==t?X:t,Un(t,n)},u.each=V,Z(u,u),u.clone=function(n){return W(n)?Xn(n)?A(n):E(n,L(n)):n},u.escape=function(n){return(n=null==n?"":n+"")&&yn.test(n)?n.replace(vn,t):n},u.every=function(n,t,r){return t=r?nn:t,l(n,_(t))},u.find=function(n,t){return s(n,_(t),zn)},u.first=function(n){return n?n[0]:nn},u.forEach=V,u.gt=C,u.has=function(n,t){
return null!=n&&In.call(n,t)},u.identity=X,u.indexOf=function(n,t,r){var e=n?n.length:0;typeof r=="number"&&(r=0>r?Bn(e+r,0):r),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},u.isArguments=G,u.isArray=Xn,u.isDate=function(n){return e(n)&&kn.call(n)==cn},u.isEmpty=function(n){return!e(n)||J(n.splice)?!M(n):!L(n).length},u.isEqual=function(n,t){return g(n,t)},u.isFinite=function(n){return typeof n=="number"&&$n(n)},u.isFunction=J,u.isObject=W,u.isRegExp=function(n){
return W(n)&&kn.call(n)==sn},u.isString=H,u.last=function(n){var t=n?n.length:0;return t?n[t-1]:nn},u.lt=K,u.max=function(n){return n&&n.length?i(n,X,C,Pn):Pn},u.min=function(n){return n&&n.length?i(n,X,K,Vn):Vn},u.noConflict=function(){return On._=Nn,this},u.noop=function(){},u.now=Hn,u.reduce=function(n,t,r){return j(n,_(t),r,3>arguments.length,zn)},u.result=function(n,t,r){return t=null==n?nn:n[t],t===nn&&(t=r),J(t)?t.call(n):t},u.size=M,u.some=function(n,t,r){return t=r?nn:t,O(n,_(t))},u.uniqueId=function(n){
var t=++Tn;return(null==n?"":n+"")+t},Z(u,function(){var n={};return v(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),{chain:false}),u.VERSION="3.10.1",zn("join pop push replace reverse shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?xn:An)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n);u.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n);
})}}),u.prototype.chain=function(){return P(this)},u.prototype.concat=Jn,u.prototype.toString=function(){return this.value()+""},u.prototype.run=u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=function(){for(var n=this.__actions__,t=this.__wrapped__,r=-1,e=n.length;++r<e;)var u=n[r],t=u.func.apply(u.thisArg,c([t],u.args));return t},(dn||wn||{})._=u,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return u}):On._=u}).call(this);