Skip to content

Commit

Permalink
fix sort bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jsloat committed Oct 17, 2024
1 parent 5b048df commit a4eb902
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const getPrimitiveSorter =
}: SortByTypeOpts<T, Compare> = {}) =>
sortByComparison({
getValue: (entity: T) => mapValue(getValue(entity)),
shouldRaiseA: (a, b) => (a && b ? (isDesc ? a > b : b > a) : false),
shouldRaiseB: (a, b) => (a && b ? (isDesc ? a < b : b < a) : false),
shouldRaiseA: (a, b) => (a && b ? (isDesc ? a > b : b > a) : Boolean(a)),
shouldRaiseB: (a, b) => (a && b ? (isDesc ? a < b : b < a) : Boolean(b)),
});

export const sortByString = getPrimitiveSorter<string | null | undefined>(
Expand Down

0 comments on commit a4eb902

Please sign in to comment.