(root: string, source: string, target?: string)
| 31 | export function resolvePath(source: string, target: string): string; |
| 32 | export function resolvePath(root: string, source: string, target: string): string; |
| 33 | export function resolvePath(root: string, source: string, target?: string): string { |
| 34 | if (target === undefined) (target = source), (source = root), (root = "."); |
| 35 | const path = join(root, target === "" ? source : target.startsWith("/") ? "." : dirname(source), target); |
| 36 | return path.startsWith("../") ? path : join("/", path); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Like resolvePath, except returns null if the specified target goes outside |
no outgoing calls
no test coverage detected