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

30 lines (22 loc) 582 B
'use strict'; function ruleSizeStat(selectorsList) { if (!selectorsList) { return false; } let rulesetStat = { heavy: [], empty: [] }; selectorsList.forEach(item => { if (item.declarations > 15) { rulesetStat.heavy.push(item); } if (item.declarations < 1) { rulesetStat.empty.push(item); } }); Object.keys(rulesetStat).forEach(key => rulesetStat[key].sort( (a, b) => b.declarations - a.declarations)); return rulesetStat; } module.exports = ruleSizeStat;