GoScrobble/web/node_modules/core-js-pure/internals/to-length.js

10 lines
297 B
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
var toInteger = require('../internals/to-integer');
var min = Math.min;
// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
module.exports = function (argument) {
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};