MCPcopy Index your code
hub / github.com/nodejs/node / isNodeModulesOrScopedPackageDirectory

Function isNodeModulesOrScopedPackageDirectory

test/fixtures/snapshot/typescript.js:20468–20470  ·  view source on GitHub ↗
(s, getCanonicalFileName)

Source from the content-addressed store, hash-verified

20466 // KLUDGE: Don't assume one 'node_modules' links to another. More likely a single directory inside the node_modules is the symlink.
20467 // ALso, don't assume that an `@foo` directory is linked. More likely the contents of that are linked.
20468 function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
20469 return s !== undefined && (getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@"));
20470 }
20471 function stripLeadingDirectorySeparator(s) {
20472 return ts.isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : undefined;
20473 }

Callers 1

guessDirectorySymlinkFunction · 0.85

Calls 1

getCanonicalFileNameFunction · 0.85

Tested by

no test coverage detected