pleroma/app/soapbox/utils/normalizers.js

8 lines
268 B
JavaScript
Raw Normal View History

// Use new value only if old value is undefined
export const mergeDefined = (oldVal, newVal) => oldVal === undefined ? newVal : oldVal;
2022-03-10 17:55:14 -08:00
export const makeEmojiMap = emojis => emojis.reduce((obj, emoji) => {
obj[`:${emoji.shortcode}:`] = emoji;
return obj;
}, {});