Skip to content

fs: refactoring declaratively with the Array.fromAsync function

Rodrigo Muino Tomonari requested to merge github/fork/sonsurim/refactor-glob into main

The following applies to this PR:

  • Replaced the for await...of loop with ArrayFromAsync().
  • Removed the need for manual array pushing using ArrayPrototypePush.
  • Added ArrayFromAsync type to primordials.d.ts file
  • Simplified the overall structure of the async function.

Array.fromAsync was defined relatively recently, but I used it because I knew it was officially adopted in Node.js v22. (MDN Document)

Merge request reports

Loading