@akashrajpurohit/utils
    Preparing search index...

    Function mapObjectValues

    • Returns a new object with the same keys as the input object, but with the values mapped using the provided function.

      Type Parameters

      • T
      • U

      Parameters

      • obj: Record<string, T>

        The input object to map.

      • mapper: (value: T) => U

        A function that maps the values of the object.

      Returns Record<string, U>

      A new object with the mapped values.

      mapObjectValues({ a: 1, b: 2 }, value => value * 2) // { a: 2, b: 4 }