Provides a set of static methods for IEnumerable.

Hierarchy

  • Enumerable

Constructors

Methods

  • Creates a new Enumerable from the input Iterable.

    Example

    const numbers = [1, 2, 3, 4];
    const enumerable = Enumerable.from(numbers);

    Returns

    A new Enumerable.

    Type Parameters

    • TResult

    Parameters

    • src: Iterable<TResult>

      The Iterable to create an Enumerable from.

    Returns IEnumerable<TResult>

  • Creates a new Enumerable from the input object.

    Example

    const obj = {
    foo: 1,
    bar: 'b'
    };
    const enumerable = Enumerable.from(obj);

    Returns

    A new Enumerable.

    Type Parameters

    • TSource

    Parameters

    • src: TSource

      The object to create an Enumerable from.

    Returns IEnumerable<[keyof TSource, TSource[keyof TSource]]>

  • Determines if the passed in object is an Enumerable.

    Returns

    True if the obj is an Enumerable. False if not.

    Parameters

    • obj: unknown

      The item to test if it is an Enumerable or not.

    Returns obj is IEnumerable<unknown>

  • Generates a sequence of integral numbers within a specified range.

    Returns

    An IEnumerable that contains a range of sequential integral numbers.

    Parameters

    • start: number

      The value of the first integer in the sequence.

    • count: number

      The number of sequential integers to generate.

    Returns IEnumerable<number>

  • Generates a sequence that contains one repeated value.

    Typeparam

    TResult The type of the value to be repeated in the result sequence.

    Returns

    An IEnumerable that contains a repeated value.

    Type Parameters

    • TResult

    Parameters

    • element: TResult

      The value to be repeated.

    • count: number

      The number of times to repeat the value in the generated sequence.

    Returns IEnumerable<TResult>

Generated using TypeDoc