(tryPath: TryPath)
| 57 | |
| 58 | // Not sure why we don't just return the full found path? |
| 59 | export 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 | |
| 71 | export function exhaustiveTypeException(check: never): never { |
| 72 | throw new Error(`Unknown type ${check}`); |
nothing calls this directly
no test coverage detected
searching dependent graphs…