Chore: Housekeeping & Make ESLint Happy

This commit is contained in:
SukkaW
2024-09-29 11:01:16 +08:00
parent 8c655582ee
commit 14bcc10ce7
14 changed files with 294 additions and 333 deletions

View File

@@ -34,9 +34,7 @@ const deepTrieNodeToJSON = (
return obj;
};
const createNode = <Meta = any>(parent: TrieNode | null = null): TrieNode => {
return [false, parent, new Map<string, TrieNode>(), null] as TrieNode<Meta>;
};
const createNode = <Meta = any>(parent: TrieNode | null = null): TrieNode => [false, parent, new Map<string, TrieNode>(), null] as TrieNode<Meta>;
export const hostnameToTokens = (hostname: string): string[] => {
const tokens = hostname.split('.');
@@ -227,9 +225,7 @@ export const createTrie = <Meta = any>(from?: string[] | Set<string> | null, smo
return { node, parent };
};
const contains = (suffix: string): boolean => {
return walkIntoLeafWithSuffix(suffix) !== null;
};
const contains = (suffix: string): boolean => walkIntoLeafWithSuffix(suffix) !== null;
const walk = (
onMatches: (suffix: string[], meta: Meta) => void,