Skip to content

Commit

Permalink
Fixed - properly rename "Expiry Date" and test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiIgna committed Nov 2, 2019
1 parent 69e601d commit e594dcd
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Aiming to have these features:
- [x] query whois for IPs and return parsed result -> `whoiser.ip()`
- [x] query whois for ASN with parsed result -> `whoiser.asn()`
- [x] Punycode support
- [ ] Normalize Domain whois field names, removing inconsistencies between whois servers
- [ ] Test more IPs and ASNs to deliver consistent whois results
- [ ] Normalize Domain WHOIS field names, removing inconsistencies between WHOIS servers
- [ ] Test more IPs and ASNs to deliver consistent WHOIS results

## Getting Started

Expand Down Expand Up @@ -64,7 +64,7 @@ Returns a promise which resolves with an `Object` of WHOIS servers checked:
"Domain Name": "google.com",
"Registrar WHOIS Server": "whois.markmonitor.com",
"Creation Date": "1997-09-15T00:00:00-0700",
"Registrar Registration Expiration Date": "2020-09-13T21:00:00-0700",
"Expiry Date": "2020-09-13T21:00:00-0700",
"Registrar": "MarkMonitor, Inc.",
"Domain Status": [
"clientUpdateProhibited",
Expand Down
2 changes: 1 addition & 1 deletion 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": "whoiser",
"version": "1.5.0",
"version": "1.5.1",
"description": "Whois info for TLDs, domains and IPs",
"keywords": [
"whois",
Expand Down
48 changes: 26 additions & 22 deletions parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,34 @@ const parseSimpleWhois = whois => {

const parseDomainWhois = whois => {
const renameLabels = {
'domain name': 'Domain Name',
'domain': 'Domain Name',
'nameserver': 'Name Server',
'nameservers': 'Name Server',
'nserver': 'Name Server',
'name servers': 'Name Server',
'flags': 'Domain Status',
'status': 'Domain Status',
'domain name': 'Domain Name',
'domain': 'Domain Name',
'idn tag': 'IDN',
'internationalized domain name': 'IDN',
'nameserver': 'Name Server',
'nameservers': 'Name Server',
'nserver': 'Name Server',
'name servers': 'Name Server',
'flags': 'Domain Status',
'status': 'Domain Status',
'sponsoring registrar iana id': 'Registrar IANA ID',
'registrar': 'Registrar',
'creation date': 'Created Date',
'registered on': 'Created Date',
'created': 'Created Date',
'registration time': 'Created Date',
'registered on': 'Created Date',
'last updated': 'Updated Date',
'changed': 'Updated Date',
'registrar': 'Registrar',
'creation date': 'Created Date',
'registered on': 'Created Date',
'created': 'Created Date',
'registration time': 'Created Date',
'registered on': 'Created Date',
'last updated': 'Updated Date',
'changed': 'Updated Date',
'registrar registration expiration date': 'Expiry Date',
'registry expiry date': 'Expiry date',
'expires on': 'Expiry Date',
'expiration time': 'Expiry Date',
'expire date': 'Expiry Date',
'paid-till': 'Expiry Date',
'expiry date': 'Expiry Date'
'registry expiry date': 'Expiry Date',
'expires on': 'Expiry Date',
'expiration time': 'Expiry Date',
'expire date': 'Expiry Date',
'paid-till': 'Expiry Date',
'expiry date': 'Expiry Date',
'registrant': 'Registrant Name',
'Registrant Contact Email': 'Registrant Email'
}
const ignoreLabels = ['note', 'notes', 'please note', 'important', 'notice', 'terms of use', 'web-based whois', 'https', 'to', 'registration service provider']
const ignoreTexts = [
Expand Down
4 changes: 4 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ describe('Whoiser', function() {
let whois = await whoiser('google.com')
assert.equal(whois['whois.verisign-grs.com']['Domain Name'], 'GOOGLE.COM', 'Domain name doesn\'t match')
assert.equal(whois['whois.verisign-grs.com']['Registry Domain ID'], '2138514_DOMAIN_COM-VRSN', 'Registry Domain ID doesn\'t match')

for (const whoisServer in whois) {
assert(Object.keys(whois[whoisServer]).includes('Expiry Date'), 'Whois result doesn\'t have "Expiry Date"')
}
});

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

0 comments on commit e594dcd

Please sign in to comment.