You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improves typing & spec compliance
fixes: [Bug] Typing issue causes AsyncIterator.from(...) to fail against plain ES iterator-like things #21
fixes: [Bug] counter/index argument is not provided to callback functions #22
This has been fixed in version 3.0.0, and thank you for reporting this bug!
I still have in backlog making this polyfill more spec-compliant, and I have to carve out some time and will to make it as good as it can be.
Describe the bug
For sync map/filter at least, only one argument is provided to the callback function (the current element).
The iterator helpers proposal specifies that the callback functions are provided two arguments: the current element and its counter/index.
To Reproduce
[...Iterator.from([0, 1]).filter((x, idx) => idx)]
Expected behavior
expected [1], got []
The text was updated successfully, but these errors were encountered: