(p: string)
| 9 | import * as path from 'path'; |
| 10 | |
| 11 | export function resolvePath(p: string): string { |
| 12 | if (!p) { |
| 13 | return ''; |
| 14 | } |
| 15 | let expandedPath = p; |
| 16 | if (p.toLowerCase().startsWith('%userprofile%')) { |
| 17 | expandedPath = os.homedir() + p.substring('%userprofile%'.length); |
| 18 | } else if (p === '~' || p.startsWith('~/')) { |
| 19 | expandedPath = os.homedir() + p.substring(1); |
| 20 | } |
| 21 | return path.normalize(expandedPath); |
| 22 | } |
nothing calls this directly
no outgoing calls
no test coverage detected