Options
All
  • Public
  • Public/Protected
  • All
Menu

Module mapValues

Index

References

Functions Object

References

Renames and re-exports __type

Object Functions

  • mapValues<T>(object: PlainObject<T>, iteratee: KeyIteratee): PlainObject
  • mapValues<T>(object: PlainObject<T>, iteratee: CollectionIteratee<T, any>): PlainObject
  • Creates an object with the same keys as object and values generated by running each own enumerable string keyed property of object thru iteratee. The iteratee is invoked with three arguments: (value, key, object).

    since

    5.11.0

    see

    mapKeys

    example
    const users = {
    'fred': { 'user': 'fred', 'age': 40 },
    'pebbles': { 'user': 'pebbles', 'age': 1 }
    }

    mapValue(users, ({ age }) => age)
    // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)

    Type parameters

    • T

    Parameters

    • object: PlainObject<T>

      The object to iterate over.

    • iteratee: KeyIteratee

      The function invoked per iteration.

    Returns PlainObject

    Returns the new mapped object.

  • Type parameters

    • T

    Parameters

    • object: PlainObject<T>
    • iteratee: CollectionIteratee<T, any>

    Returns PlainObject