Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/defaults

Index

References

Interfaces

Functions

References

Renames and re-exports defaults

Functions

  • defaults<T1, T2>(a: T1, b: T2): T1 & T2
  • defaults<T1, T2, T3>(a: T1, b: T2, c: T3): T1 & T2 & T3
  • defaults<T1>(a: T1): { <T2, T3>(b: T2, c: T3): T1 & T2 & T3; <T2>(b: T2): T1 & T2 }
  • defaults<T>(...args: T[]): T
  • Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined. Source objects are applied from left to right.

    Once a property is set, additional values of the same property are ignored.

    example
     defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); //=> { 'user': 'barney', 'age': 36 }
    

    Type parameters

    • T1

    • T2

    Parameters

    • a: T1
    • b: T2

    Returns T1 & T2

  • Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined. Source objects are applied from left to right.

    Once a property is set, additional values of the same property are ignored.

    example
     defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); //=> { 'user': 'barney', 'age': 36 }
    

    Type parameters

    • T1

    • T2

    • T3

    Parameters

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

    Returns T1 & T2 & T3

  • Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined. Source objects are applied from left to right.

    Once a property is set, additional values of the same property are ignored.

    example
     defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); //=> { 'user': 'barney', 'age': 36 }
    

    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

  • Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined. Source objects are applied from left to right.

    Once a property is set, additional values of the same property are ignored.

    example
     defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); //=> { 'user': 'barney', 'age': 36 }
    

    Type parameters

    • T

    Parameters

    • Rest ...args: T[]

    Returns T

Generated using TypeDoc