(file: string)
| 11 | import { invariant } from 'foxts/guard'; |
| 12 | |
| 13 | export function readFileByLine(file: string): AsyncIterable<string> { |
| 14 | return readline.createInterface({ |
| 15 | input: fs.createReadStream(file/* , { encoding: 'utf-8' } */), |
| 16 | crlfDelay: Infinity |
| 17 | }); |
| 18 | } |
| 19 | |
| 20 | export const createReadlineInterfaceFromResponse: ((resp: UndiciResponseData | UnidiciWebResponse, processLine?: boolean) => ReadableStream<string>) = (resp, processLine = false) => { |
| 21 | invariant(resp.body, 'Failed to fetch remote text'); |
no outgoing calls
no test coverage detected