mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Remove unused codes
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import fs from 'node:fs';
|
||||
import fsp from 'node:fs/promises';
|
||||
import type { FileHandle } from 'node:fs/promises';
|
||||
import readline from 'node:readline';
|
||||
|
||||
import { TextLineStream } from './text-line-transform-stream';
|
||||
@@ -19,11 +17,6 @@ export function readFileByLine(file: string): AsyncIterable<string> {
|
||||
});
|
||||
}
|
||||
|
||||
const fdReadLines = (fd: FileHandle) => fd.readLines();
|
||||
export async function readFileByLineNew(file: string): Promise<AsyncIterable<string>> {
|
||||
return fsp.open(file, 'r').then(fdReadLines);
|
||||
}
|
||||
|
||||
export const createReadlineInterfaceFromResponse: ((resp: UndiciResponseData | UnidiciWebResponse, processLine?: boolean) => ReadableStream<string>) = (resp, processLine = false) => {
|
||||
invariant(resp.body, 'Failed to fetch remote text');
|
||||
if ('bodyUsed' in resp && resp.bodyUsed) {
|
||||
|
||||
Reference in New Issue
Block a user