Skip to content

Commit 49bdd7f

Browse files
committed
feat(Comparator#reverse): now returns this
1 parent 533ecd1 commit 49bdd7f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/utils/comparator/comparator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type TCompareFn = (a, b) => number;
1+
export type TCompareFn = (a, b) => number;
22

33
export class Comparator<T> {
44
public static defaultCompareFn(a, b): number {
@@ -53,8 +53,10 @@ export class Comparator<T> {
5353
/**
5454
* Reverses the comparison order
5555
*/
56-
public reverse(): void {
56+
public reverse(): this {
5757
const compareFn = this.compareFn;
5858
this.compareFn = (a, b) => compareFn(b, a);
59+
60+
return this;
5961
}
6062
}

0 commit comments

Comments
 (0)