mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-23 05:24:18 +00:00
13 lines
No EOL
295 B
JavaScript
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
|
|
} |