@kamilmielnik/trie
Version:
Trie data structure implementation in TypeScript. Highly performant. No dependencies. Built for a Scrabble Solver.
10 lines (9 loc) • 402 B
TypeScript
/**
* Comparator that allows sorting {@link Node} keys alphabetically
* with the exception of "wordEnd" which should always come first.
*
* @param key1 - First key to compare.
* @param key2 - Second key to compare.
* @returns -1 if key1 should precede key2, 0 if they're the same, 1 if key2 should precede key1.
*/
export declare const nodeKeyComparator: (key1: string, key2: string) => number;