(filePath: string)
| 67 | ) |
| 68 | |
| 69 | const readFileBuffer = (filePath: string): T.Effect<OT.HasTracer, ReadFileError | FileNotFoundError, Buffer> => |
| 70 | OT.withSpan('readFileBuffer', { attributes: { filePath } })( |
| 71 | T.tryCatchPromise( |
| 72 | () => fs.readFile(filePath), |
| 73 | (error: any) => { |
| 74 | if (error.code === 'ENOENT') { |
| 75 | return new FileNotFoundError({ filePath }) |
| 76 | } else { |
| 77 | return new ReadFileError({ filePath, error }) |
| 78 | } |
| 79 | }, |
| 80 | ), |
| 81 | ) |
| 82 | |
| 83 | const readFileJson = <T extends JsonValue = JsonValue>( |
| 84 | filePath: string, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…