mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Move TextLineStream to foxts, adopt skipEmptyLines
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import fs from 'node:fs';
|
||||
import readline from 'node:readline';
|
||||
|
||||
import { TextLineStream } from './text-line-transform-stream';
|
||||
import { TextLineStream } from 'foxts/text-line-stream';
|
||||
import type { ReadableStream } from 'node:stream/web';
|
||||
import { TextDecoderStream } from 'node:stream/web';
|
||||
import { processLine, ProcessLineStream } from './process-line';
|
||||
@@ -31,7 +31,7 @@ export const createReadlineInterfaceFromResponse: ((resp: UndiciResponseData | U
|
||||
|
||||
const resultStream = webStream
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new TextLineStream());
|
||||
.pipeThrough(new TextLineStream({ skipEmptyLines: processLine }));
|
||||
|
||||
if (processLine) {
|
||||
return resultStream.pipeThrough(new ProcessLineStream());
|
||||
|
||||
Reference in New Issue
Block a user