Closed nesk closed 1 month ago
It could be useful to transform a value before validating it, for example:
Validator<String> { this.map { it.trim('.') }.isNotBlank() }
By "transforming" the value, the path remains the same, until overridden by withPath.
withPath
Essentially, it would work like Optional.map() in Java, or Either.map() with Arrow, but instead of returning an Optional or an Either, it returns a Validatable.
Optional.map()
Either.map()
Optional
Either
Validatable
It could be useful to transform a value before validating it, for example:
By "transforming" the value, the path remains the same, until overridden by
withPath
.Essentially, it would work like
Optional.map()
in Java, orEither.map()
with Arrow, but instead of returning anOptional
or anEither
, it returns aValidatable
.