Skip to content

Commit

Permalink
copy array in createListStream
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Sep 2, 2020
1 parent c667c48 commit 425523b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/server/utils/streams/list_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Readable } from 'stream';
* @return {Readable}
*/
export function createListStream<T = any>(items: T | T[] = []) {
const queue = Array.isArray(items) ? items : [items];
const queue = Array.isArray(items) ? [...items] : [items];

return new Readable({
objectMode: true,
Expand Down

0 comments on commit 425523b

Please sign in to comment.