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

chore: fix undefined issue

This commit is contained in:
Juan Picado @jotadeveloper 2019-02-08 08:05:13 +01:00
parent 49c6f0353e
commit 64f06f8467
No known key found for this signature in database
GPG key ID: 18AC54485952D158

View file

@ -12,7 +12,7 @@ import type { Router } from 'express';
import type { IAuth, $ResponseExtend, $RequestExtend, $NextFunctionVer, IStorageHandler, $SidebarPackage } from '../../../../types';
import type { Config } from '@verdaccio/types';
const getOrder = order => {
const getOrder = (order = 'asc') => {
return order === 'asc';
};
@ -59,7 +59,7 @@ function addPackageWebApi(route: Router, storage: IStorageHandler, auth: IAuth,
const { web } = config;
// $FlowFixMe
const order: boolean = web.sort_packages ? getOrder(web.sort_packages) : true;
const order: boolean = config.web ? getOrder(web.sort_packages) : true;
next(sortByName(await processPermissionsPackages(packages), order));
});