Minor Updates
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.6) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled

This commit is contained in:
SukkaW
2025-05-23 18:32:06 +08:00
parent 25666b7348
commit ae90b2b0f4
3 changed files with 102 additions and 89 deletions

View File

@@ -36,9 +36,10 @@ const pool = new Worktank({
const { loosTldOptWithPrivateDomains } = __require('../constants/loose-tldts-opt') as typeof import('../constants/loose-tldts-opt');
const { BLACK_TLD, WHITELIST_MAIN_DOMAINS, leathalKeywords, lowKeywords, sensitiveKeywords } = __require('../constants/phishing-score-source') as typeof import('../constants/phishing-score-source');
const NullPrototypeObject = __require('null-prototype-object') as typeof import('null-prototype-object');
const domainCountMap = new Map<string, number>();
const domainScoreMap: Record<string, number> = Object.create(null);
const domainScoreMap: Record<string, number> = new NullPrototypeObject();
let line = '';
let tld: string | null = '';
@@ -85,9 +86,11 @@ const pool = new Worktank({
: 1
);
let score = apexDomain in domainScoreMap ? domainScoreMap[apexDomain] : 0;
let score = 0;
if (!(apexDomain in domainScoreMap)) {
if (apexDomain in domainScoreMap) {
score = domainScoreMap[apexDomain];
} else {
if (BLACK_TLD.has(tld)) {
score += 3;
} else if (tld.length > 6) {