Simple Tree Utils is the library to convert and manipulate with tree-like structures.
simple-tree-utils.netlify.app
Raiper34/tree-utils