debian-mirror-gitlab/app/assets/javascripts/emoji/utils.js
2022-07-23 20:15:48 +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;
}