@zelgadis87/utils-core 4.13.2 → 4.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/sorting/Sorter.ts
CHANGED
|
@@ -365,7 +365,7 @@ type TSorterStepFull<T, Ret> = TSorterStepForRecords<T, Ret>
|
|
|
365
365
|
& TSorterStepForChainables<T, Ret>
|
|
366
366
|
& TSorterStepForUsing<T, Ret>
|
|
367
367
|
;
|
|
368
|
-
type TSorterStarter<T> = TSorterStepUsing<T, TSorter<T>>;
|
|
368
|
+
type TSorterStarter<T> = TSorterStepUsing<T, TSorter<T>> & TSorterStepForUsing<T, TSorter<T>>;
|
|
369
369
|
export type TSorterBuilder<T> = ( builder: TSorterStarter<T> ) => TSorter<T>;
|
|
370
370
|
|
|
371
371
|
type TStringComparisonOptions = TCompareFunctionOptions & { ignoreCase: boolean };
|
|
@@ -390,7 +390,7 @@ type TPrioritizeOptions = {};
|
|
|
390
390
|
const defaultPrioritizeOptions = {} as const satisfies Partial<TPrioritizeOptions>;
|
|
391
391
|
|
|
392
392
|
export const Sorter = {
|
|
393
|
-
createFor: <T>() => doCreateEmpty<T>(),
|
|
393
|
+
createFor: <T>( _template?: T ) => doCreateEmpty<T>(),
|
|
394
394
|
sort: <T>( arr: TReadableArray<T>, builder: TSorterBuilder<T> ) => builder( doCreateEmpty() ).sort( arr ),
|
|
395
395
|
top: <T>( arr: TReadableArray<T>, n: TPositiveNumber, builder: TSorterBuilder<T> ) => builder( doCreateEmpty() ).top( arr, n ),
|
|
396
396
|
bottom: <T>( arr: TReadableArray<T>, n: TPositiveNumber, builder: TSorterBuilder<T> ) => builder( doCreateEmpty() ).bottom( arr, n ),
|