Support custom validation and formatting functions #8
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Property values can be validated when they are set with a custom getter/setter function, but that’s cumbersome. It would be far better to pass a
validation
object with a validation method for each property that should be validated. This object should be included in the config object, like so:These validation functions should, if present, be invoked before setting a value for the property after which they are named.
Similarly, a
formatting
object could also be supported for developers to declare methods that accept the value and return a new, formatted value. Useful for ensuring dates are formatted, for example.The text was updated successfully, but these errors were encountered: