mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Remove unused Bun.peek
This commit is contained in:
@@ -44,7 +44,6 @@ const getBunBlob = (file: string | URL | BunFile) => {
|
||||
return file;
|
||||
};
|
||||
|
||||
// @ts-expect-error -- ReadableStream<string> should be AsyncIterable<string>
|
||||
export const readFileByLine: ((file: string | URL | BunFile) => AsyncIterable<string>) = enableTextLineStream
|
||||
? (file: string | URL | BunFile) => getBunBlob(file).stream().pipeThrough(new PolyfillTextDecoderStream()).pipeThrough(new TextLineStream())
|
||||
: (file: string | URL | BunFile) => createTextLineAsyncIterableFromStreamSource(getBunBlob(file).stream());
|
||||
@@ -59,7 +58,6 @@ const ensureResponseBody = (resp: Response) => {
|
||||
return resp.body;
|
||||
};
|
||||
|
||||
// @ts-expect-error -- ReadableStream<string> should be AsyncIterable<string>
|
||||
export const createReadlineInterfaceFromResponse: ((resp: Response) => AsyncIterable<string>) = enableTextLineStream
|
||||
? (resp) => ensureResponseBody(resp).pipeThrough(new PolyfillTextDecoderStream()).pipeThrough(new TextLineStream())
|
||||
: (resp) => createTextLineAsyncIterableFromStreamSource(ensureResponseBody(resp));
|
||||
|
||||
Reference in New Issue
Block a user