UNPKG

ix

Version:

The Interactive Extensions for JavaScript

11 lines (9 loc) 242 B
import { toInteger } from './tointeger.js'; const maxSafeInteger = Math.pow(2, 53) - 1; /** * @ignore */ export function toLength(value: any): number { const len = toInteger(value); return Math.min(Math.max(len, 0), maxSafeInteger); }