Comment Comment by konsumer I made this to do similar, it goes both ways: https://github.com/konsumer/jsflat parent konsumer 7 years ago