Travis build: 1358 [cron]

This commit is contained in:
30secondsofcode
2018-01-23 20:11:51 +00:00
parent 7999ad6271
commit ac8f842b93
30 changed files with 509 additions and 36 deletions

View File

@ -1,6 +1,8 @@
const invertKeyValues = obj =>
const invertKeyValues = (obj, fn) =>
Object.keys(obj).reduce((acc, key) => {
acc[obj[key]] = key;
const val = fn ? fn(obj[key]) : obj[key];
acc[val] = acc[val] || [];
acc[val].push(key);
return acc;
}, {});
module.exports = invertKeyValues