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

Function getNodeModuleRootSpecifier

test/fixtures/snapshot/typescript.js:129319–129326  ·  view source on GitHub ↗
(fullSpecifier)

Source from the content-addressed store, hash-verified

129317 }
129318 }
129319 function getNodeModuleRootSpecifier(fullSpecifier) {
129320 var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
129321 // Scoped packages
129322 if (ts.startsWith(components[0], "@")) {
129323 return "".concat(components[0], "/").concat(components[1]);
129324 }
129325 return components[0];
129326 }
129327 }
129328 ts.createPackageJsonImportFilter = createPackageJsonImportFilter;
129329 function tryParseJson(text) {

Calls 2

concatMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected