File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,8 @@ export function getCurrentHub(): Hub {
454
454
*/
455
455
function getHubFromActiveDomain ( registry : Carrier ) : Hub {
456
456
try {
457
- const domain = require ( 'domain' ) ;
457
+ const req = require ;
458
+ const domain = req ( 'domain' ) ;
458
459
const activeDomain = domain . active ;
459
460
460
461
// If there no active domain, just return global hub
Original file line number Diff line number Diff line change @@ -20,16 +20,6 @@ interface SentryGlobal {
20
20
} ;
21
21
}
22
22
23
- /**
24
- * Requires a module which is protected against bundler minification.
25
- *
26
- * @param request The module path to resolve
27
- */
28
- export function dynamicRequire ( mod : any , request : string ) : any {
29
- // tslint:disable-next-line: no-unsafe-any
30
- return mod . require ( request ) ;
31
- }
32
-
33
23
/**
34
24
* Checks whether we're in the Node.js or Browser environment
35
25
*
@@ -375,7 +365,8 @@ const performanceFallback: CrossPlatformPerformance = {
375
365
export const crossPlatformPerformance : CrossPlatformPerformance = ( ( ) => {
376
366
if ( isNodeEnv ( ) ) {
377
367
try {
378
- const perfHooks = dynamicRequire ( module , 'perf_hooks' ) as { performance : CrossPlatformPerformance } ;
368
+ const req = require ;
369
+ const perfHooks = req ( 'perf_hooks' ) as { performance : CrossPlatformPerformance } ;
379
370
return perfHooks . performance ;
380
371
} catch ( _ ) {
381
372
return performanceFallback ;
You can’t perform that action at this time.
0 commit comments