Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add TypeScript typings #66

Merged
merged 2 commits into from
May 29, 2019
Merged

Conversation

mitsuruog
Copy link
Contributor

Refer to #31.

I made a Typings file. but I just followed #31 way, though.

I would happy if I can make the first contribution.
Thanks.

@jhnns
Copy link
Member

jhnns commented Mar 4, 2019

Awesome, thanks. I'll review it the next days.

@DannyBrown-xx
Copy link

This would be useful for me. Looks like all status checks pass. Did you get time to look at this @jhnns? Happy to help in any way possible 😄

Copy link
Member

@jhnns jhnns left a comment

Choose a reason for hiding this comment

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

There is an error in the typing :)

src/index.d.ts Outdated
}
}

declare function parseDomain (url: string, customTlds?: RegExp | string[], privateTlds?: boolean): parseDomain.IParsedDomain;
Copy link
Member

Choose a reason for hiding this comment

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

customTlds and privateTlds should be part of an ParseOptions object. Take a look at the README :)

@mitsuruog
Copy link
Contributor Author

@jhnns I have fixed your review point. please review me again.

Copy link
Member

@jhnns jhnns left a comment

Choose a reason for hiding this comment

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

Thanks ❤️. There's still one mistake (I missed it in the first review as well, sorry), but I'm going to merge this one and fix it on master.

}
}

declare function parseDomain (url: string, options?: parseDomain.IParseOptions): parseDomain.IParsedDomain;
Copy link
Member

Choose a reason for hiding this comment

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

parseDomain() returns null when the given URL was not valid.

@jhnns jhnns changed the title Add Typings feat: Add TypeScript typings May 29, 2019
@jhnns jhnns merged commit 10b6693 into peerigon:master May 29, 2019
jhnns added a commit that referenced this pull request May 29, 2019
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.

3 participants