transformers/core library

Core transformer utilities and helpers.

This file contains the fundamental building blocks for creating transformers, including the basic transform function and the unified pivotValue helper.

Functions

expectPreserveValue(IValidator validator, Expectation expectation) IValidator
Adds an expectation message while preserving the child's resulting value (useful for coercions where later constraints rely on the coerced type even on failure).
handleReturnPreserveValue(IValidator validator, String? message) IValidator
pivotValue(dynamic transformFn(dynamic value), {required IValidator child, required String errorMessage}) IValidator
Unified helper for value pivoting operations.
transform<T>(T fn(dynamic), IValidator child) IValidator
Transforms a value using a provided function.