Skip to content

refactor(pattern): use specialized crates for validators #117

@martsokha

Description

@martsokha

Summary

Replace hand-rolled validators with established crates that handle edge cases better:

  • date: use jiff (already a workspace dep) for date parsing and validation instead of manual MM/DD/YYYY parsing
  • phone: use phonenumber crate for ITU-T E.164 validation with country code awareness
  • IBAN: use iban_validate crate for full ISO 13616 validation including country-specific length rules
  • credit card: luhn crate or keep current (it's simple enough)

Motivation

The current validators handle common cases but miss edge cases that specialized crates handle (e.g. country-specific IBAN lengths, international phone number formatting rules, date format ambiguity between locales).

Scope

  • Replace validator implementations in crates/nvisy-pattern/src/validators/
  • Keep the ValidatorResolver interface unchanged
  • Update tests to cover the new edge cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    choremaintenance, dependency updates, code cleanuppatternnvisy-pattern: regex and dictionary detection

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions