Enhance date parsing in WHOIS and add tests for registrar expiration dates

Updated the `toISO` function to handle various timezone formats in WHOIS date strings. Added tests to verify parsing of registrar registration expiration dates and EDUCAUSE format dates in the normalization process. This improves the accuracy of date handling in WHOIS responses.
This commit is contained in:
2025-10-08 19:39:56 -04:00
parent f8280508ff
commit 9661db0b46
4 changed files with 83 additions and 12 deletions
+12
View File
@@ -31,17 +31,29 @@ export function normalizeWhois(
"domain create date",
"created",
"registered",
// EDUCAUSE (.edu)
"domain record activated",
]);
const updatedDate = anyValue(map, [
"updated date",
"last updated",
"last modified",
"modified",
// EDUCAUSE (.edu)
"domain record last updated",
]);
const expirationDate = anyValue(map, [
"registry expiry date",
"registry expiration date",
"expiry date",
"expiration date",
// Registrar-side synonyms commonly seen after referrals
"registrar registration expiration date",
"registrar registration expiry date",
"registrar expiration date",
"registrar expiry date",
// EDUCAUSE (.edu)
"domain expires",
"paid-till",
"expires on",
"renewal date",