Class ArrayEnumerable<TSource>

Array backed Enumerable

Type Parameters

  • TSource

Hierarchy

Constructors

  • Type Parameters

    • TSource

    Parameters

    • arrayLength: number

    Returns ArrayEnumerable<TSource>

  • Type Parameters

    • TSource

    Parameters

    • Rest ...items: TSource[]

    Returns ArrayEnumerable<TSource>

Methods

  • Applies an accumulator function over a sequence.

    Parameters

    • func: ((x, y) => TSource)

      An accumulator function to be invoked on each element.

        • (x, y): TSource
        • Parameters

          • x: TSource
          • y: TSource

          Returns TSource

    Returns TSource

    The final accumulator value.

  • Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.

    Type Parameters

    • TAccumulate

    Parameters

    • seed: TAccumulate

      The initial accumulator value.

    • func: ((x, y) => TAccumulate)

      An accumulator function to be invoked on each element.

        • (x, y): TAccumulate
        • Parameters

          • x: TAccumulate
          • y: TSource

          Returns TAccumulate

    Returns TAccumulate

    The final accumulator value.

  • Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.

    Type Parameters

    • TAccumulate

    • TResult

    Parameters

    • seed: TAccumulate

      The initial accumulator value.

    • func: ((x, y) => TAccumulate)

      An accumulator function to be invoked on each element.

        • (x, y): TAccumulate
        • Parameters

          • x: TAccumulate
          • y: TSource

          Returns TAccumulate

    • resultSelector: ((x) => TResult)

      A function to transform the final accumulator value into the result value.

        • (x): TResult
        • Parameters

          • x: TAccumulate

          Returns TResult

    Returns TResult

    The transformed final accumulator value.

  • Determines whether all elements of a sequence satisfy a condition.

    Parameters

    • predicate: ((x) => boolean)

      A function to test each element for a condition.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns boolean

    true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.

  • Determines whether all elements of a sequence satisfy a condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      An async function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<boolean>

    true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.

  • Determines whether a sequence contains any elements. If predicate is specified, determines whether any element of a sequence satisfies a condition.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns boolean

    true if the source sequence contains any elements or passes the test specified; otherwise, false.

  • Determines whether any element of a sequence satisfies a condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      An async function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<boolean>

    true if the source sequence contains any elements or passes the test specified; otherwise, false.

  • Computes the average of a sequence of number values.

    Parameters

    Returns number

    The average of the sequence of values.

    Throws

    source contains no elements.

  • Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => number)

      A transform function to apply to each element.

        • (x): number
        • Parameters

          • x: TSource

          Returns number

    Returns number

    The average of the sequence of values.

    Throws

    source contains no elements.

  • Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => Promise<number>)

      An async transform function to apply to each element.

        • (x): Promise<number>
        • Parameters

          • x: TSource

          Returns Promise<number>

    Returns Promise<number>

    The average of the sequence of values.

    Throws

    source contains no elements.

  • Splits the elements of a sequence into chunks of size at most size.

    Parameters

    • size: number

      The maximum size of each chunk.

    Returns IEnumerable<TSource[]>

    An IEnumerable that contains the elements the input sequence split into chunks of size size.

  • Determines whether a sequence contains a specified element by using the specified or default IEqualityComparer.

    Parameters

    • value: TSource

      The value to locate in the sequence.

    • Optional comparer: IEqualityComparer<TSource>

      An equality comparer to compare values. Optional.

    Returns boolean

    true if the source sequence contains an element that has the specified value; otherwise, false.

  • Determines whether a sequence contains a specified element by using the specified or default IEqualityComparer.

    Parameters

    • value: TSource

      The value to locate in the sequence.

    • comparer: IAsyncEqualityComparer<TSource>

      An async equality comparer to compare values.

    Returns Promise<boolean>

    true if the source sequence contains an element that has the specified value; otherwise, false.

  • Returns the number of elements in a sequence or represents how many elements in the specified sequence satisfy a condition if the predicate is specified.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns number

    The number of elements in the input sequence.

  • Returns the number of elements in a sequence or represents how many elements in the specified sequence satisfy a condition if the predicate is specified.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<number>

    The number of elements in the input sequence.

  • Returns the elements of an IEnumerable, or a default valued singleton collection if the sequence is empty.

    Parameters

    • defaultValue: TSource

      The value to return if the sequence is empty.

    Returns IEnumerable<TSource>

    An IEnumerable that contains defaultValue if source is empty; otherwise, source.

  • Returns distinct elements from a sequence by using the default or specified equality comparer to compare values.

    Parameters

    • Optional comparer: IEqualityComparer<TSource>

      An IEqualityComparer to compare values. Optional. Defaults to Strict Equality Comparison.

    Returns IEnumerable<TSource>

    An IEnumerable that contains distinct elements from the source sequence.

  • Performs a specified action on each element of the Iterable

    Parameters

    • action: ((x) => void)

      The action to take an each element

        • (x): void
        • Parameters

          • x: TSource

          Returns void

    Returns IEnumerable<TSource>

    A new IEnumerable that executes the action lazily as you iterate.

  • Performs a specified action on each element of the Iterable

    Parameters

    • action: ((x) => Promise<void>)

      The async action to take an each element

        • (x): Promise<void>
        • Parameters

          • x: TSource

          Returns Promise<void>

    Returns IAsyncEnumerable<TSource>

    A new IAsyncEnumerable that executes the action lazily as you iterate.

  • Returns the element at a specified index in a sequence.

    Parameters

    • index: number

      The zero-based index of the element to retrieve.

    Returns TSource

    The element at the specified position in the source sequence.

    Throws

    index is less than 0 or greater than or equal to the number of elements in source.

  • Returns the element at a specified index in a sequence or a default value if the index is out of range.

    Parameters

    • index: number

      The zero-based index of the element to retrieve.

    Returns null | TSource

    null if the index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence.

  • Produces the set difference of two sequences by using the comparer provided or EqualityComparer to compare values.

    Parameters

    • second: Iterable<TSource>

      An IEnumerable whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.

    • Optional comparer: IEqualityComparer<TSource>

      An IEqualityComparer to compare values. Optional.

    Returns IEnumerable<TSource>

    A sequence that contains the set difference of the elements of two sequences.

  • Produces the set difference of two sequences by using the comparer provided to compare values.

    Parameters

    • second: Iterable<TSource>

      An IEnumerable whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.

    • comparer: IAsyncEqualityComparer<TSource>

      An IAsyncEqualityComparer to compare values.

    Returns IAsyncEnumerable<TSource>

    A sequence that contains the set difference of the elements of two sequences.

  • Returns first element in sequence that satisfies predicate otherwise returns the first element in the sequence.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns TSource

    The first element in the sequence or the first element that passes the test in the specified predicate function.

    Throws

    No elements in Iteration matching predicate

  • Returns the first element in a sequence that satisfies a specified condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<TSource>

    The first element in the sequence that passes the test in the specified predicate function.

    Throws

    No elements in Iteration matching predicate

  • Returns first element in sequence that satisfies predicate otherwise returns the first element in the sequence. Returns null if no value found.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns null | TSource

    The first element in the sequence or the first element that passes the test in the specified predicate function. Returns null if no value found.

  • Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      An async function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<null | TSource>

    null if source is empty or if no element passes the test specified by predicate; otherwise, the first element in source that passes the test specified by predicate.

  • Groups the elements of a sequence according to a specified key selector function.

    Type Parameters

    Parameters

    • keySelector: ((x) => TKey)

      A function to extract the key for each element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    Returns IEnumerable<IGrouping<TKey, TSource>>

    An IEnumerable<IGrouping<TKey, TSource>> where each IGrouping<TKey,TElement> object contains a sequence of objects and a key.

  • Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

    Type Parameters

    • TKey

    Parameters

    • keySelector: ((x) => TKey)

      A function to extract the key for each element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • comparer: IEqualityComparer<TKey>

      An IEqualityComparer to compare keys.

    Returns IEnumerable<IGrouping<TKey, TSource>>

    An IEnumerable<IGrouping<TKey, TSource>> where each IGrouping<TKey,TElement> object contains a sequence of objects and a key.

  • Groups the elements of a sequence according to a specified key selector function.

    Type Parameters

    Parameters

    • keySelector: ((x) => Promise<TKey>)

      An async function to extract the key for each element.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    Returns IAsyncEnumerable<IGrouping<TKey, TSource>>

    An IAsyncEnumerable<IGrouping<TKey, TSource>> where each IGrouping<TKey,TElement> object contains a sequence of objects and a key.

  • Groups the elements of a sequence according to a specified key selector function.

    Type Parameters

    • TKey

    Parameters

    • keySelector: ((x) => TKey | Promise<TKey>)

      A function to extract the key for each element.

        • (x): TKey | Promise<TKey>
        • Parameters

          • x: TSource

          Returns TKey | Promise<TKey>

    • comparer: IEqualityComparer<TKey> | IAsyncEqualityComparer<TKey>

      An IEqualityComparer or IAsyncEqualityComparer to compare keys.

    Returns IAsyncEnumerable<IGrouping<TKey, TSource>>

    An IAsyncEnumerable<IGrouping<TKey, TSource>> where each IGrouping<TKey,TElement> object contains a sequence of objects and a key.

  • Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.

    Type Parameters

    Parameters

    • keySelector: ((x) => TKey)

      A function to extract the key for each element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • elementSelector: ((x) => TElement)

      A function to map each source element to an element in an IGrouping<TKey,TElement>.

        • (x): TElement
        • Parameters

          • x: TSource

          Returns TElement

    Returns IEnumerable<IGrouping<TKey, TElement>>

    An IEnumerable<IGrouping<TKey, TElement>> where each IGrouping<TKey,TElement> object contains a collection of objects of type TElement and a key.

  • Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

    Type Parameters

    • TKey

    • TElement

    Parameters

    • keySelector: ((x) => TKey)

      A function to extract the key for each element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • elementSelector: ((x) => TElement)

      A function to map each source element to an element in an IGrouping<TKey,TElement>.

        • (x): TElement
        • Parameters

          • x: TSource

          Returns TElement

    • comparer: IEqualityComparer<TKey>

      An IEqualityComparer to compare keys.

    Returns IEnumerable<IGrouping<TKey, TElement>>

    An IEnumerable<IGrouping<TKey,TElement>> where each IGrouping<TKey,TElement> object contains a collection of objects of type TElement and a key.

  • Correlates the elements of two sequences based on equality of keys and groups the results.

    Type Parameters

    • TInner

    • TKey

    • TResult

    Parameters

    • inner: Iterable<TInner>

      The sequence to join to the first sequence.

    • outerKeySelector: ((value) => TKey)

      The sequence to join to the first sequence.

        • (value): TKey
        • Parameters

          • value: TSource

          Returns TKey

    • innerKeySelector: ((value) => TKey)

      A function to extract the join key from each element of the second sequence.

        • (value): TKey
        • Parameters

          • value: TInner

          Returns TKey

    • resultSelector: ((element, collection) => TResult)

      A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.

        • (element, collection): TResult
        • Parameters

          • element: TSource
          • collection: TInner[]

          Returns TResult

    • Optional comparer: IEqualityComparer<TKey>

      To compare keys. Optional.

    Returns IEnumerable<TResult>

    An IEnumerable that contains elements of type TResult that are obtained by performing a grouped join on two sequences.

  • Correlates the elements of two sequences based on equality of keys and groups the results.

    Type Parameters

    • TInner

    • TKey

    • TResult

    Parameters

    • inner: Iterable<TInner>

      The sequence to join to the first sequence. Can be async.

    • outerKeySelector: ((value) => TKey | Promise<TKey>)

      The sequence to join to the first sequence. Can be async.

        • (value): TKey | Promise<TKey>
        • Parameters

          • value: TSource

          Returns TKey | Promise<TKey>

    • innerKeySelector: ((value) => TKey | Promise<TKey>)

      A function to extract the join key from each element of the second sequence.

        • (value): TKey | Promise<TKey>
        • Parameters

          • value: TInner

          Returns TKey | Promise<TKey>

    • resultSelector: ((element, collection) => TResult | Promise<TResult>)

      A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. Can be async.

        • (element, collection): TResult | Promise<TResult>
        • Parameters

          • element: TSource
          • collection: TInner[]

          Returns TResult | Promise<TResult>

    • Optional comparer: IEqualityComparer<TKey>

      To compare keys. Optional.

    Returns IAsyncEnumerable<TResult>

    An IAsyncEnumerable that contains elements of type TResult that are obtained by performing a grouped join on two sequences.

  • Produces the set intersection of two sequences by using the specified IEqualityComparer to compare values. If no comparer is selected, uses the StrictEqualityComparer.

    Parameters

    • second: IEnumerable<TSource>

      An Iterable whose distinct elements that also appear in the first sequence will be returned.

    • Optional comparer: IEqualityComparer<TSource>

      An IEqualityComparer to compare values. Optional.

    Returns IEnumerable<TSource>

    A sequence that contains the elements that form the set intersection of two sequences.

  • Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer is used to compare keys or the strict equality comparer.

    Type Parameters

    • TInner

    • TKey

    • TResult

    Parameters

    • inner: IEnumerable<TInner>

      The sequence to join to the first sequence.

    • outerKeySelector: ((x) => TKey)

      A function to extract the join key from each element of the first sequence.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • innerKeySelector: ((x) => TKey)

      A function to extract the join key from each element of the second sequence.

        • (x): TKey
        • Parameters

          • x: TInner

          Returns TKey

    • resultSelector: ((x, y) => TResult)

      A function to create a result element from two matching elements.

        • (x, y): TResult
        • Parameters

          • x: TSource
          • y: TInner

          Returns TResult

    • Optional comparer: IEqualityComparer<TKey>

      An IEqualityComparer to hash and compare keys. Optional.

    Returns IEnumerable<TResult>

    An IEnumerable that has elements of type TResult that are obtained by performing an inner join on two sequences.

  • Returns the last element of a sequence. If predicate is specified, the last element of a sequence that satisfies a specified condition.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns TSource

    The value at the last position in the source sequence or the last element in the sequence that passes the test in the specified predicate function.

    Throws

    The source sequence is empty.

  • Returns the last element of a sequence that satisfies a specified condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<TSource>

    The last element in the sequence that passes the test in the specified predicate function.

    Throws

    The source sequence is empty.

  • Returns the last element of a sequence. If predicate is specified, the last element of a sequence that satisfies a specified condition.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns null | TSource

    The value at the last position in the source sequence or the last element in the sequence that passes the test in the specified predicate function.

  • Returns the last element of a sequence that satisfies a specified condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<null | TSource>

    The last element in the sequence that passes the test in the specified predicate function. Null if no elements.

  • Returns the maximum value in a sequence of values.

    Parameters

    Returns number

    The maximum value in the sequence.

    Throws

    source contains no elements.

  • Invokes a transform function on each element of a sequence and returns the maximum value.

    Parameters

    • selector: ((x) => number)

      A transform function to apply to each element.

        • (x): number
        • Parameters

          • x: TSource

          Returns number

    Returns number

    The maximum value in the sequence.

    Throws

    source contains no elements.

  • Invokes an async transform function on each element of a sequence and returns the maximum value.

    Parameters

    • selector: ((x) => Promise<number>)

      A transform function to apply to each element.

        • (x): Promise<number>
        • Parameters

          • x: TSource

          Returns Promise<number>

    Returns Promise<number>

    The maximum value in the sequence.

    Throws

    source contains no elements.

  • Returns the minimum value in a sequence of values.

    Parameters

    Returns number

    The minimum value in the sequence.

    Throws

    source contains no elements.

  • Invokes a transform function on each element of a sequence and returns the minimum value.

    Parameters

    • selector: ((x) => number)

      A transform function to apply to each element.

        • (x): number
        • Parameters

          • x: TSource

          Returns number

    Returns number

    The minimum value in the sequence.

    Throws

    source contains no elements.

  • Invokes a transform function on each element of a sequence and returns the minimum value.

    Parameters

    • selector: ((x) => Promise<number>)

      A transform function to apply to each element.

        • (x): Promise<number>
        • Parameters

          • x: TSource

          Returns Promise<number>

    Returns Promise<number>

    The minimum value in the sequence.

    Throws

    source contains no elements.

  • Sorts the elements of a sequence in ascending order by using a specified or default comparer.

    Type Parameters

    • TKey

    Parameters

    • predicate: ((x) => TKey)

      A function to extract a key from an element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • Optional comparer: IComparer<TKey>

      An IComparer to compare keys. Optional.

    Returns IOrderedEnumerable<TSource>

    An IOrderedEnumerable whose elements are sorted according to a key.

  • Sorts the elements of a sequence in ascending order by using a specified comparer.

    Type Parameters

    • TKey

    Parameters

    • predicate: ((x) => Promise<TKey>)

      An async function to extract a key from an element.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    • Optional comparer: IComparer<TKey>

      An IComparer to compare keys.

    Returns IOrderedAsyncEnumerable<TSource>

    An IOrderedAsyncEnumerable whose elements are sorted according to a key.

  • Sorts the elements of a sequence in descending order by using a specified or default comparer.

    Type Parameters

    • TKey

    Parameters

    • predicate: ((x) => TKey)

      A function to extract a key from an element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • Optional comparer: IComparer<TKey>

      An IComparer to compare keys. Optional.

    Returns IOrderedEnumerable<TSource>

    An IOrderedEnumerable whose elements are sorted in descending order according to a key.

  • Sorts the elements of a sequence in descending order by using a specified comparer.

    Type Parameters

    • TKey

    Parameters

    • predicate: ((x) => Promise<TKey>)

      An async function to extract a key from an element.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    • Optional comparer: IComparer<TKey>

      An IComparer to compare keys.

    Returns IOrderedAsyncEnumerable<TSource>

    An IOrderedAsyncEnumerable whose elements are sorted in descending order according to a key.

  • Partitions the values into a tuple of failing and passing arrays

    Parameters

    • predicate: ((x) => boolean)

      Predicate to determine whether a value passes or fails

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns [pass: TSource[], fail: TSource[]]

    [values that pass, values that fail]

  • Partitions the values into a tuple of failing and passing arrays

    Parameters

    • predicate: ((x) => Promise<boolean>)

      Predicate to determine whether a value passes or fails

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<[pass: TSource[], fail: TSource[]]>

    [values that pass, values that fail]

  • Projects each element of a sequence into a new form.

    Type Parameters

    • TResult

    Parameters

    • selector: ((x, index) => TResult)

      A transform function to apply to each element.

        • (x, index): TResult
        • Parameters

          • x: TSource
          • index: number

          Returns TResult

    Returns IEnumerable<TResult>

    An IEnumerable whose elements are the result of invoking the transform function on each element of source.

  • Projects each element of a sequence into a new form.

    Type Parameters

    • TKey extends string | number | symbol

    Parameters

    • key: TKey

      A key of TSource.

    Returns IEnumerable<TSource[TKey]>

    An IEnumerable whose elements are the result of getting the value from the key on each element of source.

  • Projects each element of a sequence into a new form.

    Type Parameters

    • TResult

    Parameters

    • selector: ((x, index) => Promise<TResult>)

      An async transform function to apply to each element.

        • (x, index): Promise<TResult>
        • Parameters

          • x: TSource
          • index: number

          Returns Promise<TResult>

    Returns IAsyncEnumerable<TResult>

    An IAsyncEnumerable whose elements are the result of invoking the transform function on each element of source.

  • Projects each element of a sequence into a new form.

    Type Parameters

    • TKey extends string | number | symbol

    • TResult

    Parameters

    • this: IEnumerable<{
          [key: string]: Promise<TResult>;
      }>
    • key: TKey

      A key of the elements in the sequence

    Returns IAsyncEnumerable<TResult>

    An IAsyncEnumerable whoe elements are the result of getting the value for key on each element of source.

  • Projects each element of a sequence to an IEnumerable and flattens the resulting sequences into one sequence.

    Type Parameters

    • TResult

    Parameters

    • selector: ((x, index) => Iterable<TResult>)

      A transform function to apply to each element.

        • (x, index): Iterable<TResult>
        • Parameters

          • x: TSource
          • index: number

          Returns Iterable<TResult>

    Returns IEnumerable<TResult>

    An IEnumerable whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.

  • Projects each element of a sequence to an IEnumerable and flattens the resulting sequences into one sequence.

    Type Parameters

    • TBindedSource extends {
          [key: string]: Iterable<TOut>;
      }

    • TOut

    Parameters

    • this: IEnumerable<TBindedSource>
    • selector: keyof TBindedSource

      A string key of TSource.

    Returns IEnumerable<TOut>

    An IEnumerable whose elements are the result of invoking the parameter the key is tried to on each element of the input sequence.

  • Projects each element of a sequence to an IAsyncEnumerable and flattens the resulting sequences into one sequence.

    Type Parameters

    • TResult

    Parameters

    • selector: ((x, index) => Promise<Iterable<TResult>>)

      A transform function to apply to each element.

        • (x, index): Promise<Iterable<TResult>>
        • Parameters

          • x: TSource
          • index: number

          Returns Promise<Iterable<TResult>>

    Returns IAsyncEnumerable<TResult>

    An IAsyncEnumerable whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.

  • Returns the only element of a sequence that satisfies a specified condition (if specified), and throws an exception if more than one such element exists.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test an element for a condition. (Optional)

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns TSource

    The single element of the input sequence that satisfies a condition.

    Throws

    No element satisfies the condition in predicate. OR More than one element satisfies the condition in predicate. OR The source sequence is empty.

  • Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test an element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<TSource>

    The single element of the input sequence that satisfies a condition.

    Throws

    No element satisfies the condition in predicate. OR More than one element satisfies the condition in predicate. OR The source sequence is empty.

  • If predicate is specified returns the only element of a sequence that satisfies a specified condition, ootherwise returns the only element of a sequence. Returns a default value if no such element exists.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test an element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns null | TSource

    The single element of the input sequence that satisfies the condition, or null if no such element is found.

    Throws

    If predicate is specified more than one element satisfies the condition in predicate, otherwise the input sequence contains more than one element.

  • Returns the only element of a sequence that satisfies a specified condition. Returns a default value if no such element exists.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test an element for a condition. Optional.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<null | TSource>

    The single element of the input sequence that satisfies the condition, or null if no such element is found.

    Throws

    If predicate is specified more than one element satisfies the condition in predicate, otherwise the input sequence contains more than one element.

  • Bypasses a specified number of elements in a sequence and then returns the remaining elements.

    Parameters

    • count: number

      The number of elements to skip before returning the remaining elements.

    Returns IEnumerable<TSource>

    An IEnumerable that contains the elements that occur after the specified index in the input sequence.

  • Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => boolean)

      A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): boolean
        • Parameters

          • x: TSource
          • index: number

          Returns boolean

    Returns IEnumerable<TSource>

    An IEnumerable that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.

  • Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => Promise<boolean>)

      A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): Promise<boolean>
        • Parameters

          • x: TSource
          • index: number

          Returns Promise<boolean>

    Returns IAsyncEnumerable<TSource>

    An IAsyncEnumerable that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.

  • Computes the sum of the sequence of numeric values.

    Parameters

    Returns number

    The sum of the values in the sequence.

  • Computes the sum of the sequence of numeric values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => number)

      A transform function to apply to each element.

        • (x): number
        • Parameters

          • x: TSource

          Returns number

    Returns number

    The sum of the projected values.

  • Computes the sum of the sequence of numeric values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => Promise<number>)

      An async transform function to apply to each element.

        • (x): Promise<number>
        • Parameters

          • x: TSource

          Returns Promise<number>

    Returns Promise<number>

    The sum of the projected values.

  • Returns a specified number of contiguous elements from the start of a sequence.

    Parameters

    • amount: number

      The number of elements to return.

    Returns IEnumerable<TSource>

    An IEnumerable that contains the specified number of elements from the start of the input sequence.

  • Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => boolean)

      A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): boolean
        • Parameters

          • x: TSource
          • index: number

          Returns boolean

    Returns IEnumerable<TSource>

    An IEnumerable that contains elements from the input sequence that occur before the element at which the test no longer passes.

  • Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => Promise<boolean>)

      A async function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): Promise<boolean>
        • Parameters

          • x: TSource
          • index: number

          Returns Promise<boolean>

    Returns IAsyncEnumerable<TSource>

    An IAsyncEnumerable that contains elements from the input sequence that occur before the element at which the test no longer passes.

  • Converts an Iterable to a Map<K, V[]>.

    Type Parameters

    • TKey

    Parameters

    • selector: ((x) => TKey)

      A function to serve as a key selector.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    Returns Map<TKey, TSource[]>

    Map<K, V[]>

  • Converts an Iterable to a Map<K, V[]>.

    Type Parameters

    • TKey

    Parameters

    • selector: ((x) => Promise<TKey>)

      An async function to serve as a key selector.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    Returns Promise<Map<TKey, TSource[]>>

    A promise for Map<K, V[]>

  • Converts the Iteration to an Object. Duplicate values will be overriden.

    Type Parameters

    • TKey extends string | number | symbol

    Parameters

    • selector: ((x) => TKey)

      A function to determine the Key based on the value.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    Returns Record<TKey, TSource>

    KVP Object

  • Converts the Iteration to an Object. Duplicate values will be overriden.

    Type Parameters

    • TKey extends string | number | symbol

    Parameters

    • selector: ((x) => Promise<TKey>)

      An async function to determine the Key based on the value.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    Returns Promise<Record<TKey, TSource>>

    KVP Object

  • Produces the set union of two sequences by using scrict equality comparison or a specified IEqualityComparer.

    Parameters

    • second: Iterable<TSource>

      An Iterable whose distinct elements form the second set for the union.

    • Optional comparer: IEqualityComparer<TSource>

      The IEqualityComparer to compare values. Optional.

    Returns IEnumerable<TSource>

    An IEnumerable that contains the elements from both input sequences, excluding duplicates.

  • Produces the set union of two sequences by using a specified IAsyncEqualityComparer.

    Parameters

    • second: Iterable<TSource>

      An Iterable whose distinct elements form the second set for the union.

    • comparer: IAsyncEqualityComparer<TSource>

      The IAsyncEqualityComparer to compare values.

    Returns IAsyncEnumerable<TSource>

    An IAsyncEnumerable that contains the elements from both input sequences, excluding duplicates.

  • Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => boolean)

      A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): boolean
        • Parameters

          • x: TSource
          • index: number

          Returns boolean

    Returns IEnumerable<TSource>

    An IEnumerable that contains elements from the input sequence that satisfy the condition.

  • Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => Promise<boolean>)

      A async function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): Promise<boolean>
        • Parameters

          • x: TSource
          • index: number

          Returns Promise<boolean>

    Returns IAsyncEnumerable<TSource>

    An IAsyncEnumerable that contains elements from the input sequence that satisfy the condition.

  • Creates a tuple of corresponding elements of two sequences, producing a sequence of the results.

    Type Parameters

    • TSecond

    Parameters

    • second: Iterable<TSecond>

      The second sequence to merge.

    Returns IEnumerable<[TSource, TSecond]>

    An IEnumerable<[T, Y]> that contains merged elements of two input sequences.

  • Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.

    Type Parameters

    • TSecond

    • TResult

    Parameters

    • second: Iterable<TSecond>

      The second sequence to merge.

    • resultSelector: ((x, y) => TResult)

      A function that specifies how to merge the elements from the two sequences.

        • (x, y): TResult
        • Parameters

          • x: TSource
          • y: TSecond

          Returns TResult

    Returns IEnumerable<TResult>

    An IEnumerable that contains merged elements of two input sequences.

  • Applies a specified async function to the corresponding elements of two sequences, producing a sequence of the results.

    Type Parameters

    • TSecond

    • TResult

    Parameters

    • second: Iterable<TSecond>

      The second sequence to merge.

    • resultSelector: ((x, y) => Promise<TResult>)

      An async function that specifies how to merge the elements from the two sequences.

        • (x, y): Promise<TResult>
        • Parameters

          • x: TSource
          • y: TSecond

          Returns Promise<TResult>

    Returns IAsyncEnumerable<TResult>

    An IAsyncEnumerable that contains merged elements of two input sequences.

Generated using TypeDoc