Skip to content

Commit

Permalink
Don't mutate options
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Sep 17, 2024
1 parent eb48cbc commit 8deb56e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/RangeIterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class RangeIterable {
return iterable;
}
[Symbol.asyncIterator](options) {
if (options) options.async = true;
if (options) options = { ...options, async: true };
else options = { async: true };
return (this.iterator = this.iterate(options));
}
Expand All @@ -155,7 +155,7 @@ export class RangeIterable {
iterable.iterate = (options) => {
// explicitly prevent continue on recoverable error with filter
if (options.continueOnRecoverableError)
options.continueOnRecoverableError = false;
options = { ...options, continueOnRecoverableError: false };
return iterate(options);
};
return iterable;
Expand Down

0 comments on commit 8deb56e

Please sign in to comment.