MyFormworks / Formworks

Formworks is a framework for building forms from JSON files.
https://myformworks.github.io/Formworks/
MIT License
6 stars 1 forks source link

Refactoring/validators #77

Closed EdgSgroi closed 3 years ago

EdgSgroi commented 3 years ago

Motivation

The way that components are validated isn't flexible enough to get custom validation ways.

Modifications

The FWValidador class now is a protocol that every validator should implement. Also FWRegexValidator is created to validate every regex, including the presetted regexes that is in the FWRegex enum.

Result

The code is more scalable now and every component that use a preset validation or need to use a custom regex do it passing a FWRegex enum to the FWRegexValidator.

Fix #76

Checklist

This PR is