(path: string)
| 78 | * Note: ~username expansion is not supported for security reasons. |
| 79 | */ |
| 80 | export function expandTilde(path: string): string { |
| 81 | if ( |
| 82 | path === '~' || |
| 83 | path.startsWith('~/') || |
| 84 | (process.platform === 'win32' && path.startsWith('~\\')) |
| 85 | ) { |
| 86 | return homedir() + path.slice(1) |
| 87 | } |
| 88 | return path |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Checks if a resolved path is writable according to the sandbox write allowlist. |
no outgoing calls
no test coverage detected