switch (true) {
case !isDefined(user):
throw new Error("User must be defined.");
case !isString(user.firstName):
throw new Error("User's first name must be a string");
case !isValidEmail(user.email):
throw new Error("User's email address must be a valid email address");
case !isValidPhoneNumber(user.number):
throw new Error("User's phone number must be a valid phone number");
// ...더 많은 유효성 검사들
default:
return user;
}