typedash
Version:
modern, type-safe collection of utility functions
18 lines (15 loc) • 551 B
text/typescript
import { A as AnyFunction } from '../AnyFunction-DuIh5Fcc.cjs';
/**
* Returns a new function that negates the result of the input function.
* @param func The input function to negate.
* @returns A new function that negates the result of the input function.
* @example
* ```ts
* const isEven = (num: number) => num % 2 === 0;
* const isOdd = negate(isEven);
* isOdd(1); // true
* isOdd(2); // false
* ```
*/
declare function negate<Func extends AnyFunction<boolean>>(func: Func): (...args: Parameters<Func>) => boolean;
export { negate };