This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trie.js - super simple JS implementation | |
// https://en.wikipedia.org/wiki/Trie | |
// From https://gist.github.com/tpae/72e1c54471e88b689f85ad2b3940a8f0 | |
// Modified to support key -> value mapping for quick object retrieval, | |
// using an ES6 Map instead of plain JS object, and optional case insensitivity. | |
// Values are automatically converting to arrays to support multiple values | |
// mapped to a single tree leaf. | |
// Example: |