Tweakr
    Preparing search index...

    Function mapValuesDeep

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

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        Source object

      • mapper: (value: any, key: string) => any

        Function applied to each value

      Returns any

      A new object with mapped values

      mapValuesDeep({ a: 1, nested: { b: 2 } }, val => val * 2);
      // => { a: 2, nested: { b: 4 } }

      1.2.0