UNPKG

hkt-toolbelt

Version:

Functional and composable type utilities

19 lines (18 loc) 451 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toHex = void 0; /** * Given a natural number, return the corresponding hex string, using lowercase * letters. * * @param {Number_.Number} x - The natural number to convert. * * @example * ```ts * import { NaturalNumber } from "hkt-toolbelt"; * * const result = NaturalNumber.toHex(999) * // ^? '3e7' * ``` */ exports.toHex = ((x) => x.toString(16));