Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,21 @@
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}`));
}