UNPKG

@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.

23 lines (20 loc) 857 B
import constants, { LEVEL_DEBUG, LEVEL_CRITICAL } from './constant.js'; var VALID_LEVELS = constants; 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[LEVEL_DEBUG] && VALID_LEVELS[level] <= VALID_LEVELS[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); } export { isRollbarInstance, isValidLevel, value }; //# sourceMappingURL=utils.js.map