MCPcopy
hub / github.com/angular/angular / relativeFrom

Function relativeFrom

packages/compiler-cli/src/ngtsc/file_system/src/helpers.ts:52–58  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

50 * Convert the path `path` to a `PathSegment`, throwing an error if it's not a relative path.
51 */
52export function relativeFrom(path: string): PathSegment {
53 const normalized = normalizeSeparators(path);
54 if (fs.isRooted(normalized)) {
55 throw new Error(`Internal Error: relativeFrom(${path}): path is not relative`);
56 }
57 return normalized as PathSegment;
58}
59
60/**
61 * Static access to `dirname`.

Calls 2

normalizeSeparatorsFunction · 0.90
isRootedMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…