Function invert
- invert<T>(record): InvertResult<T>
Type Parameters
Parameters
- record: Readonly<T>
The record to invert.
Returns InvertResult<T>
A new record with all keys and values inverted.
- record: Readonly<T>
The record to invert.
A new record with all keys and values inverted.
Composes a new record with all keys and values inverted.
If the record contains duplicate values, subsequent values overwrite property assignments of previous values. If the record contains values which aren't PropertyKeys their string representation is used as the key.