Function mapValues

  • Creates an object with the same keys as object and values generated by running each own enumerable string keyed property of object thru iteratee.

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 16,189 bytes
    • Micro-dash: 120 bytes

    Type Parameters

    • A extends readonly any[]
    • O

    Parameters

    • array: Nil | A
    • iteratee: ((item, index) => O)
        • (item, index): O
        • Parameters

          • item: A[number]
          • index: number

          Returns O

    Returns Record<number, O>

  • Type Parameters

    • T
    • O

    Parameters

    • object: T
    • iteratee: ObjectIteratee<NonNullable<T>, O>

    Returns IfCouldBe<T, Nil, {}> | Record<keyof NonNullable<T>, O>