sassdoc-extras
Version:
SassDoc's Toolbelt
23 lines (16 loc) • 375 B
JavaScript
module.exports = function byGroupAndType (data) {
var sorted = {}
data.forEach(function (item) {
var group = item.group[0]
var type = item.context.type
if (!(group in sorted)) {
sorted[group] = {}
}
if (!(type in sorted[group])) {
sorted[group][type] = []
}
sorted[group][type].push(item)
})
return sorted
}