MCPcopy Create free account
hub / github.com/nodejs/node / allowsImportingSourceFile

Function allowsImportingSourceFile

test/fixtures/snapshot/typescript.js:129271–129280  ·  view source on GitHub ↗
(sourceFile, moduleSpecifierResolutionHost)

Source from the content-addressed store, hash-verified

129269 || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier);
129270 }
129271 function allowsImportingSourceFile(sourceFile, moduleSpecifierResolutionHost) {
129272 if (!packageJsons.length) {
129273 return true;
129274 }
129275 var moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost);
129276 if (!moduleSpecifier) {
129277 return true;
129278 }
129279 return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier);
129280 }
129281 function allowsImportingSpecifier(moduleSpecifier) {
129282 if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) {
129283 return true;

Callers

nothing calls this directly

Tested by

no test coverage detected