Add search string to emojis data
parent
8da2aa3744
commit
ee73a5d898
File diff suppressed because one or more lines are too long
|
@ -40,6 +40,7 @@
|
||||||
"rimraf": "2.5.2",
|
"rimraf": "2.5.2",
|
||||||
"svg-inline-loader": "0.4.1",
|
"svg-inline-loader": "0.4.1",
|
||||||
"svg-inline-react": "1.0.1",
|
"svg-inline-react": "1.0.1",
|
||||||
|
"uniq": "1.0.1",
|
||||||
"webpack": "1.12.14"
|
"webpack": "1.12.14"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -2,9 +2,8 @@ var fs = require('fs'),
|
||||||
emojiData = require('emoji-data'),
|
emojiData = require('emoji-data'),
|
||||||
emojiLib = require('emojilib'),
|
emojiLib = require('emojilib'),
|
||||||
inflection = require('inflection'),
|
inflection = require('inflection'),
|
||||||
mkdirp = require('mkdirp')
|
mkdirp = require('mkdirp'),
|
||||||
|
uniq = require('uniq')
|
||||||
// console.log(emojiLib.lib);
|
|
||||||
|
|
||||||
var categories = ['People', 'Nature', 'Foods', 'Activity', 'Places', 'Objects', 'Symbols', 'Flags'],
|
var categories = ['People', 'Nature', 'Foods', 'Activity', 'Places', 'Objects', 'Symbols', 'Flags'],
|
||||||
data = { categories: [], emojis: {}, skins: {} },
|
data = { categories: [], emojis: {}, skins: {} },
|
||||||
|
@ -56,6 +55,13 @@ emojiData.forEach((datum) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
datum.keywords = keywords
|
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') {
|
if (datum.category == 'Skin Tones') {
|
||||||
data.skins[datum.short_name] = datum
|
data.skins[datum.short_name] = datum
|
||||||
|
|
Loading…
Reference in New Issue