posva / mande

<700 bytes convenient and modern wrapper around fetch with smart extensible defaults
https://mande.esm.is
MIT License
1.19k stars 42 forks source link

fix(types): Allow no relative url to fetch RESTful api list #342

Closed krystofwoldrich closed 1 year ago

krystofwoldrich commented 2 years ago

fix(get): Allow no relative url to fetch RESTful api list

What kind of change does this PR introduce? (check at least one)

Does this PR introduce a breaking change? (check one)

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

Other information:

I've noticed examples in the README.md, where the get method was used without any parameters. But the TS typing didn't allowed such a calls. In my opinion the call without any arguments looks cleaner than call with empty string to get list from a resource.

codecov[bot] commented 2 years ago

Codecov Report

Merging #342 (faa6ff4) into main (69c9547) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head faa6ff4 differs from pull request most recent head fd88a34. Consider uploading reports for the commit fd88a34 to get more accurate results

@@           Coverage Diff           @@
##             main     #342   +/-   ##
=======================================
  Coverage   94.28%   94.28%           
=======================================
  Files           1        1           
  Lines          70       70           
  Branches       25       25           
=======================================
  Hits           66       66           
  Misses          4        4           
Impacted Files Coverage Δ
src/index.ts 94.28% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

krystofwoldrich commented 2 years ago

Okay. I've changed the typing and added a bit of logic to correctly recognise url and options. Also I've added 2 more tests.

Let me know, what do you think.

krystofwoldrich commented 2 years ago

Any updates?

krystofwoldrich commented 2 years ago

@posva Thanks for the tips. I've change it. I hope it's okay, you can take a look.

posva commented 1 year ago

Thank you, I added a few last changes and merged it in #379