Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/merge

Index

References

Interfaces

Functions

References

Renames and re-exports merge

Functions

  • merge<T1, T2>(a: T1, b: T2): T1 & T2
  • merge<T1, T2, T3>(a: T1, b: T2, c: T3): T1 & T2 & T3
  • merge<T1>(a: T1): { <T2, T3>(b: T2, c: T3): T1 & T2 & T3; <T2>(b: T2): T1 & T2 }
  • merge<T>(...args: T[]): T
  • Create a new object with the own properties of the first object merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    example
     merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 }); //=> { 'name': 'fred', 'age': 40 }
    

    Type parameters

    • T1

    • T2

    Parameters

    • a: T1
    • b: T2

    Returns T1 & T2

  • Create a new object with the own properties of the first object merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    example
     merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 }); //=> { 'name': 'fred', 'age': 40 }
    

    Type parameters

    • T1

    • T2

    • T3

    Parameters

    • a: T1
    • b: T2
    • c: T3

    Returns T1 & T2 & T3

  • Create a new object with the own properties of the first object merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    example
     merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 }); //=> { 'name': 'fred', 'age': 40 }
    

    Type parameters

    • T1

    Parameters

    • a: T1

    Returns { <T2, T3>(b: T2, c: T3): T1 & T2 & T3; <T2>(b: T2): T1 & T2 }

      • <T2, T3>(b: T2, c: T3): T1 & T2 & T3
      • <T2>(b: T2): T1 & T2
      • Type parameters

        • T2

        • T3

        Parameters

        • b: T2
        • c: T3

        Returns T1 & T2 & T3

      • Type parameters

        • T2

        Parameters

        • b: T2

        Returns T1 & T2

  • Create a new object with the own properties of the first object merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    example
     merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 }); //=> { 'name': 'fred', 'age': 40 }
    

    Type parameters

    • T

    Parameters

    • Rest ...args: T[]

    Returns T

Generated using TypeDoc