<commit_before>import { Hashtag } from '../models';
import { IUser, IHashtag } from '../interfaces';

export default function registerHashtags(me: IUser, hashtags: string[]): void {
	'use strict';
	hashtags.forEach(hashtag => {
		Hashtag.findOne({name: hashtag}, (err: any, existHashtag: IHashtag) => {
			if (existHashtag === null) {
				Hashtag.create({
					name: hashtag,
					users: [me.id]
				});
			} else {
				const meExist: any[] = (<any>existHashtag.users).filter((id: any) => {
					return id.toString() === me.id.toString();
				});
				if (meExist === []) {
					existHashtag.count++;
					(<any>existHashtag.users).push(me.id);
					existHashtag.save();
				}
			}
		});
	});<commit_msg>toLowerCase<commit_after>import { Hashtag } from '../models';
import { IUser, IHashtag } from '../interfaces';

export default function registerHashtags(me: IUser, hashtags: string[]): void {
	'use strict';
	hashtags.forEach(hashtag => {
		hashtag = hashtag.toLowerCase();
		Hashtag.findOne({
			name: hashtag
		}, (err: any, existHashtag: IHashtag) => {
			if (existHashtag === null) {
				Hashtag.create({
					name: hashtag,
					users: [me.id]
				});
			} else {
				const meExist: any[] = (<any>existHashtag.users).filter((id: any) => {
					return id.toString() === me.id.toString();
				});
				if (meExist === []) {
					existHashtag.count++;
					(<any>existHashtag.users).push(me.id);
					existHashtag.save();
				}
			}
		});
	});
{'fraction_non_alphanumeric': 0.19156293222683266, 'fraction_numerical': 0.0, 'mean_word_length': 3.2309941520467835, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '5603923', 'n_tokens_mistral': 641, 'n_tokens_neox': 529, 'n_words': 99}