Export helper methods, add safe return to
This commit is contained in:
1 parent
2873f68868
commit
4ca3e3211f
1 file changed
+12
-1
@@ -94,7 +94,8 @@ const getLatestResponseTime = (checks) => {
|
|||||||
if (!checks || checks.length === 0) {
|
if (!checks || checks.length === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return checks[0].responseTime;
|
|
||||||
|
return checks[0]?.responseTime ?? 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -586,3 +587,13 @@ export {
|
|||||||
editMonitor,
|
editMonitor,
|
||||||
addDemoMonitors,
|
addDemoMonitors,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Helper functions
|
||||||
|
export {
|
||||||
|
calculateUptimeDuration,
|
||||||
|
getLastChecked,
|
||||||
|
getLatestResponseTime,
|
||||||
|
getAverageResponseTime,
|
||||||
|
getUptimePercentage,
|
||||||
|
getIncidents,
|
||||||
|
};
|
||||||
Reference in new issue
Block a user