Skip to content

Commit 87c7c26

Browse files
author
Flavio Corpa
committed
refactor(helpers): remove anys in helpers (improves types)
1 parent c3de3d5 commit 87c7c26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export const equal = <T, U>(a: T, b: U): boolean =>
1515
* Creates a function that negates the result of the predicate
1616
*/
1717
export const negate = <T>(
18-
predicate: (value?: T, index?: number, list?: T[]) => boolean
19-
): any => (...args) => !predicate(...args)
18+
pred: (...args: readonly T[]) => boolean
19+
): ((...args: readonly T[]) => boolean) => (...args) => !pred(...args)
2020

2121
/**
2222
* Comparer helpers
@@ -29,7 +29,7 @@ export const composeComparers = <T>(
2929
previousComparer(a, b) || currentComparer(a, b)
3030

3131
export const keyComparer = <T>(
32-
_keySelector: (key: T) => any,
32+
_keySelector: (key: T) => string,
3333
descending?: boolean
3434
): ((a: T, b: T) => number) => (a: T, b: T) => {
3535
const sortKeyA = _keySelector(a)

0 commit comments

Comments
 (0)