Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/object/mapKeysByFunction

Index

Functions

Functions

Const mapKeysByFunction

  • mapKeysByFunction<T>(obj: Record<any, T>, mapper: Function): Record<any, T>
  • mapKeysByFunction this method creates an object with the same values as object and keys generated by running each own enumerable string keyed property of object thru mapper.

    example

    mapKeysByFunction({ 'a': 1, 'b': 2 }, (value, key) => key + value); // returns { 'a1': 1, 'b2': 2 }

    Type parameters

    • T: object

    Parameters

    • obj: Record<any, T>
    • mapper: Function

    Returns Record<any, T>

    {Record<any, T>}

Generated using TypeDoc