(path: string)
| 27 | * @returns The tildeified path. |
| 28 | */ |
| 29 | export function tildeifyPath(path: string): string { |
| 30 | const homeDir = os.homedir(); |
| 31 | if (path.startsWith(homeDir)) { |
| 32 | return path.replace(homeDir, '~'); |
| 33 | } |
| 34 | return path; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Shortens a path string if it exceeds maxLen, prioritizing the start and end segments. |
no outgoing calls
no test coverage detected