gitlab-org--gitlab-foss/app/assets/javascripts/emoji/utils.js

8 lines
304 B
JavaScript

import emojiIntents from 'emojis/intents.json';
import { NEUTRAL_INTENT_MULTIPLIER } from '~/emoji/constants';
export function getEmojiScoreWithIntent(emojiName, baseScore) {
const intentMultiplier = emojiIntents[emojiName] || NEUTRAL_INTENT_MULTIPLIER;
return 2 ** baseScore * intentMultiplier;
}