UNPKG

773 BTypeScriptView Raw
1import { IterableX } from './iterablex';
2/**
3 * If the specified condition evaluates true, select the thenSource sequence.
4 * Otherwise, select the elseSource sequence.
5 *
6 * @export
7 * @template TSource The type of the elements in the result sequence.
8 * @param {(() => boolean)} condition Condition evaluated to decide which sequence to return.
9 * @param {Iterable<TSource>} thenSource Sequence returned in case evaluates true.
10 * @param {Iterable<TSource>} [elseSource=empty()] Sequence returned in case condition evaluates false.
11 * @returns {IterableX<TSource>} thenSource if condition evaluates true; elseSource otherwise.
12 */
13export declare function iif<TSource>(fn: () => boolean, thenSource: Iterable<TSource>, elseSource?: Iterable<TSource>): IterableX<TSource>;