@@ -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' ) ;
@@ -1362,7 +1363,6 @@ function loadESMFromCJS(mod, filename) {
1362
1363
if ( isUnderNodeModules ( filename ) ) {
1363
1364
throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING ( filename ) ;
1364
1365
}
1365
- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
1366
1366
source = stripTypeScriptTypes ( source , filename ) ;
1367
1367
}
1368
1368
const cascadedLoader = require ( 'internal/modules/esm/loader' ) . getOrInitializeCascadedLoader ( ) ;
@@ -1576,7 +1576,6 @@ function loadCTS(module, filename) {
1576
1576
throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING ( filename ) ;
1577
1577
}
1578
1578
const source = getMaybeCachedSource ( module , filename ) ;
1579
- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
1580
1579
const code = stripTypeScriptTypes ( source , filename ) ;
1581
1580
module . _compile ( code , filename , 'commonjs' ) ;
1582
1581
}
@@ -1592,7 +1591,6 @@ function loadTS(module, filename) {
1592
1591
}
1593
1592
// If already analyzed the source, then it will be cached.
1594
1593
const source = getMaybeCachedSource ( module , filename ) ;
1595
- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
1596
1594
const content = stripTypeScriptTypes ( source , filename ) ;
1597
1595
let format ;
1598
1596
const pkg = packageJsonReader . getNearestParentPackageJSON ( filename ) ;
0 commit comments