@lgd-utils/error
Version:
A front-end error tool
2 lines (1 loc) • 12.7 kB
JavaScript
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&_setPrototypeOf(t,r)}function _createSuper(t){var r=_isNativeReflectConstruct();return function(){var e,n=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return _possibleConstructorReturn(this,e)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(e,t)})(t)}function _construct(t,r,e){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function(t,r,e){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(t,n));return e&&_setPrototypeOf(o,e.prototype),o}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function _isNativeFunction(t){return-1!==Function.toString.call(t).indexOf("[native code]")}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t})(t,r)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var LgdUtilsError=function(t){"use strict";var r=function(t){_inherits(e,_wrapNativeSuper(Error));var r=_createSuper(e);function e(t){var n;return _classCallCheck(this,e),(n=r.call(this,t)).name=n.constructor.name,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(_assertThisInitialized(n),n.constructor):n.stack=new Error(t).stack,n}return e}(),e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var n=function(t){return function(r,e,n){for(var o=-1,i=Object(r),u=n(r),c=u.length;c--;){var a=u[t?c:++o];if(!1===e(i[a],a,i))break}return r}}();var o=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n},i="object"==_typeof(e)&&e&&e.Object===Object&&e,u=i,c="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=u||c||Function("return this")(),f=a.Symbol,s=Object.prototype,l=s.hasOwnProperty,p=s.toString,y=f?f.toStringTag:void 0;var v=Object.prototype.toString;var _=function(t){var r=l.call(t,y),e=t[y];try{t[y]=void 0;var n=!0}catch(i){}var o=p.call(t);return n&&(r?t[y]=e:delete t[y]),o},h=function(t){return v.call(t)},b=f?f.toStringTag:void 0;var d=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?_(t):h(t)};var j=function(t){return null!=t&&"object"==_typeof(t)},g=d,O=j;var w=function(t){return O(t)&&"[object Arguments]"==g(t)},m=j,S=Object.prototype,P=S.hasOwnProperty,E=S.propertyIsEnumerable,x=w(function(){return arguments}())?w:function(t){return m(t)&&P.call(t,"callee")&&!E.call(t,"callee")},A=Array.isArray,C={exports:{}};var T=function(){return!1};!function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?a.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||T}(C,C.exports);var z=/^(?:0|[1-9]\d*)$/;var R=function(t,r){var e=_typeof(t);return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&z.test(t))&&t>-1&&t%1==0&&t<r};var F=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},k=d,I=F,N=j,$={};$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Arguments]"]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object Boolean]"]=$["[object DataView]"]=$["[object Date]"]=$["[object Error]"]=$["[object Function]"]=$["[object Map]"]=$["[object Number]"]=$["[object Object]"]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object WeakMap]"]=!1;var B=function(t){return N(t)&&I(t.length)&&!!$[k(t)]};var M=function(t){return function(r){return t(r)}},U={exports:{}};!function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e&&i.process,u=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(r){}}();t.exports=u}(U,U.exports);var D=B,q=U.exports,L=q&&q.isTypedArray,G=L?M(L):D,V=o,W=x,H=A,J=C.exports,K=R,Q=G,X=Object.prototype.hasOwnProperty;var Y=function(t,r){var e=H(t),n=!e&&W(t),o=!e&&!n&&J(t),i=!e&&!n&&!o&&Q(t),u=e||n||o||i,c=u?V(t.length,String):[],a=c.length;for(var f in t)!r&&!X.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||K(f,a))||c.push(f);return c},Z=Object.prototype;var tt=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||Z)};var rt=function(t,r){return function(e){return t(r(e))}}(Object.keys,Object),et=tt,nt=rt,ot=Object.prototype.hasOwnProperty;var it=function(t){var r=_typeof(t);return null!=t&&("object"==r||"function"==r)},ut=d,ct=it;var at=function(t){if(!ct(t))return!1;var r=ut(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},ft=at,st=F;var lt=Y,pt=function(t){if(!et(t))return nt(t);var r=[];for(var e in Object(t))ot.call(t,e)&&"constructor"!=e&&r.push(e);return r},yt=function(t){return null!=t&&st(t.length)&&!ft(t)};var vt=n,_t=function(t){return yt(t)?lt(t):pt(t)};var ht=function(t){return t};var bt=function(t,r){return t&&vt(t,r,_t)},dt=function(t){return"function"==typeof t?t:ht};var jt,gt=function(t,r){return t&&bt(t,dt(r))},Ot=a["__core-js_shared__"],wt=(jt=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+jt:"";var mt=Function.prototype.toString;var St=at,Pt=function(t){return!!wt&&wt in t},Et=it,xt=function(t){if(null!=t){try{return mt.call(t)}catch(r){}try{return t+""}catch(r){}}return""},At=/^\[object .+?Constructor\]$/,Ct=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Tt=function(t){return!(!Et(t)||Pt(t))&&(St(t)?Ct:At).test(xt(t))},zt=function(t,r){return null==t?void 0:t[r]};var Rt=function(t,r){var e=zt(t,r);return Tt(e)?e:void 0},Ft=Rt,kt=function(){try{var t=Ft(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();var It=function(t,r){return t===r||t!=t&&r!=r},Nt=function(t,r,e){"__proto__"==r&&kt?kt(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e},$t=It,Bt=Object.prototype.hasOwnProperty;var Mt=function(t,r,e){var n=t[r];Bt.call(t,r)&&$t(n,e)&&(void 0!==e||r in t)||Nt(t,r,e)},Ut=d,Dt=j;var qt=function(t){return"symbol"==_typeof(t)||Dt(t)&&"[object Symbol]"==Ut(t)},Lt=A,Gt=qt,Vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wt=/^\w*$/;var Ht=function(t,r){if(Lt(t))return!1;var e=_typeof(t);return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!Gt(t))||(Wt.test(t)||!Vt.test(t)||null!=r&&t in Object(r))},Jt=Rt(Object,"create"),Kt=Jt;var Qt=Jt,Xt=Object.prototype.hasOwnProperty;var Yt=Jt,Zt=Object.prototype.hasOwnProperty;var tr=Jt;var rr=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},er=function(t){var r=this.__data__;if(Qt){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return Xt.call(r,t)?r[t]:void 0},nr=function(t){var r=this.__data__;return Yt?void 0!==r[t]:Zt.call(r,t)},or=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=tr&&void 0===r?"__lodash_hash_undefined__":r,this};function ir(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}ir.prototype.clear=function(){this.__data__=Kt?Kt(null):{},this.size=0},ir.prototype.delete=rr,ir.prototype.get=er,ir.prototype.has=nr,ir.prototype.set=or;var ur=ir;var cr=It;var ar=function(t,r){for(var e=t.length;e--;)if(cr(t[e][0],r))return e;return-1},fr=ar,sr=Array.prototype.splice;var lr=ar;var pr=ar;var yr=ar;var vr=function(t){var r=this.__data__,e=fr(r,t);return!(e<0)&&(e==r.length-1?r.pop():sr.call(r,e,1),--this.size,!0)},_r=function(t){var r=this.__data__,e=lr(r,t);return e<0?void 0:r[e][1]},hr=function(t){return pr(this.__data__,t)>-1},br=function(t,r){var e=this.__data__,n=yr(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function dr(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}dr.prototype.clear=function(){this.__data__=[],this.size=0},dr.prototype.delete=vr,dr.prototype.get=_r,dr.prototype.has=hr,dr.prototype.set=br;var jr=dr,gr=Rt(a,"Map"),Or=ur,wr=jr,mr=gr;var Sr=function(t){var r=_typeof(t);return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var Pr=function(t,r){var e=t.__data__;return Sr(r)?e["string"==typeof r?"string":"hash"]:e.map},Er=Pr;var xr=Pr;var Ar=Pr;var Cr=Pr;var Tr=function(t){var r=Er(this,t).delete(t);return this.size-=r?1:0,r},zr=function(t){return xr(this,t).get(t)},Rr=function(t){return Ar(this,t).has(t)},Fr=function(t,r){var e=Cr(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function kr(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}kr.prototype.clear=function(){this.size=0,this.__data__={hash:new Or,map:new(mr||wr),string:new Or}},kr.prototype.delete=Tr,kr.prototype.get=zr,kr.prototype.has=Rr,kr.prototype.set=Fr;var Ir=kr;function Nr(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var e=function e(){var n=arguments,o=r?r.apply(this,n):n[0],i=e.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return e.cache=i.set(o,u)||i,u};return e.cache=new(Nr.Cache||Ir),e}Nr.Cache=Ir;var $r=Nr;var Br=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mr=/\\(\\)?/g,Ur=function(t){var r=$r(t,(function(t){return 500===e.size&&e.clear(),t})),e=r.cache;return r}((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(Br,(function(t,e,n,o){r.push(n?o.replace(Mr,"$1"):e||t)})),r}));var Dr=function(t,r){for(var e=-1,n=null==t?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o},qr=A,Lr=qt,Gr=f?f.prototype:void 0,Vr=Gr?Gr.toString:void 0;var Wr=function t(r){if("string"==typeof r)return r;if(qr(r))return Dr(r,t)+"";if(Lr(r))return Vr?Vr.call(r):"";var e=r+"";return"0"==e&&1/r==-Infinity?"-0":e};var Hr=A,Jr=Ht,Kr=Ur,Qr=function(t){return null==t?"":Wr(t)};var Xr=qt;var Yr=Mt,Zr=function(t,r){return Hr(t)?t:Jr(t,r)?[t]:Kr(Qr(t))},te=R,re=it,ee=function(t){if("string"==typeof t||Xr(t))return t;var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r};var ne=function(t,r,e,n){if(!re(t))return t;for(var o=-1,i=(r=Zr(r,t)).length,u=i-1,c=t;null!=c&&++o<i;){var a=ee(r[o]),f=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return t;if(o!=u){var s=c[a];void 0===(f=n?n(s,a,c):void 0)&&(f=re(s)?s:te(r[o+1])?[]:{})}Yr(c,a,f),c=c[a]}return t};var oe=function(t,r,e){return null==t?t:ne(t,r,e)},ie=function(t){_inherits(e,t);var r=_createSuper(e);function e(t,n){var o;return _classCallCheck(this,e),(o=r.call(this,t)).isCustomError=!0,gt(n,(function(t,r){oe(_assertThisInitialized(o),r,t)})),o}return e}(r);ie.isCustomError=!0;var ue={CustomError:ie,ExtendableError:r};return t.CustomError=ie,t.ExtendableError=r,t.default=ue,Object.defineProperty(t,"__esModule",{value:!0}),t}({});