Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 30, 2024

This PR contains the following updates:

Package Update Change
vapor/vapor minor from: "4.110.2" -> from: "4.111.0"

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

vapor/vapor (vapor/vapor)

v4.111.0: - Validation API | Custom Validator

Compare Source

What's Changed

Validation API | Custom Validator by @​WilliamFernsV3 in #​3263

Resolves this issue I created the other day: vapor/vapor#3261

Problem:

The Validation API allows you to create custom validators. It works, and it is good enough. In some cases however, extending the Validation API is not needed, as the validation is only for one Content object, meaning it will only be used once. I also find it more complex to extend the Validation API.

Solution:

In some if not most cases where a user wants to add some custom validation, they can now use the Custom validator. It is simpler, and the implementation is shorter.

extension Validator where T == String {
    public static var usPhoneNumber: Validator<T> {
        .init { input -> ValidatorResult in
            let stripped = input
                .replacingOccurrences(of: "(", with: "")
                .replacingOccurrences(of: ")", with: "")
                .replacingOccurrences(of: "-", with: "")
                .replacingOccurrences(of: " ", with: "")

Reviewers

Thanks to the reviewers for their help:

This patch was released by @​0xTim

Full Changelog: vapor/vapor@4.110.2...4.111.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot merged commit bc894d6 into main Dec 30, 2024
3 checks passed
@renovate renovate bot deleted the renovate/vapor-vapor-4.x branch December 30, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants