diff --git a/src/helpers.ts b/src/helpers.ts index 52d76d4..f5f364f 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -15,8 +15,8 @@ export const equal = (a: T, b: U): boolean => * Creates a function that negates the result of the predicate */ export const negate = ( - predicate: (value?: T, index?: number, list?: T[]) => boolean -): any => (...args) => !predicate(...args) + pred: (...args: readonly T[]) => boolean +): ((...args: readonly T[]) => boolean) => (...args) => !pred(...args) /** * Comparer helpers @@ -29,7 +29,7 @@ export const composeComparers = ( previousComparer(a, b) || currentComparer(a, b) export const keyComparer = ( - _keySelector: (key: T) => any, + _keySelector: (key: T) => string, descending?: boolean ): ((a: T, b: T) => number) => (a: T, b: T) => { const sortKeyA = _keySelector(a)