Skip to content

Commit

Permalink
Fixed - allow 1 char domain parts
Browse files Browse the repository at this point in the history
Andrei Igna committed Mar 27, 2019
1 parent fc6cfa8 commit 7eb4ab0
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ const isDomain = domain => {
}

const labels = punycode.toASCII(domain).split('.').reverse()
const labelTest = /^([a-z0-9-]{2,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 ? labelTest.test(label) && !label.startsWith('-') && !label.endsWith('-') : isTld(label)
40 changes: 20 additions & 20 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whoiser",
"version": "1.3.0",
"version": "1.3.1",
"description": "Whois info for TLDs, domains and IPs",
"main": "index.js",
"scripts": {
@@ -23,7 +23,7 @@
},
"homepage": "https://github.com/LayeredStudio/whoiser#readme",
"devDependencies": {
"mocha": "^6.0.0"
"mocha": "^6.0.2"
},
"dependencies": {
"punycode": "^2.1.1"

0 comments on commit 7eb4ab0

Please sign in to comment.