Created
March 4, 2020 14:34
-
-
Save azamsharp/3fdf5b80545247a844ff28824f10ec75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import ValidatedPropertyKit | |
extension Validation where Value == String { | |
static var required: Validation { | |
return .init { value in | |
value.isEmpty ? .failure("\(value) cannot be empty") : .success(()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment