Skip to content

Commit e594dcd

Browse files
committed
Fixed - properly rename "Expiry Date" and test for it
1 parent 69e601d commit e594dcd

File tree

6 files changed

+36
-28
lines changed

6 files changed

+36
-28
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [8.x, 10.x, 12.x]
11+
node-version: [10.x, 12.x]
1212

1313
steps:
1414
- uses: actions/checkout@v1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Aiming to have these features:
2121
- [x] query whois for IPs and return parsed result -> `whoiser.ip()`
2222
- [x] query whois for ASN with parsed result -> `whoiser.asn()`
2323
- [x] Punycode support
24-
- [ ] Normalize Domain whois field names, removing inconsistencies between whois servers
25-
- [ ] Test more IPs and ASNs to deliver consistent whois results
24+
- [ ] Normalize Domain WHOIS field names, removing inconsistencies between WHOIS servers
25+
- [ ] Test more IPs and ASNs to deliver consistent WHOIS results
2626

2727
## Getting Started
2828

@@ -64,7 +64,7 @@ Returns a promise which resolves with an `Object` of WHOIS servers checked:
6464
"Domain Name": "google.com",
6565
"Registrar WHOIS Server": "whois.markmonitor.com",
6666
"Creation Date": "1997-09-15T00:00:00-0700",
67-
"Registrar Registration Expiration Date": "2020-09-13T21:00:00-0700",
67+
"Expiry Date": "2020-09-13T21:00:00-0700",
6868
"Registrar": "MarkMonitor, Inc.",
6969
"Domain Status": [
7070
"clientUpdateProhibited",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "whoiser",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Whois info for TLDs, domains and IPs",
55
"keywords": [
66
"whois",

parsers.js

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,34 @@ const parseSimpleWhois = whois => {
116116

117117
const parseDomainWhois = whois => {
118118
const renameLabels = {
119-
'domain name': 'Domain Name',
120-
'domain': 'Domain Name',
121-
'nameserver': 'Name Server',
122-
'nameservers': 'Name Server',
123-
'nserver': 'Name Server',
124-
'name servers': 'Name Server',
125-
'flags': 'Domain Status',
126-
'status': 'Domain Status',
119+
'domain name': 'Domain Name',
120+
'domain': 'Domain Name',
121+
'idn tag': 'IDN',
122+
'internationalized domain name': 'IDN',
123+
'nameserver': 'Name Server',
124+
'nameservers': 'Name Server',
125+
'nserver': 'Name Server',
126+
'name servers': 'Name Server',
127+
'flags': 'Domain Status',
128+
'status': 'Domain Status',
127129
'sponsoring registrar iana id': 'Registrar IANA ID',
128-
'registrar': 'Registrar',
129-
'creation date': 'Created Date',
130-
'registered on': 'Created Date',
131-
'created': 'Created Date',
132-
'registration time': 'Created Date',
133-
'registered on': 'Created Date',
134-
'last updated': 'Updated Date',
135-
'changed': 'Updated Date',
130+
'registrar': 'Registrar',
131+
'creation date': 'Created Date',
132+
'registered on': 'Created Date',
133+
'created': 'Created Date',
134+
'registration time': 'Created Date',
135+
'registered on': 'Created Date',
136+
'last updated': 'Updated Date',
137+
'changed': 'Updated Date',
136138
'registrar registration expiration date': 'Expiry Date',
137-
'registry expiry date': 'Expiry date',
138-
'expires on': 'Expiry Date',
139-
'expiration time': 'Expiry Date',
140-
'expire date': 'Expiry Date',
141-
'paid-till': 'Expiry Date',
142-
'expiry date': 'Expiry Date'
139+
'registry expiry date': 'Expiry Date',
140+
'expires on': 'Expiry Date',
141+
'expiration time': 'Expiry Date',
142+
'expire date': 'Expiry Date',
143+
'paid-till': 'Expiry Date',
144+
'expiry date': 'Expiry Date',
145+
'registrant': 'Registrant Name',
146+
'Registrant Contact Email': 'Registrant Email'
143147
}
144148
const ignoreLabels = ['note', 'notes', 'please note', 'important', 'notice', 'terms of use', 'web-based whois', 'https', 'to', 'registration service provider']
145149
const ignoreTexts = [

test/test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ describe('Whoiser', function() {
1313
let whois = await whoiser('google.com')
1414
assert.equal(whois['whois.verisign-grs.com']['Domain Name'], 'GOOGLE.COM', 'Domain name doesn\'t match')
1515
assert.equal(whois['whois.verisign-grs.com']['Registry Domain ID'], '2138514_DOMAIN_COM-VRSN', 'Registry Domain ID doesn\'t match')
16+
17+
for (const whoisServer in whois) {
18+
assert(Object.keys(whois[whoisServer]).includes('Expiry Date'), 'Whois result doesn\'t have "Expiry Date"')
19+
}
1620
});
1721

1822
it('should return IP WHOIS for "1.1.1.1"', async function() {

0 commit comments

Comments
 (0)