Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamingr committed Jan 17, 2022
1 parent 4bc65b2 commit 7a67a2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/streams/operators.js
Expand Up @@ -156,12 +156,12 @@ async function some(fn, options) {
// Note that some does short circuit but also closes the iterator if it does
const ac = new AbortController();
if (options?.signal) {
options?.signal?.addEventListener('abort', ac.abort.bind(ac), {
options?.signal?.addEventListener('abort', () => ac.abort(), {
[kWeakHandler]: this,
once: true,
});
}
const mapped = this.map(fn, { ...(options ?? {}), signal: ac.signal });
const mapped = this.map(fn, { ...options, signal: ac.signal });
for await (const result of mapped) {
if (result) {
ac.abort();
Expand Down

0 comments on commit 7a67a2f

Please sign in to comment.