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