Skip to content

Commit 07d0137

Browse files
authored
Update fetch-data.js
1 parent 0cba028 commit 07d0137

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fetch-data.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
fetch("https://raw.is-a.dev")
22
.then((response) => response.json())
33
.then((data) => {
4+
data = data.filter((domain) => !domain.reserved);
5+
46
const subdomains = data.length;
57
const uniqueUsers = [...new Set(data.map((domain) => domain.owner.username))].length;
68
const averageDomainsPerUser = (subdomains / uniqueUsers).toFixed(1);
7-
const mostDomains = [...new Set(data.map((domain) => domain.owner.username))].reduce((a, b) =>
9+
const mostDomains = [...new Set(data.filter((domain) => domain.owner.username !== "is-a-dev").map((domain) => domain.owner.username))].reduce((a, b) =>
810
data.filter((domain) => domain.owner.username === a).length >=
911
data.filter((domain) => domain.owner.username === b).length
1012
? a

0 commit comments

Comments
 (0)