Add search string to emojis data

exclude-unsupported-native-emojis
Etienne Lemay 2016-07-22 12:46:43 -04:00
parent 8da2aa3744
commit ee73a5d898
3 changed files with 11 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -40,6 +40,7 @@
"rimraf": "2.5.2",
"svg-inline-loader": "0.4.1",
"svg-inline-react": "1.0.1",
"uniq": "1.0.1",
"webpack": "1.12.14"
},
"scripts": {

View File

@ -2,9 +2,8 @@ var fs = require('fs'),
emojiData = require('emoji-data'),
emojiLib = require('emojilib'),
inflection = require('inflection'),
mkdirp = require('mkdirp')
// console.log(emojiLib.lib);
mkdirp = require('mkdirp'),
uniq = require('uniq')
var categories = ['People', 'Nature', 'Foods', 'Activity', 'Places', 'Objects', 'Symbols', 'Flags'],
data = { categories: [], emojis: {}, skins: {} },
@ -56,6 +55,13 @@ emojiData.forEach((datum) => {
}
datum.keywords = keywords
datum.search = uniq([]
.concat(datum.name.split(/[-|_|\s]+/))
.concat(datum.short_names)
.concat(datum.keywords)
.concat(datum.emoticons)
.map((s) => s.toLowerCase())
).join(',')
if (datum.category == 'Skin Tones') {
data.skins[datum.short_name] = datum