@newdash/newdash
Version:
javascript/typescript utility library
21 lines (20 loc) • 541 B
TypeScript
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @since 5.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* ```js
* const object = { 'a': 1, 'b': 2, 'c': 1 }
*
* invert(object)
* // => { '1': 'c', '2': 'b' }
* ```
*/
export declare function invert<T>(object: T): any;
export default invert;