Skip to content

glob throws a TypeError when called with an empty string #247

@kapooostin

Description

@kapooostin

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

  1. run fast-glob with an empty string
  2. 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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions