The goal is to define a value (a variable or return value) in which a value is always established and it's established through several checks (exclusive or not).
In this case the goal is to the definitively define a config given a URL.
The "switch" and a default condition which I think express better that a value must be defined. With "ifs" we can add more complex logic and avoid the problematic "breaks" but we loose that in your face "default" condition.
In theory it would be better to have a different control structure like "pickJustOne":
return pickJustOne(url) {
githubUrl: config.github;
twitterUrl: config.twitter;
default: config.unknown;
}
"pickJustOne" would have a companion named "pickOneByOrder" that would work like an "if" where the order of evaluation would matter.