Options
All
  • Public
  • Public/Protected
  • All
Menu

Some utilities, no biggie.

Hierarchy

  • Utils

Index

Constructors

Methods

  • deepCopy<T>(obj: T): T
  • getRandomArrayElement<T>(array: T[]): T
  • Returns a random element of an array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to get the element from.

    Returns T

  • initializeArray<T>(length: number, initialValue?: T): T[]
  • Creates an array with specific length that's prefilled with an initial value.

    Type Parameters

    • T

    Parameters

    • length: number

      The length of the array.

    • Optional initialValue: T

      The initial value of each array value.

    Returns T[]

  • sleep(duration: number): Promise<void>
  • Pauses the execution of a function for the specified duration.

    Parameters

    • duration: number

      The duration to pause for, in seconds.

    Returns Promise<void>

Generated using TypeDoc