LCOV - code coverage report

Current view
top level - src/_impl/web - _patch.dart
Test
lcov.info
Date
2024-11-13
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines182281.8%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'dart:js_interop';
2import 'dart:js_interop_unsafe';
3
4import 'package:web/web.dart';
5
612String? getHome() {
70 if (window.isUndefinedOrNull) return null;
812 final components = window.location.pathname.split('/');
912 return components.take(components.length - 1).join('/');
1012}
11
122String? _getErrorEventMessage(JSObject? obj) {
132 if (obj != null && obj.has('message')) {
140 return obj['message'].dartify()?.toString();
15 } else {
162 return null;
17 }
182}
19
202Object? _getErrorEventError(JSObject? obj) {
212 if (obj != null && obj.has('error')) {
220 return obj['error'].dartify();
23 } else {
242 return null;
25 }
262}
27
281Object getError(JSObject? obj) =>
292 _getErrorEventError(obj) ?? _getErrorEventMessage(obj) ?? 'Unknown error';
30
3111List? getMessageEventData(JSObject? obj) {
3211 if (obj != null && obj.has('data')) {
3311 return obj['data'].dartify() as List?;
34 } else {
350 return null;
36 }
3711}
Choose Features