checked<T, U> function
T
checked<T, U>(
- dynamic v,
- T fn(
- 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());
}
}