From 64f06f8467c5f50771c62ce4ff72ee6dc66fe3a9 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Fri, 8 Feb 2019 08:05:13 +0100 Subject: [PATCH] chore: fix undefined issue --- src/api/web/endpoint/package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/web/endpoint/package.js b/src/api/web/endpoint/package.js index 21e4f028e..aaf24ad3a 100644 --- a/src/api/web/endpoint/package.js +++ b/src/api/web/endpoint/package.js @@ -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)); });