jafayer / DinoDNS

https://dinodns.dev
2 stars 0 forks source link

Add SupportedAnswer type to resolve opt problems #7

Closed jafayer closed 1 month ago

jafayer commented 1 month ago

As it currently stands, the OptAnswer Answer type is a problem for this code because it is the only type that lacks a data key in its object definition.

This caused intractable type issues when attempting to do things like

res.packet.answers.map(({data}) => {
    console.log(data);
  });

This pull request notably introduces an exclusion of support for the OPT query type for now.

This PR also replaces non-null assertion operators and updates a few type definitions.

Type Safety Improvements:

Type Definition Updates:

Code Readability Improvements: