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 }