Perf: use tldts-experimental when possible

This commit is contained in:
SukkaW
2024-05-26 04:32:08 +08:00
parent db6786a0d6
commit 1288460c48
9 changed files with 32 additions and 24 deletions

View File

@@ -1,8 +1,8 @@
import { fetchRemoteTextByLine } from './fetch-text-by-line';
import { parse } from 'tldts';
import { parse as tldtsParse } from 'tldts';
const isDomainLoose = (domain: string): boolean => {
const { isIcann, isPrivate, isIp } = parse(domain);
const { isIcann, isPrivate, isIp } = tldtsParse(domain);
return !!(!isIp && (isIcann || isPrivate));
};