sussy-util
Version:
Util package made by me
12 lines (11 loc) • 610 B
TypeScript
/**
* Maps the properties of an object to a new object using a mapper function.
*
* @template T - The type of the input object.
* @template R - The type of the mapped values in the output object.
* @param {T} obj - The input object to be mapped.
* @param {(value: T[keyof T], key: keyof T, object: T) => R} mapper - The function that maps each property value.
* @returns {{ [K in keyof T]: R }} - A new object with mapped properties.
*/
declare const _default: <T extends object, R>(obj: T, mapper: (value: T[keyof T], key: keyof T, object: T) => R) => { [K in keyof T]: R; };
export default _default;