• Use mapKeys to convert object keys to another format using the specified conversion function.

    E.g., to deep convert all object keys to camelCase: mapKeys(myObj, _.camelCase, true) to shallow convert object keys to lower case: mapKeys(myObj, _.toLower)

    NOTE: This mutates the object passed in for conversion.

    Type Parameters

    • T


    • obj: T
    • converter: ((key) => string)

      {Function} The function that converts the object key

        • (key): string
        • Parameters

          • key: string

          Returns string

    • Optional deep: boolean

      {boolean} Whether to do a deep object key conversion

    Returns Record<string, unknown>

    • the object with the converted keys