Environment
- OS Version: macOS 10.14.6
- Node.js Version: 10.15.3
Actual behavior
glob throws a TypeError when called with an empty string, but rejects with a TypeError when argument is undefined or null
Expected behavior
The behaviour should be consistent. Either all the TypeErrors should be thrown or put in a rejection branch.
Steps to reproduce
- run fast-glob with an empty string
- compare output to a run with undefined or null
Code sample
import fg from 'fast-glob'
console.log(fg('')) // TypeError: Expected a non-empty string
console.log(fg(null)) // Promise <rejected> TypeError: Patterns must be a string or an array of strings
Environment
Actual behavior
globthrows a TypeError when called with an empty string, but rejects with a TypeError when argument isundefinedornullExpected behavior
The behaviour should be consistent. Either all the TypeErrors should be thrown or put in a rejection branch.
Steps to reproduce
Code sample