<commit_before>// @flow
import {PSEUDO} from 'shared/constants'
import {property} from 'lodash'


export const Match = {
    lastMessage: match => {
        if (match.messages.length === 0) {
            return {
                formattedMessage: "It's a match!",
                status: PSEUDO
            }
        } else {
            const message = match.messages[match.messages.length - 1];
            if (message.isGIPHY) {
                return {
                    formattedMessage: "GIPHY",
                    status: PSEUDO
                }
            } else {
                return message
            }
        }
    },
    lastActivityDate: property('last_activity_date'),
    isSuperLike: match => {
        if (typeof match.is_super_like === 'undefined') {
            return false
        } else {
            return match.is_super_like
        }
    }
}<commit_msg>Adds _id for proper normalization<commit_after>// @flow
import {PSEUDO} from 'shared/constants'
import {property} from 'lodash'


export const Match = {
    lastMessage: match => {
        if (match.messages.length === 0) {
            return {
                formattedMessage: "It's a match!",
                status: PSEUDO,
                _id: `${match._id}_last`
            }
        } else {
            const message = match.messages[match.messages.length - 1];
            if (message.isGIPHY) {
                return {
                    formattedMessage: "GIPHY",
                    status: PSEUDO,
                    _id: `${match._id}_last`
                }
            } else {
                return message
            }
        }
    },
    lastActivityDate: property('last_activity_date'),
    isSuperLike: match => {
        if (typeof match.is_super_like === 'undefined') {
            return false
        } else {
            return match.is_super_like
        }
    }
}
{'fraction_non_alphanumeric': 0.1038135593220339, 'fraction_numerical': 0.00211864406779661, 'mean_word_length': 1.346583850931677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3104281', 'n_tokens_mistral': 532, 'n_tokens_neox': 507, 'n_words': 114}