tinyglobby icon indicating copy to clipboard operation
tinyglobby copied to clipboard

Ability to match `glob` symlink behavior

Open benmccann opened this issue 10 months ago • 5 comments

I've been trying to switch @vercel/nft over to tinyglobby from glob. There's one failing test and I'm pretty sure it's because of the symlink behavior that glob has

From https://www.npmjs.com/package/glob:

By default, a ** in a pattern will follow 1 symbolic link if it is not the first item in the pattern, or none if it is the first item in the pattern, following the same behavior as Bash.

benmccann avatar Feb 25 '25 21:02 benmccann

at first glance i think it is unlikely this will be added, fdir doesn't give information on whether a file is a symlink and there would need to be quite a lot of manual matching done to achieve this - not to mention it's not the behavior present in globby/fast-glob iirc

SuperchupuDev avatar Feb 26 '25 19:02 SuperchupuDev

Perhaps it could be an option added to fdir...

benmccann avatar Feb 26 '25 20:02 benmccann

maybe, but even then the tinyglobby side of the implementation would likely not be straightforward to add

SuperchupuDev avatar Feb 27 '25 03:02 SuperchupuDev

Perhaps the fdir option could be a limit for number of symlinks to crawl. I don't think anything would have to change on the tinyglobby side then.

benmccann avatar Feb 27 '25 05:02 benmccann

that wouldn't just apply to ** patterns though

SuperchupuDev avatar Feb 27 '25 13:02 SuperchupuDev