-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReadableStream typing does not match async iterator spec #141
Comments
Thanks for the report! The reason I defined it as a property rather than a method was because the spec demands that I see that you've decided to switch to Node's native By the way, I noticed this type definition in your code: export interface IterableReadableStreamInterface<T>
extends ReadableStream<T>,
AsyncGenerator<T> {} That should really be: export interface IterableReadableStreamInterface<T>
extends ReadableStream<T>,
AsyncIterable<T> {} since a |
Ah got it - thanks for the context and heads up around that typing! |
Thank you! |
The globally declared
Symbol.asyncIterator
property here should be a method, not a property.https://github.com/MattiasBuelens/web-streams-polyfill/blob/master/dist/types/ts3.6/polyfill.d.ts#L26
vs.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator/@@asyncIterator
This causes subtle downstream typing bugs like this:
See:
openai/openai-node#613
langchain-ai/langchainjs#3793
The text was updated successfully, but these errors were encountered: