@@ -2,6 +2,7 @@ import { ArrayProcessor } from '../array-processor';
22import type { ArrayProcessorApi } from '../array-processor' ;
33import { SorterDirection } from './sorter-direction' ;
44import {
5+ compareNullOrUndefined ,
56 compareNumbers ,
67 isBoolean , isFunction , isVoid
78} from '@colonise/utilities' ;
@@ -156,7 +157,7 @@ export class SorterProcessor<TEntry> extends ArrayProcessor<TEntry> implements S
156157 protected propertySorterToFunctionSorter ( property : PropertySorter < TEntry > ) : FunctionSorter < TEntry > {
157158 return ( entryA : TEntry , entryB : TEntry ) => {
158159 if ( entryA === undefined || entryA === null || entryB === undefined || entryB === null ) {
159- return this . compareNullOrUndefined ( entryA , entryB ) ;
160+ return compareNullOrUndefined ( entryA , entryB ) ;
160161 }
161162
162163 return this . compare ( entryA [ property ] , entryB [ property ] ) ;
@@ -211,17 +212,4 @@ export class SorterProcessor<TEntry> extends ArrayProcessor<TEntry> implements S
211212
212213 return 0 ;
213214 }
214-
215- // eslint-disable-next-line @typescript-eslint/ban-types
216- private compareNullOrUndefined ( entryA : TEntry | null | undefined , entryB : TEntry | null | undefined ) : number {
217- if ( ( entryA === undefined || entryA === null ) && ( entryB !== undefined && entryB !== null ) ) {
218- return 1 ;
219- }
220-
221- if ( ( entryA !== undefined && entryA !== null ) && ( entryB === undefined || entryB === null ) ) {
222- return - 1 ;
223- }
224-
225- return 0 ;
226- }
227215}
0 commit comments