• Recursively merges own enumerable string keyed properties of source objects into the destination object. Object properties are merged recursively. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

    Note: This function mutates object.

    Differences from lodash:

    • will overwrite a value with undefined
    • only supports arguments that are objects
    • cannot handle circular references
    • when merging an array onto a non-array, the result is a non-array

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 11,996 bytes
    • Micro-dash: 426 bytes

    Type Parameters

    • A extends object
    • B extends object

    Parameters

    • object: A
    • source: B

    Returns A & B

  • Type Parameters

    • A extends object
    • B extends object
    • C extends object

    Parameters

    • object: A
    • source1: B
    • source2: C

    Returns A & B & C

  • Type Parameters

    • A extends object
    • B extends object
    • C extends object
    • D extends object

    Parameters

    • object: A
    • source1: B
    • source2: C
    • source3: D

    Returns A & B & C & D

  • Type Parameters

    • A extends object
    • B extends object
    • C extends object
    • D extends object
    • E extends object

    Parameters

    • object: A
    • source1: B
    • source2: C
    • source3: D
    • source4: E

    Returns A & B & C & D & E

  • Type Parameters

    • A extends object
    • B extends object
    • C extends object
    • D extends object
    • E extends object
    • F extends object

    Parameters

    • object: A
    • source1: B
    • source2: C
    • source3: D
    • source4: E
    • source5: F

    Returns A & B & C & D & E & F

  • Type Parameters

    • T extends object

    Parameters

    • object: T
    • Rest ...sources: Partial<T>[]

    Returns T