Archived
2
0

fix emojis

This commit is contained in:
mbattista 2021-04-04 22:36:47 +00:00
parent 90bc4b3280
commit 9a437b63ff
3 changed files with 9 additions and 6 deletions

View File

@ -55,7 +55,7 @@
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^7.0.0",
"core-js": "^3.9.1",
"emojilib": "^2.4.0",
"emojilib": "^3.0.1",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^7.8.0",

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ import * as fs from 'fs'
import { custom } from './emoji_custom'
const datasource = require('emoji-datasource/emoji.json') as EmojiDatasource[]
const emojis = require('emojilib/emojis.json') as { [id: string]: Emoji }
const emojis = require('emojilib')
interface EmojiDatasource {
name: string
@ -46,7 +46,6 @@ interface EmojiDatasource {
interface Emoji {
keywords: string[]
char: string
fitzpatrick_scale: boolean
category: string
}
@ -73,9 +72,13 @@ for (const source of datasource) {
let emoji: Emoji | null = null
let emoji_id: string = ''
for (const id of Object.keys(emojis)) {
if (unified.includes(emojis[id].char.codePointAt(0)!.toString(16))) {
if (unified.includes(id.codePointAt(0)!.toString(16))) {
emoji_id = id
emoji = emojis[id]
emoji = {
char: id,
keywords: emojis[id],
category: ''
}
break
}
}