• Creates an object with keys generated by running the provided function for each key and the same values as the provided object

    Example

    mapKeys({ a: 1, b: 2 }, (val, key) => key + val); // { a1: 1, b2: 2 }
    

    Type Parameters

    • T extends Record<string, unknown>

    • K extends string | number | symbol

    Parameters

    • obj: T
    • fn: ((value: T[K], key: K, object: T) => string)
        • (value: T[K], key: K, object: T): string
        • Parameters

          • value: T[K]
          • key: K
          • object: T

          Returns string

    Returns Record<string, unknown>

Generated using TypeDoc