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-11-12 07:37:08 Functions: 0 0 -

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

Generated by: LCOV version 1.14