wrap method

void wrap(
  1. IValidator fn(
    1. IValidator current
    )
)

Wraps all validators at the current position with a wrapper function.

Implementation

void wrap(IValidator Function(IValidator current) fn) {
  if (_hasCoercion) {
    if (_postValidators != null) _postValidators = fn(_postValidators!);
  } else if (_preValidators != null) {
    _preValidators = fn(_preValidators!);
  }
}