readMap function

Json? readMap(
  1. Object? v
)

v as a JSON object, or null. Keys are stringified.

Implementation

Json? readMap(Object? v) => switch (v) {
      final Map<String, Object?> m => m,
      final Map m => {for (final e in m.entries) '${e.key}': e.value},
      _ => null,
    };