MCPcopy Index your code
hub / github.com/rollup/plugins / getRoot

Function getRoot

packages/typescript/src/index.ts:119–122  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

117 // Different roots (e.g., drive letters on Windows) cannot be in a parent/child relationship.
118 // Normalize Windows drive-letter case before comparison to avoid false mismatches.
119 const getRoot = (p: string) => {
120 const r = path.parse(p).root;
121 return process.platform === 'win32' ? r.toLowerCase() : r;
122 };
123 if (getRoot(effectiveOutDir) !== getRoot(baseForContainment)) return false;
124 const rel = path.relative(effectiveOutDir, baseForContainment);
125 // rel === '' -> same dir; absolute or '..' => outside

Callers 1

typescriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected