Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kapooostin opened this issue Jan 11, 2020 · 1 comment
Closed

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

kapooostin opened this issue Jan 11, 2020 · 1 comment
Assignees
Milestone

Comments

@kapooostin
Copy link

kapooostin commented Jan 11, 2020

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
@kapooostin kapooostin changed the title glob rejects with a TypeError when argument is undefined or null glob throws a TypeError when called with an empty string Jan 11, 2020
@mrmlnc mrmlnc self-assigned this Jan 14, 2020
@mrmlnc mrmlnc added this to the 3.2.0 milestone Jan 21, 2020
@mrmlnc
Copy link
Owner

mrmlnc commented Jan 29, 2020

Will be available with fast-glob@3.2.0 (#251).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants