Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "util/index"

Index

Functions

Enum

  • Enum<X>(...x: X[]): object
  • Given a list of strings, returns an object where each of those string is a key, whose value is also that string

    Type parameters

    • X: string

    Parameters

    • Rest ...x: X[]

      List of string literals or string literal typed strings

    Returns object

    An object strongly typed as a mapping of key-value pairs of those strings

poisonPill

  • poisonPill(reason: string): (Anonymous function)
  • Returns a function which throws an error with the specified reason. Used to make calls to a given method throw after a specific operation, usually invalidation.

    Parameters

    • reason: string

      The reason the function was poisoned

    Returns (Anonymous function)

satisfies

  • satisfies<T>(arr: T[], predicate: function): T | undefined
  • Returns the first element of an array which satisfies a given predicate, or undefined

    Type parameters

    • T

    Parameters

    • arr: T[]

      The array to operate on

    • predicate: function

      The function to call on each element

        • (item: T): boolean
        • Parameters

          • item: T

          Returns boolean

    Returns T | undefined

Generated using TypeDoc