hildjj / dohdec

Lookup and decode DNS records using DNS-over-HTTPS (DoH)
MIT License
21 stars 5 forks source link

`lookup` types do not match documentation #31

Closed D4nte closed 3 years ago

D4nte commented 3 years ago

The dohdec README says:

https://github.com/hildjj/dohdec/blob/0cfe5e7409d2e1d4a987c59f21a00b76e88ca1ac/pkg/dohdec/README.md?plain=1#L26

Meaning that the first argument of lookup can take a string.

However, the types say:

https://github.com/hildjj/dohdec/blob/0cfe5e7409d2e1d4a987c59f21a00b76e88ca1ac/pkg/dohdec/types/doh.d.ts#L97

Meaning that the first argument of lookup can only be of type object | DOH_LookupOptions

With DOH_LookupOptions being defined as an object too:

https://github.com/hildjj/dohdec/blob/0cfe5e7409d2e1d4a987c59f21a00b76e88ca1ac/pkg/dohdec/types/doh.d.ts#L109

README and types definition should match.

hildjj commented 3 years ago

Thank you for finding this. The type definition is wrong. I'm working on a release right now.