mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: minor changes
This commit is contained in:
@@ -6,7 +6,7 @@ import { TextLineStream } from 'foxts/text-line-stream';
|
||||
import { ProcessLineStream } from './process-line';
|
||||
|
||||
// eslint-disable-next-line sukka/unicorn/custom-error-definition -- typescript is better
|
||||
export class CustomAbortError extends Error {
|
||||
class CustomAbortError extends Error {
|
||||
public readonly name = 'AbortError';
|
||||
public readonly digest = 'AbortError';
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { createReadlineInterfaceFromResponse } from './fetch-text-by-line';
|
||||
|
||||
import type { UndiciResponseData } from './fetch-retry';
|
||||
import type { Response } from 'undici';
|
||||
import { fastNormalizeDomain } from './normalize-domain';
|
||||
|
||||
export function extractDomainsFromFelixDnsmasq(line: string): string | null {
|
||||
if (line.startsWith('server=/') && line.endsWith('/114.114.114.114')) {
|
||||
@@ -16,7 +15,7 @@ export async function parseFelixDnsmasqFromResp(resp: UndiciResponseData | Respo
|
||||
|
||||
for await (const line of createReadlineInterfaceFromResponse(resp, true)) {
|
||||
const domain = extractDomainsFromFelixDnsmasq(line);
|
||||
if (domain && fastNormalizeDomain(domain)) {
|
||||
if (domain) {
|
||||
results.push(domain);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user