@@ -152,6 +152,7 @@ const {
152
152
setHasStartedUserCJSExecution,
153
153
stripBOM,
154
154
toRealPath,
155
+ stripTypeScriptTypes,
155
156
} = require ( 'internal/modules/helpers' ) ;
156
157
const packageJsonReader = require ( 'internal/modules/package_json_reader' ) ;
157
158
const { getOptionValue, getEmbedderOptions } = require ( 'internal/options' ) ;
@@ -1373,7 +1374,6 @@ function loadESMFromCJS(mod, filename) {
1373
1374
if ( isUnderNodeModules ( filename ) ) {
1374
1375
throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING ( filename ) ;
1375
1376
}
1376
- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
1377
1377
source = stripTypeScriptTypes ( source , filename ) ;
1378
1378
}
1379
1379
const cascadedLoader = require ( 'internal/modules/esm/loader' ) . getOrInitializeCascadedLoader ( ) ;
@@ -1587,7 +1587,6 @@ function loadCTS(module, filename) {
1587
1587
throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING ( filename ) ;
1588
1588
}
1589
1589
const source = getMaybeCachedSource ( module , filename ) ;
1590
- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
1591
1590
const code = stripTypeScriptTypes ( source , filename ) ;
1592
1591
module . _compile ( code , filename , 'commonjs' ) ;
1593
1592
}
@@ -1603,7 +1602,6 @@ function loadTS(module, filename) {
1603
1602
}
1604
1603
// If already analyzed the source, then it will be cached.
1605
1604
const source = getMaybeCachedSource ( module , filename ) ;
1606
- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
1607
1605
const content = stripTypeScriptTypes ( source , filename ) ;
1608
1606
let format ;
1609
1607
const pkg = packageJsonReader . getNearestParentPackageJSON ( filename ) ;
0 commit comments