2022-03-12 13:01:00 -08:00
|
|
|
/**
|
|
|
|
* Emoji normalizer:
|
|
|
|
* Converts API emojis into our internal format.
|
|
|
|
* @see {@link https://docs.joinmastodon.org/entities/emoji/}
|
|
|
|
*/
|
2022-03-11 18:48:00 -08:00
|
|
|
import { Record as ImmutableRecord, Map as ImmutableMap } from 'immutable';
|
|
|
|
|
|
|
|
// https://docs.joinmastodon.org/entities/emoji/
|
2022-03-16 19:15:38 -07:00
|
|
|
export const EmojiRecord = ImmutableRecord({
|
2022-03-11 18:48:00 -08:00
|
|
|
category: '',
|
|
|
|
shortcode: '',
|
|
|
|
static_url: '',
|
|
|
|
url: '',
|
|
|
|
visible_in_picker: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const normalizeEmoji = (emoji: ImmutableMap<string, any>) => {
|
|
|
|
return EmojiRecord(emoji);
|
|
|
|
};
|