0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

refactor: simplify conditional expression

This commit is contained in:
claude 2019-12-12 20:32:51 +08:00
parent a7172dc9af
commit e85e8bfaa9
No known key found for this signature in database
GPG key ID: 0564DE1F7D4EB7FD

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