sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Refactor with `gensync` #232

Closed fisker closed 2 years ago

fisker commented 2 years ago

I found gensync is a very handy module, it allows you to write the async and sync logic in one function.

How do you think?

sindresorhus commented 2 years ago

Not a big fan, to be honest. I find the code less readable after this change, and the existing duplication is not that bad. This also introduces a dependency, and a risk, as gensync is a big hack. All this to save 13 lines of code. Do you think it's worth it?

fisker commented 2 years ago

Okay.