From e85e8bfaa9fad2905a48d5d2bb6a3a9408a1fadd Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 12 Dec 2019 20:32:51 +0800 Subject: [PATCH] refactor: simplify conditional expression --- src/api/endpoint/api/stars.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/endpoint/api/stars.ts b/src/api/endpoint/api/stars.ts index 21cd32afd..db56e8dd4 100644 --- a/src/api/endpoint/api/stars.ts +++ b/src/api/endpoint/api/stars.ts @@ -20,7 +20,7 @@ export default function(route: Router, storage: IStorageHandler): void { } const filteredPackages: Packages = localPackages.filter((localPackage: Package) => - localPackage[USERS] ? _.keys(localPackage[USERS]).indexOf(remoteUsername) >= 0 : false + _.keys(localPackage[USERS]).includes(remoteUsername) ); res.status(HTTP_STATUS.OK);