File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/node/src/integrations Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,21 @@ import { dirname, join } from 'path';
4
4
5
5
let moduleCache : { [ key : string ] : string } ;
6
6
7
+ /** Extract information about paths */
8
+ function getPaths ( ) : string [ ] {
9
+ try {
10
+ return require . cache ? Object . keys ( require . cache as Record < string , unknown > ) : [ ] ;
11
+ } catch ( e ) {
12
+ return [ ] ;
13
+ }
14
+ }
15
+
7
16
/** Extract information about package.json modules */
8
17
function collectModules ( ) : {
9
18
[ name : string ] : string ;
10
19
} {
11
20
const mainPaths = ( require . main && require . main . paths ) || [ ] ;
12
- const paths = require . cache ? Object . keys ( require . cache as Record < string , unknown > ) : [ ] ;
21
+ const paths = getPaths ( ) ;
13
22
const infos : {
14
23
[ name : string ] : string ;
15
24
} = { } ;
You can’t perform that action at this time.
0 commit comments