blob: 27f9cbb8eaf281a1cc1300a23798ce4fdf74c174 [file] [log] [blame]
'use strict';
module.exports = object => {
if (typeof object !== 'object') {
throw new TypeError('Expected an object');
}
const ret = {};
for (const key of Object.keys(object)) {
const value = object[key];
ret[value] = key;
}
return ret;
};