Converts to not-nullable map
static Map<T1, T2> toMap<T1, T2>(dynamic d, Map<T1, T2> def) { return toMapN(d) ?? def; }