MCPcopy
hub / github.com/jonaskello/tsconfig-paths / getStrippedPath

Function getStrippedPath

src/try-path.ts:59–69  ·  view source on GitHub ↗
(tryPath: TryPath)

Source from the content-addressed store, hash-verified

57
58// Not sure why we don't just return the full found path?
59export function getStrippedPath(tryPath: TryPath): string {
60 return tryPath.type === "index"
61 ? dirname(tryPath.path)
62 : tryPath.type === "file"
63 ? tryPath.path
64 : tryPath.type === "extension"
65 ? removeExtension(tryPath.path)
66 : tryPath.type === "package"
67 ? tryPath.path
68 : exhaustiveTypeException(tryPath.type);
69}
70
71export function exhaustiveTypeException(check: never): never {
72 throw new Error(`Unknown type ${check}`);

Callers

nothing calls this directly

Calls 2

removeExtensionFunction · 0.90
exhaustiveTypeExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…