UNPKG

atlas-guide

Version:

Atlas is living style-guides & pattern library static site generator with extensive CSS monitoring and components info that could be used virtually with any scss/css project

23 lines (17 loc) 558 B
'use strict'; function selectorsListTops(array) { let selectorsList = array; let longestSelectors = []; selectorsList.forEach(list => { const selectorsArrayLength = list.split(/,/).length; if (selectorsArrayLength > 3) { longestSelectors.push({ selector: list.replace(/,/g, ',<br>'), selectors: selectorsArrayLength }); } }); longestSelectors.sort((a, b) => b.selectors - a.selectors); return longestSelectors; } module.exports = selectorsListTops;