amis-rpc-design/node_modules/core-js/internals/to-positive-integer.js

11 lines
287 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var $RangeError = RangeError;
module.exports = function (it) {
var result = toIntegerOrInfinity(it);
if (result < 0) throw $RangeError("The argument can't be less than 0");
return result;
};