src/random_name.js
function (name) {
		const leave_lower = ['of', 'the', 'from', 'de', 'le', 'la'];
		// need to find spaces in name and capitalize letter after space
		const parts = name.split(' ');
		const upper_parts = parts.map((w) => {
			return (leave_lower.indexOf(w) >= 0) ? w : `${r_helpers.capitalize(w)}`;
		});
		return upper_parts.join(' ');
	}
function (name) {
		const leave_lower = ['of', 'the', 'from', 'de', 'le', 'la'];
		// need to find spaces in name and capitalize letter after space
		const parts = name.split(' ');
		const upper_parts = parts.map((w) => {
			return (leave_lower.indexOf(w) >= 0) ? w : `${r_helpers.capitalize(w)}`;
		});
		return upper_parts.join(' ');
	}
function ( name ) { const leave_lower = [ 'of' , 'the' , 'from' , 'de' , 'le' , 'la' ] ; // need to find spaces in name and capitalize letter after space const parts = name . split ( ' ' ) ; const upper_parts = parts . map ( ( w ) => { return ( leave_lower . indexOf ( w ) >= 0 ) ? w : ` ${ r_helpers . capitalize ( w ) } ` ; } ) ; return upper_parts . join ( ' ' ) ; }
Capitalize names, account for multiword lastnames like "Van Hausen"
@param {String} name a name
@return {String} name capitalized
Capitalize names account for multiword lastnames like Van Hausen