is-error-x
Version:
Detect whether a value is an error.
15 lines • 12.4 kB
JavaScript
/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2015-2017",
"date": "2019-08-28T17:27:38.620Z",
"describe": "",
"description": " Detect whether a value is an error.",
"file": "is-error-x.min.js",
"hash": "4938522584727ecad24e",
"license": "MIT",
"version": "2.1.2"
}
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.isErrorX=e():t.isErrorX=e()}(function(){"use strict";var t,e={}.constructor,n=e.prototype,r=e.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return r?r(n,"$$globalThis$$",{get:i,configurable:!0}):n.__defineGetter__("$$globalThis$$",i),t="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete n.$$globalThis$$,t}catch(t){return o()}}(),function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";var r=Object.prototype.toString;if(n(2)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object String]"===o.call(t))}},function(t,e,n){"use strict";(function(e){var r=e.Symbol,o=n(4);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,e,n){"use strict";function r(t){return(r="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)}n.r(e);var o=function(t){return"object"===r(t)?null===t:"function"!=typeof t},i=n(1),c=n.n(i),u={}.constructor("a"),s="a"===u[0]&&0 in u,f=function(){}.bind,p="function"==typeof f&&function(){var t=null,e=null,n=null,r=[];try{var o=f.apply(function(r,o){return n=this,t=r,e=o,arguments},[r,1]),i=o(2);return 1===o.length&&2===i.length&&1===t&&2===e&&n===r}catch(t){return!1}}()&&function(){var t=null,e=null,n=null,r=[1,2,3],o=function(o,i){return t=o,e=i,n=this,r};try{var i=f.apply(o,[null]),c=new i(1,2);return i.length===o.length&&c===r&&1===t&&2===e&&n!==r}catch(t){return!1}}(),a="".split,l=Math.max,y=o.bind,d=o.call,b=p?y.call(d,a):function(t,e){return a.call(t,e)},g=function(t){return c()(t)?b(t,""):t},h=function(t,e){var n=arguments.length>2?arguments[2]:[];if("string"!=typeof t&&o(t))return n;for(var r=s?t:g(t),i=r.length,c=l(0,e)||0;c<i;c+=1)n[n.length]=t[c];return n};function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var c,u=t[Symbol.iterator]();!(r=(c=u.next()).done)&&(n.push(c.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var v=h.bind,S=h.call,w={},j=w.constructor,O=w.toString,$=function(t,e){return t>=e?t:e},T=function(t){if("function"!=typeof t&&"[object Function]"!==O.apply(t))throw new TypeError("bind called on incompatible "+t)},x=[function(t){return function(){return t.apply(this,h(arguments))}},function(t,e){return function(n){return t.apply(this,h(arguments,e,[n]))}},function(t,e){return function(n,r){return t.apply(this,h(arguments,e,[n,r]))}},function(t,e){return function(n,r,o){return t.apply(this,h(arguments,e,[n,r,o]))}},function(t,e){return function(n,r,o,i){return t.apply(this,h(arguments,e,[n,r,o,i]))}},function(t,e){return function(n,r,o,i,c){return t.apply(this,h(arguments,e,[n,r,o,i,c]))}},function(t,e){return function(n,r,o,i,c,u){return t.apply(this,h(arguments,e,[n,r,o,i,c,u]))}},function(t,e){return function(n,r,o,i,c,u,s){return t.apply(this,h(arguments,e,[n,r,o,i,c,u,s]))}},function(t,e){return function(n,r,o,i,c,u,s,f){return t.apply(this,h(arguments,e,[n,r,o,i,c,u,s,f]))}}],E=function(t){var e=m(t,3),n=e[0],r=e[1],o=e[2],i=$(0,r.length-$(0,o.length-2)),c=x[i],u=c?c(n,i):x[0](n);if(r.prototype){var s=function(){};s.prototype=r.prototype,u.prototype=new s,s.prototype=null}return u},P=function(t,e){var n=t.apply(this,e);return j(n)===n?n:this},_=p?S.bind(v):function(t,e){T(t);var n,r=arguments,o=function(){var o=h(arguments,0,h(r,2));return this instanceof n?P.apply(this,[t,o]):t.apply(e,o)};return n=E([o,t,r])},F=TypeError,M=_.apply,k=_(_.call,M),C=_(M,{}.toString),N=function(t){if("function"!=typeof t&&"[object Function]"!==C(t))throw new F(t+" is not a function");return t},A=function(t,e){return k(N(t),e,h(arguments[2]))},I={}.toString,q=function(t){return function(t){if("function"!=typeof t&&"[object Function]"!==A(I,t))throw new TypeError("methodize called on incompatible "+t)}(t),function(){return A(t,arguments[0],h(arguments,1))}},D=q({}.toString),G=function(t){return null===t?"[object Null]":void 0===t?"[object Undefined]":D(t)},L=function(t){try{return{threw:!1,value:A(t,this,h(arguments,1))}}catch(t){return{threw:!0,value:t}}},X=function(t){return!!t},z=n(0),B=n.n(z);for(var H=L(function(){return function(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&B()(Symbol(""))}.bind(void 0)),R=!1===H.threw&&!0===H.value&&B()(Symbol.toStringTag),U=function(t){return null==t},V=function(t){if(U(t))throw new TypeError("Cannot call method on ".concat(t));return t},J="Cannot convert a Symbol value to a string".constructor,K=function(t){if(B()(t))throw new TypeError("Cannot convert a Symbol value to a string");return J(t)},Q=function(t){return K(V(t))},W=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],Y="",Z=W.length,tt=0;tt<Z;tt+=1)W[tt].es2016&&W[tt].string,W[tt].es2018&&(Y+=W[tt].string);var et=Y,nt=new(0,/none/.constructor)("^[".concat(et,"]+")),rt=q("".replace),ot=function(t){return rt(Q(t),nt,"")},it=new(0,/none/.constructor)("[".concat(et,"]+$")),ct=q("".replace),ut=function(t){return ct(Q(t),it,"")},st=function(t){return ot(ut(t))},ft=new(0,/none/.constructor)("[".concat(et,"]+"),"g"),pt=q(" ".replace),at=function(t){return pt(st(t),ft," ")},lt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,yt=q("".replace),dt=function(t,e){return yt(Q(t),lt,arguments.length>1?K(e):"")},bt=L.constructor,gt=q(L.toString),ht=/^class /,mt=q(ht.test),vt=!1===L(function(){return bt('"use strict"; return class My {};')()}).threw,St=function(t){return mt(ht,at(dt(gt(t)," ")))},wt=function(t){var e=L(St,t);return!1===e.threw&&e.value},jt=function(t,e){return!o(t)&&(R?function(t,e){return!(vt&&!1===e&&wt(t)||!1!==L(function(){return gt(t)}).threw)}(t,X(e)):(!vt||!1!==X(e)||!wt(t))&&function(t){var e=G(t);return"[object Function]"===e||"[object GeneratorFunction]"===e||"[object AsyncFunction]"===e}(t))},Ot=function(t){return!1===o(t)&&!1===jt(t,!0)},$t={}.constructor,Tt=function(t){return $t(V(t))},xt={}.constructor,Et=xt.getPrototypeOf,Pt=X(Et)&&function(){var t={},e=function(){};e.prototype=t;var n=new e;try{return Et(n)===t}catch(t){return!1}}()?function(t){return Et(Tt(t))}:function(t){var e=Tt(t),n=e.__proto__;return n||null===n?n:jt(e.constructor)?e.constructor.prototype:e instanceof xt?xt.prototype:null},_t=function(t){return"[object Error]"===G(t)};if(!1===_t(Error.prototype)){var Ft=Error.prototype,Mt=_t;_t=function(t){return t===Ft||Mt(t)}}e.default=function(t){if(!1===Ot(t))return!1;for(var e=t,n=100;e&&n>-1;){if(_t(e))return!0;e=Pt(e),n-=1}return!1}}])});
//# sourceMappingURL=is-error-x.min.js.map