Remove unused fields from data

release
Etienne Lemay 2016-07-22 12:23:47 -04:00
parent 03b7996fda
commit 8da2aa3744
3 changed files with 16 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -64,6 +64,15 @@ emojiData.forEach((datum) => {
data.categories[categoryIndex].emojis.push(datum.short_name)
data.emojis[datum.short_name] = datum
}
delete datum.docomo
delete datum.au
delete datum.softbank
delete datum.google
delete datum.image
delete datum.short_name
delete datum.category
delete datum.sort_order
})
var flags = data.categories[categoriesIndex['Flags']];

View File

@ -18,20 +18,21 @@ var index = lunr(function() {
for (let emoji in data.emojis) {
let emojiData = data.emojis[emoji],
{ short_name, name, emoticons } = emojiData
{ short_names, name, emoticons } = emojiData,
id = short_names[0]
for (let emoticon of emoticons) {
if (!emoticonsList[emoticon]) {
emoticonsList[emoticon] = short_name
emoticonsList[emoticon] = id
}
}
emojisList[short_name] = getSanitizedData(short_name)
emojisList[id] = getSanitizedData(id)
index.add({
id: short_name,
id: id,
emoticons: emoticons,
short_name: tokenize(short_name),
short_name: tokenize(id),
name: tokenize(name),
})
}