joaonuno flat-to-nested-js