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

Function allowsImportingSpecifier

test/fixtures/snapshot/typescript.js:129281–129289  ·  view source on GitHub ↗
(moduleSpecifier)

Source from the content-addressed store, hash-verified

129279 return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier);
129280 }
129281 function allowsImportingSpecifier(moduleSpecifier) {
129282 if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) {
129283 return true;
129284 }
129285 if (ts.pathIsRelative(moduleSpecifier) || ts.isRootedDiskPath(moduleSpecifier)) {
129286 return true;
129287 }
129288 return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier);
129289 }
129290 function isAllowedCoreNodeModulesImport(moduleSpecifier) {
129291 // If we’re in JavaScript, it can be difficult to tell whether the user wants to import
129292 // from Node core modules or not. We can start by seeing if the user is actually using

Callers 1

compareModuleSpecifiersFunction · 0.85

Tested by

no test coverage detected