(params: {
filePath: string
fs: CodebuffFileSystem
})
| 254 | * Uses fs.stat instead of Bun-specific fs.exists. |
| 255 | */ |
| 256 | export async function fileExists(params: { |
| 257 | filePath: string |
| 258 | fs: CodebuffFileSystem |
| 259 | }): Promise<boolean> { |
| 260 | const { filePath, fs } = params |
| 261 | |
| 262 | try { |
| 263 | await fs.stat(filePath) |
| 264 | return true |
| 265 | } catch { |
| 266 | return false |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | export const ensureDirectoryExists = async (params: { |
| 271 | baseDir: string |
no outgoing calls
no test coverage detected