From 8deb56e1a33d1dccd2ebdea01146139c81dcc18b Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Mon, 16 Sep 2024 19:36:34 -0600 Subject: [PATCH] Don't mutate options --- util/RangeIterable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/RangeIterable.js b/util/RangeIterable.js index 1b19d0254..586afa9f7 100644 --- a/util/RangeIterable.js +++ b/util/RangeIterable.js @@ -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)); } @@ -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;