[web] Remove ternary conditional operator

This commit is contained in:
Alain Nussbaumer 2024-03-12 14:04:05 +01:00
parent 2273b917c7
commit b59a1b9407

View File

@ -125,9 +125,9 @@ export class GroupedList {
) )
this.count = itemsFiltered.length this.count = itemsFiltered.length
// Sort item list // Sort item list
const itemsSorted = options.compareFn const itemsSorted = [...itemsFiltered].sort(
? [...itemsFiltered].sort(options.compareFn) options.compareFn ?? (() => true)
: itemsFiltered )
// Group item list // Group item list
this.itemsGrouped = itemsSorted.reduce((map, item) => { this.itemsGrouped = itemsSorted.reduce((map, item) => {
const groupKey = options.groupKeyFn(item) const groupKey = options.groupKeyFn(item)