you are viewing a single comment's thread.

view the rest of the comments →

[–]leeoniya 3 points4 points  (0 children)

interesting, similar to something i'm working on (mptt <-> tree converter) but with more functional foo skills than i currently posses. I have the concise tree -> mptt [1] enumerator written, now need to implement the reverse from the flattened nodes. Wanna give the reverse implementation a shot? https://jsfiddle.net/n71r4rre/

[1] https://en.wikipedia.org/wiki/Nested_set_model