trust_but_verify 0.6.1
trust_but_verify: ^0.6.1 copied to clipboard
A fluent validation library for Dart with support for transformation (such as casting) and both sync/async validators.
0.6.1 #
- FIX: Fixed issue with custom messages not being available to batch validation methods
0.6.0 #
- BREAKING: Renamed package from
fpvalidatetotrust_but_verify - BREAKING: Renamed
field()totrust()- starts a validation chain - BREAKING: Renamed
validate()toverify()- executes validation and returns result - BREAKING: Renamed
validateEither()toverifyEither()- executes validation returning Either - BREAKING: Renamed
validateTaskEither()toverifyTaskEither()- returns TaskEither - BREAKING: Renamed
validateAsync()toverifyAsync()- async batch validation - BREAKING: Now using email_validator for email validation
- NEW: Field names are now optional - use
trust()without arguments for generic messages - NEW: Custom error messages via lambda in
verify()- e.g.,verify((fieldName) => 'Custom $fieldName error') - NEW: All error classes now have
copyWith({String? message})for error message customization - NEW: Improved default messages with cleaner format (e.g., "Email cannot be empty" instead of "Field Email is empty")
- IMPROVED: Docstrings are now more specific about returned error types
- IMPROVED: Readme now includes a TOC and is more concise and generalized for non-fpdart users
0.5.0 #
- BREAKING: Updated SDK constraint to ^3.10.0
- NEW: Added
CastingExtensionwithisType<T>()for type-safe validation chains - NEW: Added
typeMismatcherror message to internationalization system - NEW: Added
TypeMismatchValidationErrorfor cleaner type error handling - FIX: Added missing field extension for Either type from fpdart
0.4.0 #
- BREAKING: Renamed
checktoensurefor clarity - BREAKING: Renamed
thentobindfor consistency with fpdart - NEW: Added
isNotEmpty()extension method for nullable strings as shortcut forisNotNull().isNotEmpty()
0.3.0 #
- NEW: Added comprehensive internationalization support for validation messages
- Type-safe
ValidationMessagesinterface for custom message implementations ValidationMessagesMixinfor partial message overrides while keeping default English fallbacksEnglishValidationMessagesas the default English implementation- Global configuration via
ValidationStep.configureMessages()andValidationStep.resetMessages() - Support for all validation scenarios with proper parameter substitution
- No breaking changes to existing API - all existing code continues to work unchanged
- Added comprehensive example demonstrating partial overrides and complete custom implementations
- Type-safe
0.2.0 #
- BREAKING: Refactored error system with hierarchical error types for better error handling and debugging
- Introduced specific error classes for different validation scenarios
StringValidationErrorfor string-specific validation failuresNumericValidationErrorfor numeric validation failuresNullableValidationErrorfor nullable field validation failures- Core validation errors:
FieldInitializationError,AsyncFieldInitializationError,TryMapValidationError,CheckValidationError,BindValidationError
- Improved type safety in error handling throughout the validation pipeline
- Better stack trace support for debugging validation failures
0.1.1 #
- Added field extensions for Either and TaskEither types from fpdart
- You can now start validation chains directly from Right, Left, and TaskEither values
- Permit
FutureOrin asyncensureandtryMapmethods - Added
isOneOf()method for string and numeric validation - Added
isNoneOf()method for string and numeric validation - Renamed
notEmpty()toisNotEmpty()for consistency
0.1.0 #
- Initial version with comprehensive validation library
- Support for functional programming with fpdart Either and TaskEither
- Fluent API for chaining validation rules
- Built-in validators for strings, numbers, and nullable types
- String validators: email, URL, phone, UUID, credit card, postal code, ISO date, 24-hour time
- Numeric validators: min/max, range, even/odd, positive/negative, power of 2, perfect square, port number
- Batch validation for multiple fields
- Async validation support
- Custom validation with ensure() and tryMap()
- Error handling with descriptive messages
- Nullable field support