mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
Implements the WHATWG Streams spec ReadableStream.from() static method that creates a ReadableStream from any iterable or async iterable. Changes: - Add readableStreamFrom() function in ReadableStream.ts - Register the static method on the ReadableStream constructor in JSReadableStream.cpp - Add type definitions in globals.d.ts and builtins.d.ts - Add comprehensive tests for the new API The implementation: - Returns the same ReadableStream when passed a ReadableStream - Supports sync iterables (arrays, Sets, Maps, generators, strings) - Supports async iterables (async generators, custom async iterables) - Properly handles iterator.return() on cancellation - Correctly propagates errors from iterators 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>