import { curry } from './curry'; import { compose } from './compose'; import { modulo } from './modulo'; export type Optional = T | undefined; export type Nullable = T | null; export type ValueOf = T[keyof T]; export const not = curry(input => !input); /** * * @param {Nullable | undefined} expression * @return {boolean} */ export const bool = (expression?: Nullable): boolean => !!expression; interface IsOdd { (number: number): boolean } export const isOdd: IsOdd = compose(bool, modulo(2)); export const alwaysTrue = (): true => true;