mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-16 11:10:33 +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 = (
|
export const sortDomains = (
|
||||||
inputs: string[],
|
inputs: string[],
|
||||||
domainMap?: Map<string, string>,
|
domainMap?: Map<string, string> | null,
|
||||||
subdomainMap?: Map<string, string>
|
subdomainMap?: Map<string, string> | null
|
||||||
) => {
|
) => {
|
||||||
if (!domainMap || !subdomainMap) {
|
if (!domainMap || !subdomainMap) {
|
||||||
const { domainMap: dm, subdomainMap: sm } = buildParseDomainMap(inputs);
|
const { domainMap: dm, subdomainMap: sm } = buildParseDomainMap(inputs);
|
||||||
|
|||||||
@ -369,12 +369,16 @@ export const createTrie = <Meta = any>(from?: string[] | Set<string> | null, smo
|
|||||||
: false;
|
: false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dump = () => {
|
function dump(onSuffix: (suffix: string) => void): void;
|
||||||
|
function dump(): string[];
|
||||||
|
function dump(onSuffix?: (suffix: string) => void): string[] | void {
|
||||||
const results: string[] = [];
|
const results: string[] = [];
|
||||||
|
|
||||||
walk(suffix => {
|
const handleSuffix = onSuffix
|
||||||
results.push(fastStringArrayJoin(suffix, ''));
|
? (suffix: string[]) => onSuffix(fastStringArrayJoin(suffix, ''))
|
||||||
});
|
: (suffix: string[]) => results.push(fastStringArrayJoin(suffix, ''));
|
||||||
|
|
||||||
|
walk(handleSuffix);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user