mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
commit
89dd22727c
@ -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
@ -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
|
||||
@ -43,13 +43,6 @@ interface EmojiDatasource {
|
||||
obsoleted_by: string
|
||||
}
|
||||
|
||||
interface Emoji {
|
||||
keywords: string[]
|
||||
char: string
|
||||
fitzpatrick_scale: boolean
|
||||
category: string
|
||||
}
|
||||
|
||||
const SHEET_COLUMNS = 58
|
||||
const MULTIPLY = 100 / (SHEET_COLUMNS - 1)
|
||||
|
||||
@ -70,16 +63,6 @@ for (const emoji of custom) {
|
||||
for (const source of datasource) {
|
||||
const unified = source.unified.split('-').map(v => v.toLowerCase())
|
||||
|
||||
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))) {
|
||||
emoji_id = id
|
||||
emoji = emojis[id]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!source.has_img_twitter) {
|
||||
console.log(source.short_name, 'not avalible for set twitter')
|
||||
continue
|
||||
@ -87,10 +70,15 @@ for (const source of datasource) {
|
||||
|
||||
// keywords
|
||||
let words: string[] = []
|
||||
if (!emoji) {
|
||||
for (const id of Object.keys(emojis)) {
|
||||
if (unified.includes(id.codePointAt(0)!.toString(16))) {
|
||||
words = [id, ...emojis[id]]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (words.length == 0) {
|
||||
console.log(source.short_name, 'no keywords')
|
||||
} else {
|
||||
words = [emoji_id, ...emoji.keywords]
|
||||
}
|
||||
|
||||
for (const name of source.short_names) {
|
||||
|
Loading…
Reference in New Issue
Block a user