leoek / fetch-to-curl

Convert javascript fetch requests to curl
MIT License
67 stars 13 forks source link

Supplying no options or an empty object results in a broken curl String #15

Closed leoek closed 5 years ago

leoek commented 5 years ago

empty options

Example curl: fetchToCurl("google.com", {}) Current curl "google.com"undefined Expected curl "google.com"

no options

Example curl: fetchToCurl("google.com") Current fails with the error cannot read property body of undefined Expected curl "google.com"

thisgeek commented 5 years ago

@leoek I can take this on if you'd like.

leoek commented 5 years ago

Sure! I am very busy at the moment, hence the issue instead of a fix 🙈

leoek commented 5 years ago

Would be great if you could add a test as well. This case is currently not covered and therefore missed in the initial release.