Push values to stream from a regular loop instead of shifting the initial array

This commit is contained in:
Convly 2022-10-27 16:00:07 +02:00
parent 1cfb30658a
commit a0a8e06c54

View File

@ -160,9 +160,8 @@ class ReadableStrapiQuery extends Readable {
this._fetched += count;
// While there is at least one value to unpack
while (results.length) {
// Add the first one to the stream's queue
this.push(results.shift());
for (const result of results) {
this.push(result);
}
// If the amount of fetched entities is smaller than the