asNum function
Returns a num (int or double) for the value at key.
Throws a FormatException if the value cannot be converted.
Implementation
num asNum(dynamic json, String key) {
final value = _getJsonValueOrNull(json, key);
return toNum(value);
}