• 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)

      The function to produce the updated value.

        • (oldValue): any
        • Parameters

          • oldValue: any

          Returns any

    • Optional customizer: SetWithCustomizer<T>

      The function to customize assigned values.

    Returns T

    Returns object.

    Since

    4.6.0

    Example

    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)
        • (oldValue): any
        • Parameters

          • oldValue: any

          Returns any

    • Optional customizer: SetWithCustomizer<T>

    Returns TResult

    See

    _.updateWith

Generated using TypeDoc