Takaro - v0.4.11
    Preparing search index...

    Function updateWith

    • This method is like _.update except that it accepts customizer which is invoked to produce the objects of path. If customizer returns undefined path creation is handled by the method instead. The customizer is invoked with three arguments: (nsValue, key, nsObject).

      Note: This method mutates object.

      Type Parameters

      • T extends object

      Parameters

      • object: T

        The object to modify.

      • path: PropertyPath

        The path of the property to set.

      • updater: (oldValue: any) => any

        The function to produce the updated value.

      • Optionalcustomizer: SetWithCustomizer<T>

        The function to customize assigned values.

      Returns T

      Returns object.

      4.6.0

      var object = {};

      _.updateWith(object, '[0][1]', _.constant('a'), Object);
      // => { '0': { '1': 'a' } }
    • Type Parameters

      • T extends object
      • TResult

      Parameters

      • object: T
      • path: PropertyPath
      • updater: (oldValue: any) => any
      • Optionalcustomizer: SetWithCustomizer<T>

      Returns TResult

      _.updateWith