UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

10 lines (7 loc) 219 B
import { toFinite } from './toFinite.mjs'; function toInteger(value) { const finite = toFinite(value); const remainder = finite % 1; return remainder ? finite - remainder : finite; } export { toInteger };