Seems like an unnecessary mess when you could just use ternary expressions:
return twitterUrl ? config.twitter
: githubUrl ? config.github
: default