does-not-exceed-safe-integer.js 235 B

1234567
  1. var $TypeError = TypeError;
  2. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  3. module.exports = function (it) {
  4. if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
  5. return it;
  6. };