@cleandns/whois-rdap 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -133,10 +133,10 @@ export async function whois(origDomain, options = { fetch: fetch, thinOnly: fals
133
133
  // registrar
134
134
  const { events, ...registrar } = registrars.sort((a, b) => {
135
135
  var _a, _b;
136
- const aDate = (((_a = a.events.find((ev) => ev.eventAction === "registration")) === null || _a === void 0 ? void 0 : _a.eventDate) || 0)
136
+ const aDate = (((_a = (a.events || []).find((ev) => ev.eventAction === "registration")) === null || _a === void 0 ? void 0 : _a.eventDate) || 0)
137
137
  .toString()
138
138
  .replace(/\+0000Z$/, "Z");
139
- const bDate = (((_b = b.events.find((ev) => ev.eventAction === "registration")) === null || _b === void 0 ? void 0 : _b.eventDate) || 0)
139
+ const bDate = (((_b = (b.events || []).find((ev) => ev.eventAction === "registration")) === null || _b === void 0 ? void 0 : _b.eventDate) || 0)
140
140
  .toString()
141
141
  .replace(/\+0000Z$/, "Z");
142
142
  return new Date(bDate).valueOf() - new Date(aDate).valueOf();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleandns/whois-rdap",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -210,13 +210,13 @@ export async function whois(
210
210
  // registrar
211
211
  const { events, ...registrar } = registrars.sort((a: any, b: any) => {
212
212
  const aDate = (
213
- a.events.find((ev: any) => ev.eventAction === "registration")
213
+ (a.events || []).find((ev: any) => ev.eventAction === "registration")
214
214
  ?.eventDate || 0
215
215
  )
216
216
  .toString()
217
217
  .replace(/\+0000Z$/, "Z");
218
218
  const bDate = (
219
- b.events.find((ev: any) => ev.eventAction === "registration")
219
+ (b.events || []).find((ev: any) => ev.eventAction === "registration")
220
220
  ?.eventDate || 0
221
221
  )
222
222
  .toString()