fsearch = node => {
  const next = (char: string) => {
    if (node && node.children[char]) {
      return fsearch(node.children[char]);
    }

    return null;
  };

  next.leaf = node.leaf;

  return next;
}
A very basic trie with functional,recursive search