Skip to content

Commit 491b374

Browse files
committed
fix: Status URL truncation and Updated Date parsing
- Fix parseMultipleFields to preserve colons in values (e.g., https:// URLs) - Add 'Updated Date' to lastModified field patterns - Rename package to @domaindetails/whois-parser (npm valid name) - Bump version to 1.0.1 Before: "clientTransferProhibited https" (truncated) After: "clientTransferProhibited https://icann.org/epp#clientTransferProhibited"
1 parent 5b61595 commit 491b374

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "ccTLD-whois-parser",
3-
"version": "1.0.0",
2+
"name": "@domaindetails/whois-parser",
3+
"version": "1.0.1",
44
"description": "Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)",
55
"type": "module",
66
"main": "whois-parser.js",

whois-parser.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ export function parseWhoisData(whoisText, domainName = null) {
128128

129129
const parseMultipleFields = (field) => {
130130
const matches = whoisText.match(new RegExp(`${field}:\\s*(.+)`, 'ig'));
131-
return matches ? matches.map(match => match.split(':')[1].trim()) : [];
131+
// Use slice(1).join(':') to preserve colons in the value (e.g., URLs like https://...)
132+
return matches ? matches.map(match => match.split(':').slice(1).join(':').trim()) : [];
132133
};
133134

134135
// Enhanced nameserver parsing for various ccTLD formats
@@ -263,6 +264,6 @@ export function parseWhoisData(whoisText, domainName = null) {
263264
registrant: parseField('Registrant', ['registrant name', 'org', 'Organization']),
264265
status: parseStatus(),
265266
dnssec: parseField('DNSSEC', ['Signed', 'dnssec']),
266-
lastModified: parseField('Last Modified', ['last modified', 'Last Update', 'Changed', 'changed']),
267+
lastModified: parseField('Updated Date', ['Last Modified', 'last modified', 'Last Update', 'Changed', 'changed']),
267268
};
268269
}

0 commit comments

Comments
 (0)