Remove unused Bun.peek

This commit is contained in:
SukkaW
2024-06-03 11:56:11 +08:00
parent 6e32af4dc8
commit 7167be852f
8 changed files with 8 additions and 24 deletions

View File

@@ -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));