Model: Endpoint.hasHostAsIPAddress()

This commit is contained in:
Roopesh Chander 2018-11-06 23:36:48 +05:30
parent b57824cde1
commit 1410b89f23

View File

@ -75,3 +75,16 @@ extension Endpoint: Codable {
case invalidData
}
}
extension Endpoint {
func hasHostAsIPAddress() -> Bool {
switch (host) {
case .name(_, _):
return false
case .ipv4(_):
return true
case .ipv6(_):
return true
}
}
}