deploy: 3ff28ca32ff4aaa3ed9957ccfde252e5448c561b

This commit is contained in:
SukkaBot
2022-08-21 13:16:17 +00:00
parent 3f8a84f6b6
commit 37cd36f06a
3 changed files with 2416 additions and 626 deletions

View File

@@ -8,13 +8,30 @@ exports.dedupe = ({ chunk }) => {
for (const domainFromFullSet of workerData) {
if (domainFromFullSet === domainFromInput) continue;
if (domainFromFullSet.charAt(0) !== '.') continue;
// domainFromFullSet is now startsWith a "."
if (
(domainFromInput.charAt(0) !== '.' && `.${domainFromInput}` === domainFromFullSet)
|| domainFromInput.endsWith(domainFromFullSet)
) {
outputToBeRemoved.add(domainFromInput);
break;
if (domainFromInput.charAt(0) !== '.') {
let shouldBeRemoved = true;
for (let j = 0, l2 = domainFromInput.length; j < l2; j++) {
if (domainFromFullSet.charAt(j + 1) !== domainFromInput.charAt(j)) {
shouldBeRemoved = false;
break;
}
}
if (shouldBeRemoved) {
outputToBeRemoved.add(domainFromInput);
break;
}
}
// domainFromInput is now startsWith a "."
if (domainFromInput.length >= domainFromFullSet.length) {
if (domainFromInput.endsWith(domainFromFullSet)) {
outputToBeRemoved.add(domainFromInput);
break;
}
}
}
}