commonMain.neat.Validators.kt Maven / Gradle / Ivy
package neat
import neat.internal.OptionalValidator
import neat.internal.ValidatingFunction
open class Validators(val label: String) {
internal val functions = mutableMapOf>()
fun configure(validator: ValidationFactory?): Validator {
if (validator == null) return optional()
return validator()
}
open fun optional(): Validator = OptionalValidator(this)
}