From 5f3ed76d54f7aa78249d534d655d26b2a932def5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 11 Feb 2025 10:48:42 -0500 Subject: [PATCH] fix: isArray check --- src/activitypub/actors.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/activitypub/actors.js b/src/activitypub/actors.js index 939309c8dc..ef4e1497c1 100644 --- a/src/activitypub/actors.js +++ b/src/activitypub/actors.js @@ -231,7 +231,8 @@ Actors.getLocalFollowers = async (id) => { }; Actors.getLocalFollowCounts = async (actors) => { - if (!Array.isArray(actors)) { + const isArray = Array.isArray(actors); + if (!isArray) { actors = [actors]; } @@ -251,7 +252,7 @@ Actors.getLocalFollowCounts = async (actors) => { return { followers: followersCounts[index], following: followingCounts[index] }; }); - return Array.isArray(actors) ? results : results[0]; + return isArray ? results : results[0]; }; Actors.remove = async (id) => {