Predicate
not
import { not } from 'funkcia';
const isGreaterThanZero = (value: number): boolean => value > 0;
const isLessOrEqualToZero = not(isGreaterThanZero);
const result = isLessOrEqualToZero(-1);
//^? truePredicate<A>
import { Predicate } from 'funkcia/predicate';
const isPositive: Predicate.Predicate<number> = (n) => n > 0;Guard<A, B extends A>
import { Predicate } from 'funkcia/predicate';
const isString: Predicate.Guard<unknown, string> = (value) =>
typeof value === 'string';Guarded<Guard>
Unguarded<A, B extends A>
Last updated
Was this helpful?