mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-05-10 04:35:14 +02:00
15 lines
436 B
TypeScript
15 lines
436 B
TypeScript
import {Match, matches} from "./matches";
|
|
import {getAllDisabled, getDisabled} from "../store/store";
|
|
|
|
export async function getMatch(host: string): Promise<Match | undefined> {
|
|
if (await getAllDisabled()) {
|
|
return undefined
|
|
}
|
|
|
|
for (const match of matches) {
|
|
if (match.domains.some(v => host.indexOf(v) !== -1) && !((await getDisabled()).some(v => v === match))) {
|
|
return match
|
|
}
|
|
}
|
|
}
|