Skip to content

chore(pkg): ⬆️ Upgrading Aegir and Sinon#99

Closed
whizzzkid wants to merge 1 commit intovasco-santos:mainfrom
whizzzkid:chore/pkg-updates
Closed

chore(pkg): ⬆️ Upgrading Aegir and Sinon#99
whizzzkid wants to merge 1 commit intovasco-santos:mainfrom
whizzzkid:chore/pkg-updates

Conversation

@whizzzkid
Copy link
Copy Markdown

In this PR:

  • upgrading aegir and sinon to latest.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Comment thread src/index.ts
* @param {string} [rrType = 'A'] - resource record type
*/
async resolve (hostname: string, rrType = 'A') {
async resolve (hostname: string, rrType = 'A'): Promise<string[] | string[][]> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of returning Promise<string[] | string[][]> we can use method overloading to return a specific type based on the rrType parameter. This way the user doesn't have to work out what they were given:

Suggested change
async resolve (hostname: string, rrType = 'A'): Promise<string[] | string[][]> {
async resolve (hostname: string, rrType: 'TXT'): Promise<string[][]>
async resolve (hostname: string, rrType: 'A' | 'AAAA'): Promise<string[]>
async resolve (hostname: string): Promise<string[]>
async resolve (hostname: string, rrType: string = 'A'): Promise<string[] | string[][]> {

@achingbrain
Copy link
Copy Markdown
Collaborator

Thanks for opening this - unfortunately there were existing PRs to do this - #93 and #100

@whizzzkid whizzzkid deleted the chore/pkg-updates branch October 26, 2023 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants