aswi2020vldc-gitlab/templetes/node_modules/invert-kv/index.js @ ae1ff627
1 |
'use strict'; |
---|---|
2 |
module.exports = object => { |
3 |
if (typeof object !== 'object') { |
4 |
throw new TypeError('Expected an object'); |
5 |
}
|
6 | |
7 |
const ret = {}; |
8 | |
9 |
for (const key of Object.keys(object)) { |
10 |
const value = object[key]; |
11 |
ret[value] = key; |
12 |
}
|
13 | |
14 |
return ret; |
15 |
};
|