You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the convertThisAsyncIterableIteratorToArray function manually iterates over an asynchronous generator to convert its output into an array. This is done because the project does not yet support Node.js 22.x, where the Array.fromAsync method is available.
exportasyncfunctionconvertThisAsyncIterableIteratorToArray<O,Textends(...args: any[])=>AsyncGenerator<O>,>(this: T, ...args: Parameters<T>): Promise<O[]>{// TODO: Use Array.fromAsync when Node.js 22.x becomes the minimum supported version.// return Array.fromAsync(this(...args));constrows: O[]=[];forawait(constrowofthis(...args)){rows.push(row);}returnrows;}
Once the project moves to Node.js 22.x as the minimum supported version, update this function to use Array.fromAsync for converting the asynchronous generator to an array. This will simplify the code and take advantage of the newer, built-in API.
The text was updated successfully, but these errors were encountered:
Overview
Currently, the convertThisAsyncIterableIteratorToArray function manually iterates over an asynchronous generator to convert its output into an array. This is done because the project does not yet support Node.js 22.x, where the Array.fromAsync method is available.
Once the project moves to Node.js 22.x as the minimum supported version, update this function to use Array.fromAsync for converting the asynchronous generator to an array. This will simplify the code and take advantage of the newer, built-in API.
The text was updated successfully, but these errors were encountered: