lbry-desktop/ui/util/swap-json.js

10 lines
176 B
JavaScript
Raw Permalink Normal View History

2018-11-21 22:20:55 +01:00
export function swapKeyAndValue(dict) {
const ret = {};
for (const key in dict) {
if (dict.hasOwnProperty(key)) {
ret[dict[key]] = key;
}
}
return ret;
}