Housekeeping

This commit is contained in:
SukkaW
2026-08-20 22:54:47 +08:00
parent 53634aab1d
commit b1d0f4bcc2
6 changed files with 66 additions and 65 deletions

View File

@@ -4,6 +4,7 @@ import { OUTPUT_SURGE_DIR } from './constants/dir';
import path from 'node:path';
import { readFileIntoProcessedArray } from './lib/fetch-text-by-line';
import { xxhash3 } from 'hash-wasm';
import { split1st } from 'foxts/split-nth';
(async () => {
const hashMap = new Map<string, Set<string>>();
@@ -30,7 +31,7 @@ import { xxhash3 } from 'hash-wasm';
if (file.startsWith('domainset' + path.sep)) {
await runHash((await readFileIntoProcessedArray(fullpath)).map(i => (i[0] === '.' ? i.slice(1) : i)));
} else if (file.startsWith('non_ip' + path.sep)) {
await runHash((await readFileIntoProcessedArray(fullpath)).map(i => i.split(',', 2)[1]));
await runHash((await readFileIntoProcessedArray(fullpath)).map(i => split1st(i, ',')));
}
}