From 11bf7ee327c5d36c536850838e998e698e21ba6a Mon Sep 17 00:00:00 2001 From: Frederik Riewerts Date: Mon, 4 Mar 2024 14:46:32 +0100 Subject: [PATCH] fix(pv-stylemark): alphabetically sort categories by default --- packages/pv-stylemark/tasks/lsg/getLsgData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pv-stylemark/tasks/lsg/getLsgData.js b/packages/pv-stylemark/tasks/lsg/getLsgData.js index 80c8178..4719a0e 100644 --- a/packages/pv-stylemark/tasks/lsg/getLsgData.js +++ b/packages/pv-stylemark/tasks/lsg/getLsgData.js @@ -111,7 +111,7 @@ const getDataSortedByCategory = (lsgData, config) => { const orderedCategoryList = categoryList.sort((a, b) => { const aIndex = orderConfig.indexOf(a.categoryName); const bIndex = orderConfig.indexOf(b.categoryName); - if (aIndex === -1 && bIndex === -1) return 0; + if (aIndex === -1 && bIndex === -1) return a.categoryName.localeCompare(b.categoryName); if (aIndex === -1) return 1; if (bIndex === -1) return -1; return aIndex - bIndex;