MCPcopy
hub / github.com/meteor/meteor / getNodeModulesAbsModuleId

Method getNodeModulesAbsModuleId

tools/isobuild/import-scanner.ts:1393–1414  ·  view source on GitHub ↗
(absPath: string)

Source from the content-addressed store, hash-verified

1391 }
1392
1393 private getNodeModulesAbsModuleId(absPath: string) {
1394 let absModuleId: string | undefined;
1395
1396 this.nodeModulesPaths.some(path => {
1397 const relPathWithinNodeModules = pathRelative(path, absPath);
1398
1399 if (relPathWithinNodeModules.startsWith("..")) {
1400 // absPath is not a subdirectory of path.
1401 return false;
1402 }
1403
1404 // Install the module into the local node_modules directory within
1405 // this app or package.
1406 absModuleId = pathJoin(
1407 "node_modules",
1408 relPathWithinNodeModules
1409 );
1410 return true;
1411 });
1412
1413 return absModuleId && ensureLeadingSlash(absModuleId);
1414 }
1415
1416 private getSourceRootAbsModuleId(absPath: string) {
1417 const relPath = pathRelative(this.sourceRoot, absPath);

Callers 1

getAbsModuleIdMethod · 0.95

Calls 3

pathRelativeFunction · 0.85
pathJoinFunction · 0.85
ensureLeadingSlashFunction · 0.85

Tested by

no test coverage detected