diff --git a/src/core/server/utils/streams/list_stream.ts b/src/core/server/utils/streams/list_stream.ts index b6f1333e46a70..e62f6d3fa930b 100644 --- a/src/core/server/utils/streams/list_stream.ts +++ b/src/core/server/utils/streams/list_stream.ts @@ -27,7 +27,7 @@ import { Readable } from 'stream'; * @return {Readable} */ export function createListStream(items: T | T[] = []) { - const queue = Array.isArray(items) ? items : [items]; + const queue = Array.isArray(items) ? [...items] : [items]; return new Readable({ objectMode: true,