Rename data.short_names => data.aliases

nolan/hinaloe-test
Etienne Lemay 2018-04-26 16:31:16 -04:00
parent 253ef4de89
commit 0f37b428f6
No known key found for this signature in database
GPG Key ID: EE7CF89146BB28E9
2 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ var fs = require('fs'),
inflection = require('inflection'), inflection = require('inflection'),
mkdirp = require('mkdirp') mkdirp = require('mkdirp')
var data = { categories: [], emojis: {}, skins: {}, short_names: {} }, var data = { categories: [], emojis: {}, skins: {}, aliases: {} },
categoriesIndex = {} categoriesIndex = {}
var categories = [ var categories = [
@ -68,7 +68,7 @@ emojiData.forEach((datum) => {
return return
} }
data.short_names[short_name] = datum.short_name data.aliases[short_name] = datum.short_name
}) })
datum.short_names = datum.short_names.filter((i) => i !== datum.short_name) datum.short_names = datum.short_names.filter((i) => i !== datum.short_name)

View File

@ -71,8 +71,8 @@ function getData(emoji, skin, set, data) {
} }
} }
if (data.short_names.hasOwnProperty(emoji)) { if (data.aliases.hasOwnProperty(emoji)) {
emoji = data.short_names[emoji] emoji = data.aliases[emoji]
} }
if (data.emojis.hasOwnProperty(emoji)) { if (data.emojis.hasOwnProperty(emoji)) {
@ -81,8 +81,8 @@ function getData(emoji, skin, set, data) {
return null return null
} }
} else if (emoji.id) { } else if (emoji.id) {
if (data.short_names.hasOwnProperty(emoji.id)) { if (data.aliases.hasOwnProperty(emoji.id)) {
emoji.id = data.short_names[emoji.id] emoji.id = data.aliases[emoji.id]
} }
if (data.emojis.hasOwnProperty(emoji.id)) { if (data.emojis.hasOwnProperty(emoji.id)) {