node-utils.js 728 B

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