Class Collection<T>Abstract

Abstract Collection type

Type Parameters

  • T

Hierarchy (View Summary)

Constructors

Methods

  • Filter the collection by a given predicate

    Parameters

    • predicate: (value: T, key: string) => boolean

      Predicate to satisfy

    Returns T[]

  • Find some value based on a predicate

    Parameters

    • predicate: (value: T, key: string) => boolean

      Predicate to satisfy

    Returns undefined | T

  • Execute a provided function over each key, value pair in the map

    Parameters

    • cb: (value: T, key: string, map: Map<string, T>) => void

      Callback for each pair

    Returns void

  • Check whether an id exists in the Collection

    Parameters

    • id: string

      Id

    Returns boolean

    Whether it exists

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: (value: T, key: string) => O

      Callback

    Returns O[]