Skip to content

Full Toolkit for Next-Level Domain Analysis

Revert "Use Array.toSorted 👌"

Felix Wotschofskyfe766dd0546e
diff --git a/app/lookup/[domain]/certs/page.tsx b/app/lookup/[domain]/certs/page.tsx
index b12e656..49e3c8a 100644
--- a/app/lookup/[domain]/certs/page.tsx
+++ b/app/lookup/[domain]/certs/page.tsx
@@ -36,7 +36,7 @@ const CertsResultsPage: FC<CertsResultsPageProps> = async ({
const certs = await Promise.all(certRequests).then((responses) =>
responses
.flat()
- .toSorted(
+ .sort(
(a, b) =>
new Date(b.entry_timestamp).getTime() -
new Date(a.entry_timestamp).getTime()
diff --git a/app/lookup/[domain]/subdomains/page.tsx b/app/lookup/[domain]/subdomains/page.tsx
index b731b81..4fc9ce8 100644
--- a/app/lookup/[domain]/subdomains/page.tsx
+++ b/app/lookup/[domain]/subdomains/page.tsx
@@ -49,12 +49,12 @@ const SubdomainsResultsPage: FC<SubdomainsResultsPageProps> = async ({
domain,
firstSeen: issuedCerts
.filter((c) => c.domains.includes(domain))
- .toSorted((a, b) => a.date.getTime() - b.date.getTime())[0].date,
+ .sort((a, b) => a.date.getTime() - b.date.getTime())[0].date,
stillExists: hasRecords,
};
})
);
- const sortedResults = results.toSorted(
+ const sortedResults = results.sort(
(a, b) => b.firstSeen.getTime() - a.firstSeen.getTime()
);
diff --git a/components/DnsTable.tsx b/components/DnsTable.tsx
index 195c874..38c9101 100644
--- a/components/DnsTable.tsx
+++ b/components/DnsTable.tsx
@@ -42,7 +42,8 @@ const DnsTable: FC<DnsTableProps> = ({ records }) => (
</TableHeader>
<TableBody>
{value
- .toSorted((a, b) => naturalCompare(a.data, b.data))
+ .slice()
+ .sort((a, b) => naturalCompare(a.data, b.data))
.map((v) => (
<RecordRow key={v.type + v.data} record={v} />
))}
diff --git a/components/IpDetailsModal.tsx b/components/IpDetailsModal.tsx
index 13c1a01..f1d8260 100644
--- a/components/IpDetailsModal.tsx
+++ b/components/IpDetailsModal.tsx
@@ -68,11 +68,14 @@ const IpDetailsModal: FC<IpDetailsModalProps> = ({
label: 'IP',
value: ip,
},
- ...data.reverse.toSorted(naturalCompare).map((address) => ({
- type: EntryTypes.Reverse,
- label: 'Reverse',
- value: address,
- })),
+ ...data.reverse
+ .slice()
+ .sort(naturalCompare)
+ .map((address) => ({
+ type: EntryTypes.Reverse,
+ label: 'Reverse',
+ value: address,
+ })),
{
type: EntryTypes.Organization,
label: 'Organization',
diff --git a/components/ResultsGlobe.tsx b/components/ResultsGlobe.tsx
index b8def9f..829d9ee 100644
--- a/components/ResultsGlobe.tsx
+++ b/components/ResultsGlobe.tsx
@@ -75,7 +75,7 @@ const ResultsGlobe: FC<ResultsGlobeProps> = ({ domain, markers }) => {
d.results.A.length
? h(
'div',
- d.results.A.toSorted(naturalCompare)
+ d.results.A.sort(naturalCompare)
.slice(0, d.results.A.length > 5 ? 4 : 5)
.map((value) =>
h('p.text-xs.text-muted-foreground', value)
@@ -92,7 +92,7 @@ const ResultsGlobe: FC<ResultsGlobeProps> = ({ domain, markers }) => {
d.results.AAAA.length
? h(
'div',
- d.results.AAAA.toSorted(naturalCompare)
+ d.results.AAAA.sort(naturalCompare)
.slice(0, d.results.AAAA.length > 5 ? 4 : 5)
.map((value) =>
h('p.text-xs.text-muted-foreground', value)
@@ -109,7 +109,7 @@ const ResultsGlobe: FC<ResultsGlobeProps> = ({ domain, markers }) => {
d.results.CNAME.length
? h(
'div',
- d.results.CNAME.toSorted(naturalCompare)
+ d.results.CNAME.sort(naturalCompare)
.slice(0, d.results.CNAME.length > 5 ? 4 : 5)
.map((value) =>
h('p.text-xs.text-muted-foreground', value)