1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-24 14:04:19 +00:00
pds-2021-g2-nest/nest_frontend/utils/objectToWordcloudFormat.js
2021-05-20 12:16:01 +02:00

13 lines
No EOL
295 B
JavaScript

export default function objectToWordcloudFormat(words) {
let result = []
for(const word in words) {
if(!words.hasOwnProperty(word)) {
continue
}
result.push({
text: word,
value: words[word],
})
}
return result
}