Function deepMerge

  • Deep Merge Objects

    Type Parameters

    • Obj extends Record<any, any>[]

    Parameters

    • Rest ...objects: Obj

    Returns UnionToIntersection<Obj[number]>

    Example

    import { object } from "@rjweb/utils"

    object.deepMerge({ ok: true, e: { g: 0 }, items: ['hi'] }, { ok: false, e: 213, items: ['ok'] }) // { ok: false, e: 213, items: ['hi', 'ok'] }
    object.deepMerge({ ok: true, e: 'hello', { ok: false, e: { g: 1 } }, { ok: true, e: { g: 2 } }) // { ok: true, e: { g: 2 } }

    Since

    1.12.7

    Supports

    nodejs, browser