Skip to content

Commit

Permalink
fixed: domain test to include _
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiIgna committed Jan 22, 2024
1 parent f7dcece commit e45ed2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layered/dns-records",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"description": "Discover publicly available DNS Records for a domain",
"type": "module",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const isDomain = (domain: string): boolean => {
}

const labels = toASCII(domain).split('.').reverse()
const labelTest = /^([a-z0-9-]{1,64}|xn[a-z0-9-]{5,})$/i
const labelTest = /^([a-z0-9-_]{1,64}|xn[a-z0-9-]{5,})$/i

return labels.length > 1 && labels.every((label, index) => {
return index ? !label.startsWith('-') && !label.endsWith('-') && labelTest.test(label) : isTld(label)
Expand Down

0 comments on commit e45ed2c

Please sign in to comment.