From 7dfdaf5946934c79809a81c303856444dca46e81 Mon Sep 17 00:00:00 2001 From: Sefinek Date: Tue, 8 Oct 2024 20:30:12 +0200 Subject: [PATCH] Update `filter` --- scripts/sefinekAPI.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/sefinekAPI.js b/scripts/sefinekAPI.js index 8fe099c..ef139b1 100644 --- a/scripts/sefinekAPI.js +++ b/scripts/sefinekAPI.js @@ -7,7 +7,11 @@ const API_URL = `${process.env.SEFINEK_API_URL}/cloudflare-waf-abuseipdb/post`; module.exports = async () => { const userIp = clientIp.getAddress(); - const reportedIPs = readReportedIPs().filter(x => x.status === 'REPORTED' && x.ip !== userIp && !['//video', '//js', '//images', '//imgs', 'favicon.ico'].includes(x.endpoint) && !x.sefinekAPI); + const reportedIPs = readReportedIPs().filter(x => + x.status === 'REPORTED' && + x.ip !== userIp && !['//video', '//js', '//images', '//imgs', 'favicon.ico'].includes(x.endpoint) && + !x.sefinekAPI); + if (reportedIPs.length === 0) return; const uniqueLogs = reportedIPs.reduce((acc, ip) => {