UNPKG

hkt-toolbelt

Version:

Functional and composable type utilities

18 lines (17 loc) 466 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isOdd = void 0; /** * Given a natural number, return whether or not it is an odd number. * * @param {Number_.Number} x - The natural number to check. * * @example * ```ts * import { NaturalNumber } from "hkt-toolbelt"; * * const T0 = NaturalNumber.isOdd(42); // false * const T1 = NaturalNumber.isOdd(43); // true * ``` */ exports.isOdd = ((x) => Number(x) % 2 === 1);