lbry-desktop/ui/util/swap-json.js
2019-11-11 13:27:29 -05:00

10 lines
176 B
JavaScript

export function swapKeyAndValue(dict) {
const ret = {};
for (const key in dict) {
if (dict.hasOwnProperty(key)) {
ret[dict[key]] = key;
}
}
return ret;
}