invertKeyValues<T>(obj): Record<string, string>
反转对象的键值对 而不会改变它。使用 Object.keys() 和 Array.reduce() 来反转对象的键值对。
| Name | Type |
|---|---|
T |
extends Record<string, string | number> |
| Name | Type | Description |
|---|---|---|
obj |
T |
需要反转键值对的对象 |
Record<string, string>
反转键值对后的新对象
Example