Files
todo-frontend/node_modules/invert-kv/index.js
Agent d12eea7693
Some checks failed
continuous-integration/drone/push Build is failing
fix: 微信登录补充保存username和role
2026-04-04 07:35:21 +00:00

21 lines
392 B
JavaScript

'use strict';
module.exports = object => {
if (typeof object !== 'object' || object === null) {
throw new TypeError('Expected an object');
}
const result = {};
for (const [key, value] of Object.entries(object)) {
result[value] = key;
}
for (const symbol of Object.getOwnPropertySymbols(object)) {
const value = object[symbol];
result[value] = symbol;
}
return result;
};