mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Rrefactor: rewrite trie in class
This commit is contained in:
@@ -10,19 +10,16 @@ import { processLine } from './lib/process-line';
|
||||
import { DomainsetOutput } from './lib/create-file';
|
||||
|
||||
const getS3OSSDomainsPromise = (async (): Promise<string[]> => {
|
||||
const trie = createTrie(
|
||||
(await getPublicSuffixListTextPromise()).reduce<string[]>(
|
||||
(acc, cur) => {
|
||||
const tmp = processLine(cur);
|
||||
if (tmp) {
|
||||
acc.push(tmp);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
),
|
||||
true
|
||||
);
|
||||
const trie = createTrie((await getPublicSuffixListTextPromise()).reduce<string[]>(
|
||||
(acc, cur) => {
|
||||
const tmp = processLine(cur);
|
||||
if (tmp) {
|
||||
acc.push(tmp);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
));
|
||||
|
||||
/**
|
||||
* Extract OSS domain from publicsuffix list
|
||||
|
||||
Reference in New Issue
Block a user