Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 542 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 542 Bytes

RadixTree JS

License: MIT

Idiomatic implementation of the Radix trie data structure that can function as a drop-in replacement for Map and comes with built-in converter to RegExp regular expression. E.g.:

new RadixTree(["zbxad", "zcrad", "zbad", "zad", "ad", "z"]).toString()

Produces neat:

z((cr)?ad|bx?ad)?|ad

Unlike Map, the keys can only be strings though, but this should come as fairly obvious.