UNPKG

@kamilmielnik/trie

Version:

Trie data structure implementation in TypeScript. Highly performant. No dependencies. Built for a Scrabble Solver.

12 lines (11 loc) 458 B
import type { Node } from '../types'; /** * Tells you whether there are any words with given prefix in the {@link Node}. * * See: https://en.wikipedia.org/wiki/String_operations#Prefixes * * @param node - {@link Node} to look for prefix in. * @param prefix - Prefix to be found. * @returns true if there are any words with given prefix in the {@link Node}, false otherwise. */ export declare const hasPrefix: (node: Node, prefix: string) => boolean;