( other: IStreamBuilder<KeyValue<K, unknown>>, )
| 11 | * @param other - The other stream to filter by, which must have the same key type as the input stream |
| 12 | */ |
| 13 | export function filterBy< |
| 14 | K, |
| 15 | V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, |
| 16 | T, |
| 17 | >( |
| 18 | other: IStreamBuilder<KeyValue<K, unknown>>, |
| 19 | ): PipedOperator<T, KeyValue<K, V1>> { |
| 20 | return (stream: IStreamBuilder<T>): IStreamBuilder<KeyValue<K, V1>> => { |
| 21 | const otherKeys = other.pipe( |
| 22 | map(([key, _]) => [key, null] as KeyValue<K, null>), |
| 23 | ) |
| 24 | return stream.pipe( |
| 25 | innerJoin(otherKeys), |
| 26 | map(([key, [value, _]]) => [key, value] as KeyValue<K, V1>), |
| 27 | consolidate(), |
| 28 | ) |
| 29 | } |
| 30 | } |
no test coverage detected