<commit_before>const domains = require('disposable-email-domains');
const wildcards = require('disposable-email-domains/wildcard.json');

module.exports = {
	isDisposableEmail: (email) => {
		if (!email) {
			return false;
		}

		// extract domain from email
		const [, domain] = email.toString().split('@');
		if (!domain) {
			return false;
		}

		// check for exact domain blacklist matches
		if (domains.includes(domain)) {
			return true;
		}

		// check wildcards to include subdomains
		for (const wildcard of wildcards) {
			if (domain.endsWith(wildcard)) {
				return true;
			}
		}

		return false;
	},
};
<commit_msg>block additional domains with custom wildcard<commit_after>const domains = require('disposable-email-domains');
const wildcards = require('disposable-email-domains/wildcard.json');

const customWildcards = [
	'grugrug.ru',
	'yeezus.ru',
];

module.exports = {
	isDisposableEmail: (email) => {
		if (!email) {
			return false;
		}

		// extract domain from email
		const [, domain] = email.toString().split('@');
		if (!domain) {
			return false;
		}

		// check for exact domain blacklist matches
		if (domains.includes(domain)) {
			return true;
		}

		// check wildcards to include subdomains
		for (const wildcard of wildcards) {
			if (domain.endsWith(wildcard)) {
				return true;
			}
		}

		// check custom wildcards
		for (const wildcard of customWildcards) {
			if (domain.endsWith(wildcard)) {
				return true;
			}
		}

		return false;
	},
};

{'fraction_non_alphanumeric': 0.1349527665317139, 'fraction_numerical': 0.0, 'mean_word_length': 3.3746312684365782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5690827', 'n_tokens_mistral': 566, 'n_tokens_neox': 473, 'n_words': 121}