ix
Version:
The Interactive Extensions for JavaScript
15 lines (13 loc) • 381 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tointeger_1 = require("./tointeger");
const maxSafeInteger = Math.pow(2, 53) - 1;
/**
* @ignore
*/
function toLength(value) {
const len = tointeger_1.toInteger(value);
return Math.min(Math.max(len, 0), maxSafeInteger);
}
exports.toLength = toLength;
//# sourceMappingURL=tolength.js.map