Fusionner les variables et analyser leur tags

pull/1/head
Mael Thomas 2016-06-29 18:18:28 +02:00
parent e1b97aedc4
commit 50f0cdcaaf
1 changed files with 18 additions and 2 deletions

View File

@ -40,8 +40,24 @@ let
},
[items[0]])
return [...variableList, ...list]
}, [])
console.log('groupedMergedVariables', groupedMergedVariables)
}, []),
tagFrequency =
groupedMergedVariables
.reduce((stats, variable) => {
Object.keys(variable.tags).map(
k => {
stats[k] = stats[k] || {number: 0, choices: new Set()}
stats[k].number = stats[k].number + 1
stats[k].choices.add(variable.tags[k])
}
)
return stats
}
, {})
console.log('YOUYOU', tagFrequency)