Zekfad / nhentai-api

Node.JS client for nhentai.net undocumented API.
https://zekfad.github.io/nhentai-api/
ISC License
42 stars 6 forks source link

fix(api): types #22

Closed cerinoligutom closed 2 years ago

cerinoligutom commented 2 years ago

Currently, it forces TypeScript users to supply a parameter. If we pass null in an attempt to use the default options, we get this error:

image

Which makes sense because we cannot destructure a null object.

codecov[bot] commented 2 years ago

Codecov Report

Merging #22 (1f0fdbc) into master (e37fe35) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #22   +/-   ##
=======================================
  Coverage   39.69%   39.69%           
=======================================
  Files           9        9           
  Lines         199      199           
=======================================
  Hits           79       79           
  Misses        120      120           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e37fe35...1f0fdbc. Read the comment docs.

Zekfad commented 2 years ago

I've made all the required changes, but for the future note, that type definitions are generated from jsdoc comments in source code, so editing them manually wont work, as they'll be regenerated:

https://github.com/Zekfad/nhentai-api/commit/cdb478efc07869a7f550d206106615f613928b01#diff-d45b1674ab37689f6ca6dc634fe29959c463fc30cb46746c3b187de88432ae4fL161-R163

Regarding this one, I've made it optional, as it supposed to be, and as it is in the source. Hope this works now. Thanks for the contribution!

cerinoligutom commented 2 years ago

I've made all the required changes, but for the future note, that type definitions are generated from jsdoc comments in source code, so editing them manually wont work, as they'll be regenerated:

cdb478e#diff-d45b1674ab37689f6ca6dc634fe29959c463fc30cb46746c3b187de88432ae4fL161-R163

Regarding this one, I've made it optional, as it supposed to be, and as it is in the source. Hope this works now. Thanks for the contribution!

I see, will keep that in mind. Thanks!