LCOV - code coverage report
Current view: top level - lib/matrix_api_lite/utils - filter_map_extension.dart (source / functions) Coverage Total Hit
Test: merged.info Lines: 100.0 % 6 6
Test Date: 2025-01-14 13:39:53 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 2.0-1