Type Parameters

  • T

  • TReturn

Hierarchy

Constructors

Properties

#aggregateFunction: ((acumulate, current) => TReturn)

Type declaration

    • (acumulate, current): TReturn
    • Parameters

      • acumulate: TReturn
      • current: T

      Returns TReturn

#enumerable: IEnumerable<T>
#initialValue: TReturn

Methods

  • Returns true if any of the items match the predicate, otherwise false

    Parameters

    Returns boolean

    Example

    if (myEnumerable.any()) {
    // do something because the enumerable has elements
    }
    let myEnumerable = new ArrayEnumerable([1, 2, 3, 4]);
    if (myEnumerable.any((i) => i == 2)) {
    // the enumerable contains a '2'
    }
  • Iterates over the enumerable and performs the callback on each item. Return false to break.

    Parameters

    • callback: ((value, index) => boolean | void)
        • (value, index): boolean | void
        • Parameters

          • value: TReturn
          • index: number

          Returns boolean | void

    Returns void

  • Returns a single element only if there is one element in the enumerable

    Parameters

    Returns TReturn

    Throws

    InvalidOperationException if there is not exactly one item in the enumerable

  • Returns a single element only if there is one element in the enumerable. If there are no items in the enumerable, then null is returned

    Parameters

    Returns null | TReturn

    Throws

    InvalidOperationException if there is not exactly one or zero items in the enumerable

  • Returns a dictionary based on the key and value selctors

    Type Parameters

    • TKey

    • TValue

    Parameters

    • keySelector: ((a) => TKey)
        • (a): TKey
        • Parameters

          • a: TReturn

          Returns TKey

    • valueSelector: ((a) => TValue)
        • (a): TValue
        • Parameters

          • a: TReturn

          Returns TValue

    Returns IDictionary<TKey, TValue>

Generated using TypeDoc