It does add 2 lines to the overall structure, but I think we get readability and more flexibility around the error message in return. In my suggestion, the first block deals with empty fields (and allows setting a message per empty field), the second blocks deals with invalid hostnames (and allows setting a message for that) and the third block is the success block.

In the current version, conditions like `(!value || !checkValidHostname(value)) && field === 'host'` are shorter indeed but feel harder to read.