<commit_before>import { PostMention } from '../models';
import { IPost, IPostMention } from '../interfaces';
import extractMentions from './extract-mentions';
import publishStreamingMessage from './publish-streaming-message';

export default function savePostMentions(post: IPost, text: string): void {
	'use strict';
	extractMentions(text).then(users => {
		users.forEach(user => {
			PostMention.create({
				user: user.id,
				post: post.id
			}, (createErr: any, createdMention: IPostMention) => {
				publishStreamingMessage(`userStream:${user.id}`, JSON.stringify({
					type: 'mention',
					value: {
						id: post.id
					}
				}));
			});
		});
	});
}
<commit_msg>Fix ob<commit_after>import { PostMention } from '../models';
import { IPost, IPostMention } from '../interfaces';
import extractMentions from './extract-mentions';
import publishStreamingMessage from './publish-streaming-message';

export default function savePostMentions(post: IPost, text: string): void {
	'use strict';
	extractMentions(text).then(users => {
		users.forEach(user => {
			PostMention.create({
				user: user.id,
				post: post.id
			}, (createErr: any, createdMention: IPostMention) => {
				publishStreamingMessage(`user-stream:${user.id}`, JSON.stringify({
					type: 'mention',
					value: {
						id: post.id
					}
				}));
			});
		});
	});
}

{'fraction_non_alphanumeric': 0.161698956780924, 'fraction_numerical': 0.0, 'mean_word_length': 3.7793594306049823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2205941', 'n_tokens_mistral': 507, 'n_tokens_neox': 432, 'n_words': 91}