MCPcopy
hub / github.com/jestjs/jest / relative

Function relative

packages/jest-haste-map/src/lib/fast_path.ts:11–15  ·  view source on GitHub ↗
(rootDir: string, filename: string)

Source from the content-addressed store, hash-verified

9
10// rootDir and filename must be absolute paths (resolved)
11export function relative(rootDir: string, filename: string): string {
12 return filename.startsWith(rootDir + path.sep)
13 ? filename.slice(rootDir.length + 1)
14 : path.relative(rootDir, filename);
15}
16
17const INDIRECTION_FRAGMENT = `..${path.sep}`;
18

Callers 2

fast_path.test.jsFile · 0.90
getCacheKeyFunctionFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected