hkt-toolbelt
Version:
Functional and composable type utilities
20 lines (19 loc) • 470 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.moduloBy = void 0;
/**
* Given two natural numbers, return the remainder of the second divided by the
* first.
*
* @param {number} a - The denominator.
* @param {number} b - The numerator.
*
* @example
* ```ts
* import { NaturalNumber } from "hkt-toolbelt";
*
* const result = NaturalNumber.moduloBy(3)(10)
* // ^? 1
* ```
*/
exports.moduloBy = ((a) => (b) => b % a);