Tweakr
    Preparing search index...

    Function mapKeysDeep

    • Recursively maps the keys of an object using the mapper function.

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        Source object

      • mapper: (key: string) => string

        Function applied to each key

      Returns any

      A new object with mapped keys

      mapKeysDeep({ a: 1, nested: { b: 2 } }, key => key.toUpperCase());
      // => { A: 1, NESTED: { B: 2 } }

      1.2.0