We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bc65b2 commit 7a67a2fCopy full SHA for 7a67a2f
lib/internal/streams/operators.js
@@ -156,12 +156,12 @@ async function some(fn, options) {
156
// Note that some does short circuit but also closes the iterator if it does
157
const ac = new AbortController();
158
if (options?.signal) {
159
- options?.signal?.addEventListener('abort', ac.abort.bind(ac), {
+ options?.signal?.addEventListener('abort', () => ac.abort(), {
160
[kWeakHandler]: this,
161
once: true,
162
});
163
}
164
- const mapped = this.map(fn, { ...(options ?? {}), signal: ac.signal });
+ const mapped = this.map(fn, { ...options, signal: ac.signal });
165
for await (const result of mapped) {
166
if (result) {
167
ac.abort();
0 commit comments