checked<T, U> function

T checked<T, U>(
  1. dynamic v,
  2. T fn(
    1. U
    )
)

Implementation

T checked<T, U>(dynamic v, T Function(U) fn) {
  if (v is U) {
    return fn(v);
  } else {
    throw MapperException.unexpectedType(v.runtimeType, T, U.toString());
  }
}