stream: add flatMap to readable
דארןלק<The normal caveat of this shouldn't landing until https://github.com/nodejs/node/pull/41573 does and being a draft until then and to only look at the relevant commit :)
I am thinking about changing the toArray()
behavior to not flatten a non-object-mode stream since I think things get tricky when flatMap
ing binary and non-binary streams together but I am honestly not sure and want feedback on much of the behaviours here.
Like the other iterator helpers PRs, this involves work co-authored by @ronag
cc @nodejs/streams
I am mostly interested in feedback about what the semantics should be and how flatMap works when flatMapping one stream mode and returning the other type from the mapper.