Function deepExtend

  • Experimental

    Deep extends an object with a list of extensors. No deep properties from base will be ever subscribed. The order of extensors define it's priority, the lower the index, the higher the priority.

    Example

    const extended = deepExtend(
    { a: 1, b: null, d: { bar: 'this bar should be here' } },
    { a: 2, b: 2, c: 'foo', d: { bar: 'foo', foobar: 'ok too' } },
    { d: { foo: 'bar' }, f: 'f', g: [{ bondia: 'bondia' }] }
    )

    console.log(extended)
    // > { a: 1, b: null, d: { bar: 'this bar should be here', foobar: 'ok too', foo: 'bar' }, c: 'foo', f: 'f', g: [ { bondia: 'bondia' } ] }

    Type Parameters

    • T extends object

    • E extends object

    Parameters

    • base: T

      The base object to be extended

    • Rest ...extensors: E[]

      The extensors to inherit properties

    Returns T & Record<string, any>

Generated using TypeDoc