Skip to content

Commit 3d52ef1

Browse files
committed
add online to semisorting field
1 parent f39286e commit 3d52ef1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/comparator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { TOnlineTimerMetrics } from './wrappers.ts';
22
import { ESortOrder } from './settings.ts';
33

4+
const SEMISORTING_FIELDS = ['calls', 'delay', 'online'];
5+
46
// descending sort by `handler` field
57
function compareIfEqual<T>(field: keyof T, first: T, second: T) {
6-
if (field === 'calls' || field === 'delay') {
8+
if (SEMISORTING_FIELDS.includes(field as string)) {
79
// @ts-ignore
810
return second['handler'] > first['handler'] ? 1 : -1;
911
} else {

0 commit comments

Comments
 (0)