`if (!host)` here should be just fine, it shouldn't ever be a boolean and then there's no need for typeof