node-utils.js 828 B

12345678910111213141516171819202122
  1. var {
  2. _optionalChain
  3. } = require('@sentry/utils');
  4. Object.defineProperty(exports, '__esModule', { value: true });
  5. /**
  6. * Check if Sentry auto-instrumentation should be disabled.
  7. *
  8. * @param getCurrentHub A method to fetch the current hub
  9. * @returns boolean
  10. */
  11. function shouldDisableAutoInstrumentation(getCurrentHub) {
  12. // eslint-disable-next-line deprecation/deprecation
  13. const clientOptions = _optionalChain([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);
  14. const instrumenter = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.instrumenter]) || 'sentry';
  15. return instrumenter !== 'sentry';
  16. }
  17. exports.shouldDisableAutoInstrumentation = shouldDisableAutoInstrumentation;
  18. //# sourceMappingURL=node-utils.js.map