(filePath: string)
| 40 | } |
| 41 | |
| 42 | const stat = (filePath: string): T.Effect<unknown, FileNotFoundError | StatError, Stats> => { |
| 43 | return T.tryCatchPromise( |
| 44 | async () => fs.stat(filePath), |
| 45 | (error: any) => { |
| 46 | if (error.code === 'ENOENT') { |
| 47 | return new FileNotFoundError({ filePath }) |
| 48 | } else { |
| 49 | return new StatError({ filePath, error }) |
| 50 | } |
| 51 | }, |
| 52 | ) |
| 53 | } |
| 54 | |
| 55 | const readFile = (filePath: string): T.Effect<OT.HasTracer, ReadFileError | FileNotFoundError, string> => |
| 56 | OT.withSpan('readFile', { attributes: { filePath } })( |
no outgoing calls
no test coverage detected
searching dependent graphs…