formix_core 0.1.0
formix_core: ^0.1.0 copied to clipboard
Generic, type-safe validation engine for Dart. Build composable, reusable validators with a fluent API. The core package of the Formix ecosystem.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2026-01-23 #
Added #
- Initial release of
formix_core Formix<T, E>- Base abstraction for all validatorsValidationResult<T, E>- Sealed class withValid,Invalid, andInvalidAllvariantsRule<T, E>- Single validation rule abstractionPredicateRule<T, E>- Create rules from simple predicatesFunctionRule<T, E>- Create rules from validation functions- Composition utilities:
AllOf- Validate all rules (AND logic)AnyOf- Validate any rule (OR logic)Chain- Sequential validation with short-circuitConditional- Conditional validationOptional- Skip validation for null valuesTransform- Transform input before validation
- Caching utilities:
CachedFormix- Cache validation resultsLazyFormix- Lazy validator initializationLruCachedFormix- LRU cache for validation results
- Extension methods for fluent API:
.andThen()- Chain validators.when()- Conditional validation.optional()- Make validators optional.cached()- Add caching.lruCached()- Add LRU caching
ErrorMessageFormatter- Format error messages with context