all files / lib/locales/hu-HU/internet/ index.js

100% Statements 9/9
90% Branches 9/10
100% Functions 3/3
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49                                                                                
module.exports = {
	tld: [
		"hu"
	],
 
	userName(firstName, lastName) {
		firstName = this.slugify(firstName ? firstName : this.populate("#{names.firstName}")).toLowerCase();
		lastName = this.slugify(lastName ? lastName : this.populate("#{names.lastName}")).toLowerCase();
 
		return this.populate(this.random.arrayElement([
			`${lastName}.${firstName}`,
			`${lastName}.${firstName}##`,
			`${lastName}.${firstName}####`,
			`${lastName}_${firstName}`,
			`${lastName}_${firstName}##`,
			`${lastName}${firstName}##`,
			`${lastName}##`
		]));
	},
 
	domain() {
		return this.slugify(this.populate(this.random.arrayElement([
			"#{names.lastName}",
			"#{names.lastName}#{names.firstName}",
			"#{names.lastName}-#{names.firstName}"
		]))).toLowerCase() + "." + this.random.arrayElement(module.exports.tld);
	},
 
	emailDomain: [
		"gmail.com",
		"freemail.hu",
		"mailbox.hu"		
	],
 
	email(firstName, lastName, domain) {
		firstName = this.slugify(firstName ? firstName : this.populate("#{names.firstName}")).toLowerCase();
		lastName = this.slugify(lastName ? lastName : this.populate("#{names.lastName}")).toLowerCase();
		domain = domain ? domain : this.populate("#{internet.emailDomain}");
 
		return [
			`${lastName}.${firstName}@${domain}`,
			`${lastName}.${firstName}##@${domain}`,
			`${lastName}${firstName}##@${domain}`,
			`${lastName}##@${domain}`
		];
	}
 
};