(filePath: string, cwd: string)
| 98 | * Resolves a file path, handling ~, relative paths, etc. |
| 99 | */ |
| 100 | export function resolveFilePath(filePath: string, cwd: string): string { |
| 101 | const normalized = normalizeUserProvidedPath(filePath) |
| 102 | if (normalized.startsWith('~')) { |
| 103 | return path.join(homedir(), normalized.slice(1)) |
| 104 | } |
| 105 | if (path.isAbsolute(normalized)) { |
| 106 | return normalized |
| 107 | } |
| 108 | return path.resolve(cwd, normalized) |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Attempts to compress an image to fit within the max base64 size. |
no test coverage detected