From d154e1f6bb12ff7ff539e7eb6ad2baa3ac692f99 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Mon, 5 Apr 2021 01:08:16 +0200 Subject: [PATCH] remove unused code. --- client/tools/emoji.ts | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/client/tools/emoji.ts b/client/tools/emoji.ts index 05ce5e83..5c539a6b 100644 --- a/client/tools/emoji.ts +++ b/client/tools/emoji.ts @@ -43,12 +43,6 @@ interface EmojiDatasource { obsoleted_by: string } -interface Emoji { - keywords: string[] - char: string - category: string -} - const SHEET_COLUMNS = 58 const MULTIPLY = 100 / (SHEET_COLUMNS - 1) @@ -69,20 +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(id.codePointAt(0)!.toString(16))) { - emoji_id = id - emoji = { - char: id, - keywords: emojis[id], - category: '' - } - break - } - } - if (!source.has_img_twitter) { console.log(source.short_name, 'not avalible for set twitter') continue @@ -90,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) {