debian-mirror-gitlab/app/assets/javascripts/emoji/utils.js
2022-07-29 14:03:07 +02:00

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;
}