0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00

Merge pull request #1612 from Claude-Ray/refactor/simplify-conditional-expr

refactor: simplify the conditional expression
This commit is contained in:
Juan Picado @jotadeveloper 2019-12-13 08:50:49 +01:00 committed by GitHub
commit d9c93e8c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);