From a603a353d40937f81149ca0734887fe0fd554676 Mon Sep 17 00:00:00 2001 From: taichi221228 Date: Wed, 24 Apr 2024 10:22:32 +0900 Subject: [PATCH] Add comments for `skin_tone` in emoji_utils.ts This commit adds detailed comments explaining the usage of `skin_tone` in emoji_utils.ts, noting its absence in the type definition link and the need for a separate type with DefinitelyTyped. It also highlights potential mismatch issues between versions of `@types/emoji-mart` and `emoji-mart`, given they have different maintainers and packages. --- app/javascript/mastodon/features/emoji/emoji_utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/javascript/mastodon/features/emoji/emoji_utils.ts b/app/javascript/mastodon/features/emoji/emoji_utils.ts index a4b93d1a82b..98d8e9f3207 100644 --- a/app/javascript/mastodon/features/emoji/emoji_utils.ts +++ b/app/javascript/mastodon/features/emoji/emoji_utils.ts @@ -52,6 +52,12 @@ function unifiedToNative(unified: Emoji['unified']) { return String.fromCodePoint(...codePoints); } +/* + * `skin_tone` is used [here]{@link node_modules/emoji-mart/dist-es/utils/index.js#19}, but is not found in the [type definition]{@link node_modules/@types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts}. + * `emoji-mart` does not come with a built-in type, so you need to add a separate type with DefinitelyTyped. + * The type and implementation have different maintainers and packages, so the installed versions of `@types/emoji-mart` and `emoji-mart` may not match. + */ + function sanitize( emoji: BaseEmoji & CustomEmoji &