From 2c0b10b0ee77e27bd1498bd457248686c30a45e4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 1 Jun 2023 16:28:24 +0900 Subject: [PATCH] refactor --- packages/frontend/src/scripts/emojilist.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/scripts/emojilist.ts b/packages/frontend/src/scripts/emojilist.ts index 3f63e6b214..79661b7ce9 100644 --- a/packages/frontend/src/scripts/emojilist.ts +++ b/packages/frontend/src/scripts/emojilist.ts @@ -30,10 +30,10 @@ for (let i = 0; i < emojilist.length; i++) { export const emojiCharByCategory = _charGroupByCategory; -export function getEmojiName(char: string): string | undefined { +export function getEmojiName(char: string): string | null { const idx = _indexByChar.get(char); - if (typeof idx === 'undefined') { - return undefined; + if (idx == null) { + return null; } else { return emojilist[idx].name; }