Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(multiply-stream): add MultiplyStream class and tests
Implement a new class `MultiplyStream` along with its unit tests in `multiply-stream.spec.ts`. `MultiplyStream` is designed to take an array of `WritableStream` objects and create a `ReadableStream` that will output the same chunk to the original stream and each of the provided writable streams. The main purpose is to duplicate the stream's chunks to multiple destinations. This feature could be particularly useful in scenarios where the same data stream needs to be consumed by multiple consumers in different ways, for example, logging, monitoring, or processing the data in parallel without needing to buffer the entire dataset. The test suite ensures that `MultiplyStream` correctly duplicates the incoming stream's chunks to each of the provided writable streams and that the original stream's data remains intact and accessible.
- Loading branch information