Chore: process line stream

This commit is contained in:
SukkaW
2024-11-26 21:22:14 +08:00
parent e2920de2fa
commit f64fa201e9
12 changed files with 67 additions and 43 deletions

View File

@@ -19,7 +19,7 @@ export function extractDomainsFromFelixDnsmasq(line: string): string | null {
export async function parseFelixDnsmasqFromResp(resp: NodeFetchResponse | UndiciResponseData | Response): Promise<string[]> {
const results: string[] = [];
for await (const line of createReadlineInterfaceFromResponse(resp)) {
for await (const line of createReadlineInterfaceFromResponse(resp, true)) {
const domain = extractDomainsFromFelixDnsmasq(line);
if (domain && isDomainLoose(domain)) {
results.push(domain);