Skip to content

Support a way to transform (map) a value before validating it #26

@nesk

Description

@nesk

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DSLAPI design and its DSLcoreThe core of the library is involvedenhancementNew feature or request

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions