mirror of
https://github.com/SukkaW/Surge.git
synced 2026-09-12 10:34:35 +08:00
Housekeeping & Make ESLint Happy
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user