super-utils-plus
Version:
A superior alternative to Lodash with improved performance, TypeScript support, and developer experience
17 lines (16 loc) • 666 B
TypeScript
/**
* Creates an object composed of the inverted keys and values of object.
*
* @param object - The object to invert
* @returns The inverted object
*/
export declare function invert<T extends object>(object: T): Record<string, string>;
/**
* This method is like `invert` except that the inverted object is generated
* from the results of running each element of object through iteratee.
*
* @param object - The object to invert
* @param iteratee - The iteratee invoked per element
* @returns The grouped inverted object
*/
export declare function invertBy<T extends object>(object: T, iteratee?: (value: T[keyof T]) => string): Record<string, string[]>;