@@ -152,6 +152,7 @@ const {
152152 setHasStartedUserCJSExecution,
153153 stripBOM,
154154 toRealPath,
155+ stripTypeScriptTypes,
155156} = require ( 'internal/modules/helpers' ) ;
156157const packageJsonReader = require ( 'internal/modules/package_json_reader' ) ;
157158const { getOptionValue, getEmbedderOptions } = require ( 'internal/options' ) ;
@@ -1362,7 +1363,6 @@ function loadESMFromCJS(mod, filename) {
13621363 if ( isUnderNodeModules ( filename ) ) {
13631364 throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING ( filename ) ;
13641365 }
1365- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
13661366 source = stripTypeScriptTypes ( source , filename ) ;
13671367 }
13681368 const cascadedLoader = require ( 'internal/modules/esm/loader' ) . getOrInitializeCascadedLoader ( ) ;
@@ -1576,7 +1576,6 @@ function loadCTS(module, filename) {
15761576 throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING ( filename ) ;
15771577 }
15781578 const source = getMaybeCachedSource ( module , filename ) ;
1579- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
15801579 const code = stripTypeScriptTypes ( source , filename ) ;
15811580 module . _compile ( code , filename , 'commonjs' ) ;
15821581}
@@ -1592,7 +1591,6 @@ function loadTS(module, filename) {
15921591 }
15931592 // If already analyzed the source, then it will be cached.
15941593 const source = getMaybeCachedSource ( module , filename ) ;
1595- const { stripTypeScriptTypes } = require ( 'internal/modules/helpers' ) ;
15961594 const content = stripTypeScriptTypes ( source , filename ) ;
15971595 let format ;
15981596 const pkg = packageJsonReader . getNearestParentPackageJSON ( filename ) ;
0 commit comments