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

13 lines
295 B
JavaScript
Raw Normal View History

2021-05-20 10:15:13 +00:00
export default function objectToWordcloudFormat(words) {
let result = []
for(const word in words) {
if(!words.hasOwnProperty(word)) {
continue
}
result.push({
text: word,
2021-05-20 10:16:01 +00:00
value: words[word],
2021-05-20 10:15:13 +00:00
})
}
return result
}