diff --git a/app/javascript/mastodon/features/emoji/emoji_utils.ts b/app/javascript/mastodon/features/emoji/emoji_utils.ts index e1c8bbda084..3dc193b2abb 100644 --- a/app/javascript/mastodon/features/emoji/emoji_utils.ts +++ b/app/javascript/mastodon/features/emoji/emoji_utils.ts @@ -34,22 +34,20 @@ const buildSearch = (data: Data) => { return search.join(','); }; -/* eslint-disable */ - const _JSON = JSON; const COLONS_REGEX = /^(?::([^:]+):)(?::skin-tone-(\d):)?$/; const SKINS = ['1F3FA', '1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF']; -// @ts-expect-error -function unifiedToNative(unified) { - let unicodes = unified.split('-'), - // @ts-expect-error - codePoints = unicodes.map((u) => `0x${u}`); +function unifiedToNative(unified: Emoji['unified']) { + const unicodes = unified?.split('-') ?? []; + const codePoints = unicodes.map((u) => +`0x${u}`); return String.fromCodePoint(...codePoints); } +/* eslint-disable */ + // @ts-expect-error function sanitize(emoji) { let {