Skip to content

Commit

Permalink
Use anonymous function instead named sortFn
Browse files Browse the repository at this point in the history
  • Loading branch information
reiterl committed Nov 1, 2023
1 parent 7b3600b commit 2c648f1
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ export abstract class BaseFilterListService<V extends BaseViewModel> implements
.pipe(
map(viewModels => {
if (viewModels && viewModels.length) {
const sortFn = (a, b) => {
return a.label.trim().localeCompare(b.label.trim());
};
const filterProperties: (OsFilterOption | string)[] = viewModels
.filter(filterFn ?? (() => true))
.map((model: any) => ({
Expand All @@ -297,7 +294,7 @@ export abstract class BaseFilterListService<V extends BaseViewModel> implements
}))
: undefined
}))
.sort(sortFn);
.sort((a, b) => a.label.trim().localeCompare(b.label.trim()));

if (noneOptionLabel) {
filterProperties.push(`-`);
Expand Down

0 comments on commit 2c648f1

Please sign in to comment.