bigbuffet-rw/app/soapbox/utils/normalizers.js
2022-03-10 19:55:14 -06:00

7 lines
268 B
JavaScript

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