diff --git a/src/sort.ts b/src/sort.ts index 59f47de..da820bf 100644 --- a/src/sort.ts +++ b/src/sort.ts @@ -102,8 +102,8 @@ const getPrimitiveSorter = }: SortByTypeOpts = {}) => 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(