mirror of
https://github.com/jakejarvis/rdapper.git
synced 2026-09-23 01:25:31 -04:00
Refactor lookup and normalization functions to improve type safety and error handling. Updated domain lookup to provide a stable ISO string fallback and enhanced error messaging. Modified RDAP normalization to use stricter types and added utility functions for type assertions.
This commit is contained in:
@@ -7,9 +7,11 @@ test("toISO parses ISO and common whois formats", () => {
|
||||
assert.equal(iso, "2023-01-02T03:04:05Z");
|
||||
|
||||
const noZ = toISO("2023-01-02 03:04:05");
|
||||
// biome-ignore lint/style/noNonNullAssertion: this is fine
|
||||
assert.match(noZ!, /^2023-01-02T03:04:05Z$/);
|
||||
|
||||
const slash = toISO("2023/01/02 03:04:05");
|
||||
// biome-ignore lint/style/noNonNullAssertion: this is fine
|
||||
assert.match(slash!, /^2023-01-02T03:04:05Z$/);
|
||||
|
||||
const dmy = toISO("02-Jan-2023");
|
||||
|
||||
Reference in New Issue
Block a user