lib/credit.js
function getCredit(credits, author) {
	const credit = credits.filter(credit => {
		// Fallback to name when no email
		// is available
		if (credit.email && author.email) {
			return credit.email === author.email;
		}

		return credit.name === author.name;
	});

	return credit.length > 0 ?
		credit[0] :
		false;
}
function getCredit(credits, author) {
	const credit = credits.filter(credit => {
		// Fallback to name when no email
		// is available
		if (credit.email && author.email) {
			return credit.email === author.email;
		}

		return credit.name === author.name;
	});

	return credit.length > 0 ?
		credit[0] :
		false;
}
function getCredit ( credits , author ) { const credit = credits . filter ( credit => { // Fallback to name when no email // is available if ( credit . email && author . email ) { return credit . email === author . email ; } return credit . name === author . name ; } ) ; return credit . length > 0 ? credit [ 0 ] : false ; }
Get credit out of running credits list

@param  {Array} credits list of credits
@param  {Object} author author

@return {Object|false}  existing credit or false

@tested
Get credit out of running credits list