fast-glob icon indicating copy to clipboard operation
fast-glob copied to clipboard

settings: Add uniqueBy function

Open phated opened this issue 1 year ago • 0 comments

What is the purpose of this pull request?

I've been investigating fast-glob for usage in gulp via glob-stream and I noticed you had a unique setting, but not a way to configure the uniqueness value. We provide a uniqueBy configuration that we passed into a unique-stream to deduplicate values. However, if fast-glob provides that functionality, we can drop unique-stream and pumpify dependencies which would be a huge performance win!

What changes did you make? (Give an overview)

I added a uniqueBy option that is used to pluck the property to use for duplicate entries. This defaults to plucking entry.path by default.

phated avatar Oct 18 '22 21:10 phated