mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Minor changes here and there
This commit is contained in:
parent
bdc3955ac6
commit
5c8636d7b3
@ -28,8 +28,8 @@ export const buildParseDomainMap = (inputs: string[]) => {
|
||||
|
||||
export const sortDomains = (
|
||||
inputs: string[],
|
||||
domainMap?: Map<string, string>,
|
||||
subdomainMap?: Map<string, string>
|
||||
domainMap?: Map<string, string> | null,
|
||||
subdomainMap?: Map<string, string> | null
|
||||
) => {
|
||||
if (!domainMap || !subdomainMap) {
|
||||
const { domainMap: dm, subdomainMap: sm } = buildParseDomainMap(inputs);
|
||||
|
||||
@ -369,12 +369,16 @@ export const createTrie = <Meta = any>(from?: string[] | Set<string> | null, smo
|
||||
: false;
|
||||
};
|
||||
|
||||
const dump = () => {
|
||||
function dump(onSuffix: (suffix: string) => void): void;
|
||||
function dump(): string[];
|
||||
function dump(onSuffix?: (suffix: string) => void): string[] | void {
|
||||
const results: string[] = [];
|
||||
|
||||
walk(suffix => {
|
||||
results.push(fastStringArrayJoin(suffix, ''));
|
||||
});
|
||||
const handleSuffix = onSuffix
|
||||
? (suffix: string[]) => onSuffix(fastStringArrayJoin(suffix, ''))
|
||||
: (suffix: string[]) => results.push(fastStringArrayJoin(suffix, ''));
|
||||
|
||||
walk(handleSuffix);
|
||||
|
||||
return results;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user