diff --git a/lib/findPaths.js b/lib/findPaths.js index e1b7beb..605956e 100644 --- a/lib/findPaths.js +++ b/lib/findPaths.js @@ -81,6 +81,19 @@ function findDistancesForAllElements({nodes, links}){ return distances } +function abridgeArrayAndDisplay(array){ + let newArray + if(array.length > 10){ + newArray = array.slice(0,10) + newArray[11] = "..." + }else{ + newArray=array + } + let formatForDisplay= newArray.map(d => formatLargeOrSmall(d)) + let result = JSON.stringify(formatForDisplay, null, 2).replaceAll(`"`, "") + return result +} + export function CreateTableWithDistances({isListOrdered, orderedList, listOfElements, links}){ if(!isListOrdered || orderedList.length < listOfElements.length){ return (