ifNum function

dynamic ifNum(
  1. Function fun
)

Implementation

dynamic ifNum(Function fun) {
  return (dynamic val) {
    if (val is! num) return val;
    return fun(val);
  };
}