Fixed 267U.pre2
This commit is contained in:
@@ -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}`));
|
||||
}
|
||||
Reference in New Issue
Block a user