Forked from bakit/crawler
Forked from bakit/crawler
src / utils / domainFilter.ts
import { BLOCKED_DOMAINS } from "./constants";
export function isBlockedDomain(url: string): boolean {
try {
const hostname = new URL(url).hostname.toLowerCase().replace(/^www\./, "");
return BLOCKED_DOMAINS.has(hostname);
} catch {
return false;
}
}
src / utils / domainFilter.ts
import { BLOCKED_DOMAINS } from "./constants";
export function isBlockedDomain(url: string): boolean {
try {
const hostname = new URL(url).hostname.toLowerCase().replace(/^www\./, "");
return BLOCKED_DOMAINS.has(hostname);
} catch {
return false;
}
}