src/random_name.js
function (name_type, gender, style) {
		let name = '';
		
		if (typeof name_type === 'undefined' || name_type === '' || name_type === 'random') {
			// randomize a type...
			name_type = randomizer.rollRandom(Object.keys(namedata.options));
		}
		if (typeof gender === 'undefined' || gender === 'random') {
			// randomize a gender...
			gender = randomizer.rollRandom(['male', 'female']);
		}
		if (typeof style === 'undefined' || style !== 'first') {
			style = '';
		}
		
		switch (name_type) {
			case 'holmesian':
				name = holmesname();
				break;
			case 'demonic':
				name = demonname();
				break;
			case 'cornish':
			case 'flemish':
			case 'dutch':
			case 'turkish':
			default:
				name = randomizer.rollRandom(namedata[name_type][gender]);
				if (style !== 'first' && typeof namedata[name_type]['surname'] !== 'undefined' && !r_helpers.isEmpty(namedata[name_type]['surname'])) {
					name += ' ' + randomizer.rollRandom(namedata[name_type]['surname']);
				}
				name = randomizer.findToken(name).trim();
				break;
		}
		return capitalizeName(name);
	}
function (name_type, gender, style) {
		let name = '';
		
		if (typeof name_type === 'undefined' || name_type === '' || name_type === 'random') {
			// randomize a type...
			name_type = randomizer.rollRandom(Object.keys(namedata.options));
		}
		if (typeof gender === 'undefined' || gender === 'random') {
			// randomize a gender...
			gender = randomizer.rollRandom(['male', 'female']);
		}
		if (typeof style === 'undefined' || style !== 'first') {
			style = '';
		}
		
		switch (name_type) {
			case 'holmesian':
				name = holmesname();
				break;
			case 'demonic':
				name = demonname();
				break;
			case 'cornish':
			case 'flemish':
			case 'dutch':
			case 'turkish':
			default:
				name = randomizer.rollRandom(namedata[name_type][gender]);
				if (style !== 'first' && typeof namedata[name_type]['surname'] !== 'undefined' && !r_helpers.isEmpty(namedata[name_type]['surname'])) {
					name += ' ' + randomizer.rollRandom(namedata[name_type]['surname']);
				}
				name = randomizer.findToken(name).trim();
				break;
		}
		return capitalizeName(name);
	}
function ( name_type , gender , style ) { let name = '' ; if ( typeof name_type === 'undefined' || name_type === '' || name_type === 'random' ) { // randomize a type... name_type = randomizer . rollRandom ( Object . keys ( namedata . options ) ) ; } if ( typeof gender === 'undefined' || gender === 'random' ) { // randomize a gender... gender = randomizer . rollRandom ( [ 'male' , 'female' ] ) ; } if ( typeof style === 'undefined' || style !== 'first' ) { style = '' ; } switch ( name_type ) { case 'holmesian' : name = holmesname ( ) ; break ; case 'demonic' : name = demonname ( ) ; break ; case 'cornish' : case 'flemish' : case 'dutch' : case 'turkish' : default : name = randomizer . rollRandom ( namedata [ name_type ] [ gender ] ) ; if ( style !== 'first' && typeof namedata [ name_type ] [ 'surname' ] !== 'undefined' && ! r_helpers . isEmpty ( namedata [ name_type ] [ 'surname' ] ) ) { name += ' ' + randomizer . rollRandom ( namedata [ name_type ] [ 'surname' ] ) ; } name = randomizer . findToken ( name ) . trim ( ) ; break ; } return capitalizeName ( name ) ; }
Select a name from one of the lists
@param {String} name_type What name list/process to use else random
@param {String} gender male, female, random, ''
@param {String} style first=first name only, else full name
@returns {String} a name
Select a name from one of the lists