Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils"

file

Various utilities that don't belong anywhere else.

author

Nathan Pennie kb1rd@kb1rd.net

Index

Variables

Const BreakException

BreakException: object

Type declaration

Functions

allKeys

  • allKeys<T, K>(obj: T): K[]
  • Type parameters

    • T

    • K: keyof T

    Parameters

    • obj: T

    Returns K[]

allValues

  • allValues<T, V>(obj: T): V[]
  • Type parameters

    • T

    • V: T[keyof T]

    Parameters

    • obj: T

    Returns V[]

arraymap

  • arraymap<T>(array: T[], fn: function): T[]
  • Like the built-in map function, but it replaces the element with an arbitrary number of elements, making it a combination of map, push, and filter.

    template

    T - The type of the array elements.

    Type parameters

    • T

    Parameters

    • array: T[]

      The array to map. It will be modified.

    • fn: function

      The element mapper function. It takes the current element as an argument and returns the element(s) take its place.

        • (el: T): T[]
        • Parameters

          • el: T

          Returns T[]

    Returns T[]

    The same array that was passed as an argument.

catchBreak

  • catchBreak(fn: function): void
  • Parameters

    • fn: function
        • (): void
        • Returns void

    Returns void

Generated using TypeDoc