globby icon indicating copy to clipboard operation
globby copied to clipboard

fast-glob option suppressErrors is not (entirely) respected

Open starpit opened this issue 5 years ago • 1 comments

Summary

globby does not entirely respect fast-glob's supressErrors option

Example

require('globby')(['validFile.txt', 'validFile.txt/**/*.txt'], { suppressErrors: true })

Expected output

['validFile.txt']

Actual output

Error: ENOTDIR: not a directory, stat 'validFile.txt/**/*.txt'

This appears to be due to globby's wrapper logic that adds (on top of fast-glob) a call to dir-glob, without obeying the supressErrors option. I realize that this option is part of fast-glob, not dir-glob, but globby's docs specify that fast-glob's options are valid globby options, and, anyway, it'd be nice to do so, I think!

starpit avatar Jan 07 '21 18:01 starpit

Pull request welcome :)

sindresorhus avatar Jan 07 '21 19:01 sindresorhus