diff --git a/Validate/Source/Validate.swift b/Validate/Source/Validate.swift index a0fa328..77711a2 100644 --- a/Validate/Source/Validate.swift +++ b/Validate/Source/Validate.swift @@ -74,6 +74,28 @@ public struct Validate: DynamicProperty { self.init(wrappedValue: wrappedValue, validations: validations) } + /// Initialize a `Validate` instance. + /// - Parameters: + /// - value: The value to validate. + /// - validations: The validations. + public init( + _ value: Value, + validations: Validation... + ) { + self.init(wrappedValue: value, validations: validations) + } + + /// Initialize a `Validate` instance where Value is optional. + /// - Parameters: + /// - value: The value to validate. + /// - validations: The validations. + public init( + _ value: Value, + validations: Validation... + ) where Value == Optional { + self.init(wrappedValue: value, validations: validations) + } + init( wrappedValue: Value, validations: [Validation]