Type Parameters

  • T

Hierarchy

Implemented by

Methods

  • Returns Iterator<T, any, undefined>

  • 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'
    }
  • Determines whether a sequence contains a specified element.

    Parameters

    • item: T

      The value to locate in the sequence.

    Returns boolean

  • Returns the first item in the enumerable or null

    Returns null | T

  • Returns the first item in the enumerable that matches the predicate or null

    Parameters

    Returns null | T

  • 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: T
          • index: number

          Returns boolean | void

    Returns void

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

    Returns T

    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 that matches the predicate

    Parameters

    Returns T

    Throws

    InvalidOperationException if there is not exactly one item in the enumerable that matches the predicate

  • 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

    Returns null | T

    Throws

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

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

    Parameters

    Returns null | T

    Throws

    InvalidOperationException if there is not exactly one or zero item in the enumerable that matches the predicate

  • Skips the number of items specified. If the count is larger than the size of the enumerable, no items will be returned.

    Parameters

    • count: number

      the number of items to skip

    Returns IEnumerable<T>

  • Sums the items in the enumerable using the selector

    Parameters

    • selector: Selector<T, number>

      selector to return the number to be summed

    Returns number

  • Takes the number of specified items from the enumerable. If the count is larger than the size of the enumerable, all items will be returned

    Parameters

    • count: number

      the number of items to take.

    Returns IEnumerable<T>

  • Returns a dictionary based on the key and value selctors

    Type Parameters

    • TKey

    • TValue

    Parameters

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

          • a: T

          Returns TKey

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

          • a: T

          Returns TValue

    Returns IDictionary<TKey, TValue>

Generated using TypeDoc