UNPKG

hkt-toolbelt

Version:

Functional and composable type utilities

19 lines (18 loc) 458 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.modulo = void 0; /** * Given two natural numbers, return the remainder of the division. * * @param {number} a - The numerator. * @param {number} b - The denominator. * * @example * ```ts * import { NaturalNumber } from "hkt-toolbelt"; * * const result = NaturalNumber.modulo(10)(3) * // ^? 1 * ``` */ exports.modulo = ((a) => (b) => Number(a) % Number(b));