@rollbar/react
Version:
Effortlessly track and debug errors in your React applications with Rollbar. This package includes advanced error tracking features and a set of React-specific enhancements to help you identify and fix issues more quickly.
27 lines (23 loc) • 922 B
JavaScript
;
var constant = require('./constant.js');
var VALID_LEVELS = constant.default;
function value(val, defaultTo) {
if (typeof val === 'function') {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
return val.apply(void 0, args);
}
return val;
}
function isValidLevel(level) {
return VALID_LEVELS[level] >= VALID_LEVELS[constant.LEVEL_DEBUG] && VALID_LEVELS[level] <= VALID_LEVELS[constant.LEVEL_CRITICAL];
}
function isRollbarInstance(instance) {
var _instance$options;
return !!(instance !== null && instance !== void 0 && (_instance$options = instance.options) !== null && _instance$options !== void 0 && _instance$options.accessToken);
}
exports.isRollbarInstance = isRollbarInstance;
exports.isValidLevel = isValidLevel;
exports.value = value;
//# sourceMappingURL=utils.js.map