Created
February 18, 2019 07:22
-
-
Save anshumanvenkatesh/b939eaab100451cb0236f22a666697d7 to your computer and use it in GitHub Desktop.
Revisions
-
anshumanvenkatesh created this gist
Feb 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ const invertObject = x => { let sol = {} R.mapObjIndexed((val, key, obj) => { R.map(type => { if (type in sol) { sol[type].push(key); } else { sol[type] = [key] } })(val) }, x) return sol }