1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-26 06:54:18 +00:00
pds-2021-g2-nest/nest_frontend/utils/objectToWordcloudFormat.js

13 lines
No EOL
294 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
}