The type of values in the data source
Enables functions to accept data in the most convenient format for the caller,
internally normalizing it to async iterables for uniform processing.
Used by items() to create pipes and by flatMap() to flatten nested data sources.
undefined Handling: undefined values are automatically filtered out by the items() function,
allowing tasks like map() to return undefined as a way to filter items from the stream.
// All of these are valid Data<number> values:
const scalarData: Data<number> = 42;
const arrayData: Data<number> = [1, 2, 3];
const iterableData: Data<number> = new Set([1, 2, 3]);
const asyncData: Data<number> = (async function*() { yield 1; yield 2; })();
const pipeData: Data<number> = items([1, 2, 3]);
Flexible data source for stream processing.
Represents various data formats that can be converted into async streams:
undefined- filtered out and not yieldedV- yields one itemreadonly V[]- yields items from the arrayIterable<V>- yields items from the iterableAsyncIterable<V>- yields items from the async iterable<V>- yields items from the pipe's underlying async iterable