123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- Object.defineProperty(exports, '__esModule', { value: true });
- const objectToString = Object.prototype.toString;
- function isError(wat) {
- switch (objectToString.call(wat)) {
- case '[object Error]':
- case '[object Exception]':
- case '[object DOMException]':
- return true;
- default:
- return isInstanceOf(wat, Error);
- }
- }
- function isBuiltin(wat, className) {
- return objectToString.call(wat) === `[object ${className}]`;
- }
- function isErrorEvent(wat) {
- return isBuiltin(wat, 'ErrorEvent');
- }
- function isDOMError(wat) {
- return isBuiltin(wat, 'DOMError');
- }
- function isDOMException(wat) {
- return isBuiltin(wat, 'DOMException');
- }
- function isString(wat) {
- return isBuiltin(wat, 'String');
- }
- function isParameterizedString(wat) {
- return (
- typeof wat === 'object' &&
- wat !== null &&
- '__sentry_template_string__' in wat &&
- '__sentry_template_values__' in wat
- );
- }
- function isPrimitive(wat) {
- return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');
- }
- function isPlainObject(wat) {
- return isBuiltin(wat, 'Object');
- }
- function isEvent(wat) {
- return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
- }
- function isElement(wat) {
- return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
- }
- function isRegExp(wat) {
- return isBuiltin(wat, 'RegExp');
- }
- function isThenable(wat) {
-
- return Boolean(wat && wat.then && typeof wat.then === 'function');
- }
- function isSyntheticEvent(wat) {
- return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
- }
- function isNaN(wat) {
- return typeof wat === 'number' && wat !== wat;
- }
- function isInstanceOf(wat, base) {
- try {
- return wat instanceof base;
- } catch (_e) {
- return false;
- }
- }
- function isVueViewModel(wat) {
-
- return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue));
- }
- exports.isDOMError = isDOMError;
- exports.isDOMException = isDOMException;
- exports.isElement = isElement;
- exports.isError = isError;
- exports.isErrorEvent = isErrorEvent;
- exports.isEvent = isEvent;
- exports.isInstanceOf = isInstanceOf;
- exports.isNaN = isNaN;
- exports.isParameterizedString = isParameterizedString;
- exports.isPlainObject = isPlainObject;
- exports.isPrimitive = isPrimitive;
- exports.isRegExp = isRegExp;
- exports.isString = isString;
- exports.isSyntheticEvent = isSyntheticEvent;
- exports.isThenable = isThenable;
- exports.isVueViewModel = isVueViewModel;
|