import { fetchMeta } from "./fetch-meta.js";
/**
 * Returns whether a specific host (punycoded) should be blocked.
 *
 * @param host punycoded instance host
 * @param meta a resolved Meta table
 * @returns whether the given host should be blocked
 */ export async function shouldBlockInstance(host, meta) {
    const { blockedHosts } = meta ?? await fetchMeta();
    return blockedHosts.some((blockedHost)=>host === blockedHost || host.endsWith(`.${blockedHost}`));
}
/**
 * Returns whether a specific host (punycoded) should be limited.
 *
 * @param host punycoded instance host
 * @param meta a resolved Meta table
 * @returns whether the given host should be limited
 */ export async function shouldSilenceInstance(host, meta) {
    const { silencedHosts } = meta ?? await fetchMeta();
    return silencedHosts.some((silencedHost)=>host === silencedHost || host.endsWith(`.${silencedHost}`));
}
