Options
All
  • Public
  • Public/Protected
  • All
Menu

The utils module contains various utility interfaces and functions.

Index

Functions

  • assertNotNull<T>(value: T, propertyName: string, listy?: boolean): void
  • Type parameters

    • T

    Parameters

    • value: T
    • propertyName: string
    • listy: boolean = false

    Returns void

  • combineUrl(...parts: string[]): string
  • Combines the given parts and returns them as an URL, avoiding duplicate slashes.

    Parameters

    • Rest ...parts: string[]

    Returns string

  • flatten<T>(array: T[][]): T[]
  • Flattens an array of arrays of items of type T, returning a single array that consists of the concatenation of the original arrays.

    Type parameters

    • T

    Parameters

    • array: T[][]

    Returns T[]

  • isBrowser(): boolean
  • Returns boolean

  • isObject(data: any): boolean
  • Parameters

    • data: any

    Returns boolean

  • randomUuid(): string
  • Generates a random UUID to set the ID of an element or unit to. There is no intrinsic ID collision detection/avoidance mechanism but it's good enough in practice.

    Returns string

  • removeFromArray<T>(list: T[], item: T): void
  • Type parameters

    • T

    Parameters

    • list: T[]
    • item: T

    Returns void

  • shallowEquals(first: any[], second: any[]): boolean
  • Parameters

    • first: any[]
    • second: any[]

    Returns boolean

Generated using TypeDoc