Skip to content

Commit 07d075a

Browse files
committed
fs: refactoring declaratively with the fromAsync function
- Refs: #51912
1 parent e70bd47 commit 07d075a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/fs.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,10 +3115,7 @@ function glob(pattern, options, callback) {
31153115
// TODO: Use iterator helpers when available
31163116
(async () => {
31173117
try {
3118-
const res = [];
3119-
for await (const entry of new Glob(pattern, options).glob()) {
3120-
ArrayPrototypePush(res, entry);
3121-
}
3118+
const res = await Array.fromAsync(new Glob(pattern, options).glob());
31223119
callback(null, res);
31233120
} catch (err) {
31243121
callback(err);

0 commit comments

Comments
 (0)