Housekeeping & Make ESLint Happy

This commit is contained in:
SukkaW
2026-07-29 12:42:58 +08:00
parent 36ceefd3a3
commit 55870db2bc
10 changed files with 39 additions and 23 deletions

View File

@@ -9,7 +9,8 @@ import { xxhash3 } from 'hash-wasm';
const hashMap = new Map<string, Set<string>>();
const runHash = async (inputs: string[]) => {
for (const input of inputs) {
for (let i = 0, len = inputs.length; i < len; i++) {
const input = inputs[i];
const hash = await xxhash3(input);
if (!hashMap.has(hash)) {
hashMap.set(hash, new Set());
@@ -23,7 +24,8 @@ import { xxhash3 } from 'hash-wasm';
.crawl(OUTPUT_SURGE_DIR)
.withPromise();
for (const file of files) {
for (let i = 0, len = files.length; i < len; i++) {
const file = files[i];
const fullpath = path.join(OUTPUT_SURGE_DIR, file);
if (file.startsWith('domainset' + path.sep)) {
await runHash((await readFileIntoProcessedArray(fullpath)).map(i => (i[0] === '.' ? i.slice(1) : i)));