Applies a user-defined pipeline to source and returns the operator's result.
Type of elements within source.
Result type produced by operator.
The iterable whose enumerable view is supplied to operator.
Function that receives the enumerable view of source and returns an arbitrary result.
The value produced by operator after optionally enumerating source.
Re-throws any error thrown by operator or during enumeration initiated by the operator.
The operator chooses how the sequence is consumed, making this helper convenient for custom aggregations, projections, or interop scenarios.
const numbers = [1, 2, 3, 4, 5];const sum = pipe(numbers, e => e.sum());console.log(sum); // 15const filteredAndDoubled = pipe(numbers, e => e.where(x => x % 2 === 0).select(x => x * 2).toArray());console.log(filteredAndDoubled); // [4, 8] Copy
const numbers = [1, 2, 3, 4, 5];const sum = pipe(numbers, e => e.sum());console.log(sum); // 15const filteredAndDoubled = pipe(numbers, e => e.where(x => x % 2 === 0).select(x => x * 2).toArray());console.log(filteredAndDoubled); // [4, 8]
Applies a user-defined pipeline to source and returns the operator's result.