LCOV - code coverage report
Current view: top level - lib/matrix_api_lite/utils - filter_map_extension.dart (source / functions) Hit Total Coverage
Test: merged.info Lines: 6 6 100.0 %
Date: 2024-07-12 20:20:16 Functions: 0 0 -

          Line data    Source code
       1             : extension FilterMap<K, V> on Map<K, V> {
       2          33 :   Map<K2, V2> filterMap<K2, V2>(MapEntry<K2, V2>? Function(K, V) f) =>
       3          33 :       Map.fromEntries(
       4         231 :           entries.map((e) => f(e.key, e.value)).whereType<MapEntry<K2, V2>>());
       5             : 
       6          33 :   Map<K2, V2> catchMap<K2, V2>(MapEntry<K2, V2> Function(K, V) f) =>
       7          66 :       filterMap((k, v) {
       8             :         try {
       9          33 :           return f(k, v);
      10             :         } catch (_) {
      11             :           return null;
      12             :         }
      13             :       });
      14             : }

Generated by: LCOV version 1.14