MCPcopy Index your code
hub / github.com/bugy/script-server / sortExecutionLogs

Function sortExecutionLogs

web-src/src/common/store/executions-module.js:81–99  ·  view source on GitHub ↗
(logs)

Source from the content-addressed store, hash-verified

79export default store
80
81function sortExecutionLogs(logs) {
82 logs.sort(function (v1, v2) {
83 if (isNull(v1.startTime)) {
84 if (isNull(v2.startTime)) {
85 return v1.user.localeCompare(v2.user);
86 }
87 return 1;
88 } else if (isNull(v2.startTime)) {
89 return -1;
90 }
91
92 let dateCompare = Date.parse(v2.startTime) - Date.parse(v1.startTime);
93 if (dateCompare !== 0) {
94 return dateCompare;
95 }
96
97 return v1.user.localeCompare(v2.user);
98 });
99}
100
101export function translateExecutionLog(log) {
102 log.startTimeString = getStartTimeString(log);

Callers 1

initFunction · 0.85

Calls 1

isNullFunction · 0.90

Tested by

no test coverage detected