Options
All
  • Public
  • Public/Protected
  • All
Menu

Module main

Index

Functions

  • deepCopy<T>(variable: T): T
  • Performs a deep copy of a variable. Only plain objects and arrays are deeply copied.

    Type parameters

    • T

    Parameters

    • variable: T

      Variable to deeply copy.

    Returns T

    Variable's deep copy.

  • deepMerge<T1, T2>(firstObject: T1, secondObject: T2, mergeArrays?: boolean): T1 & T2
  • Performs a deep merge of two plain objects. Only plain objects and arrays are deeply copied.

    throws

    {Error} If one of the arguments is not a plain object.

    Type parameters

    • T1 = PlainObject

    • T2 = PlainObject

    Parameters

    • firstObject: T1

      First object.

    • secondObject: T2

      Second object.

    • mergeArrays: boolean = false

    Returns T1 & T2

    A new object resulting of merging of the two others.

  • isPlainObject<T>(variable: T): boolean
  • Returns true if the given variable is a plain object, false otherwise.

    Type parameters

    • T

    Parameters

    • variable: T

      Variable to check against.

    Returns boolean

    true if the variable is a plain object, false otherwise.

Generated using TypeDoc