mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Refactor: migrate to undici fetch
This commit is contained in:
@@ -4,7 +4,6 @@ import { createReadlineInterfaceFromResponse } from './fetch-text-by-line';
|
||||
// In short, single label domain suffix is ignored due to the size optimization, so no isIcann
|
||||
// import tldts from 'tldts-experimental';
|
||||
import tldts from 'tldts';
|
||||
import type { NodeFetchResponse } from './make-fetch-happen';
|
||||
import type { UndiciResponseData } from './fetch-retry';
|
||||
import type { Response } from 'undici';
|
||||
|
||||
@@ -20,7 +19,7 @@ export function extractDomainsFromFelixDnsmasq(line: string): string | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function parseFelixDnsmasqFromResp(resp: NodeFetchResponse | UndiciResponseData | Response): Promise<string[]> {
|
||||
export async function parseFelixDnsmasqFromResp(resp: UndiciResponseData | Response): Promise<string[]> {
|
||||
const results: string[] = [];
|
||||
|
||||
for await (const line of createReadlineInterfaceFromResponse(resp, true)) {
|
||||
|
||||
Reference in New Issue
Block a user