© 2026 Hedgehog Software, LLC
export function doesFileExist(inputFile: BunFile) { return pipe( inputFile, file => Effect.tryPromise({ try: () => file.exists(), catch: () => new FileNotFound() }), Effect.flatMap(v => { return v // Return the input file of the parent function ? Effect.succeed(inputFile) : Effect.fail(new FileNotFound()) }) ) }
pipe(file, doesFileExist, readFile)