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