Delete empty arrays from data file
parent
dbf22073c8
commit
2de83100a0
|
@ -93,6 +93,14 @@ emojiData.forEach((datum) => {
|
|||
delete datum.short_name
|
||||
delete datum.category
|
||||
delete datum.sort_order
|
||||
|
||||
for (let key in datum) {
|
||||
let value = datum[key]
|
||||
|
||||
if (Array.isArray(value) && !value.length) {
|
||||
delete datum[key]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
var flags = data.categories[categoriesIndex['Flags']];
|
||||
|
|
|
@ -11,7 +11,7 @@ for (let emoji in data.emojis) {
|
|||
{ short_names, emoticons } = emojiData,
|
||||
id = short_names[0]
|
||||
|
||||
for (let emoticon of emoticons) {
|
||||
for (let emoticon of (emoticons || [])) {
|
||||
if (!emoticonsList[emoticon]) {
|
||||
emoticonsList[emoticon] = id
|
||||
}
|
||||
|
|
|
@ -68,6 +68,9 @@ function getData(emoji, skin, set) {
|
|||
}
|
||||
}
|
||||
|
||||
emojiData.emoticons || (emojiData.emoticons = [])
|
||||
emojiData.variations || (emojiData.variations = [])
|
||||
|
||||
if (emojiData.skin_variations && skin > 1 && set) {
|
||||
emojiData = JSON.parse(JSON.stringify(emojiData))
|
||||
|
||||
|
|
Loading…
Reference in New Issue