mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 03:50:13 +08:00
11 lines
323 B
JavaScript
11 lines
323 B
JavaScript
|
|
var global = require('../internals/global');
|
||
|
|
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
|
||
|
|
|
||
|
|
var RangeError = global.RangeError;
|
||
|
|
|
||
|
|
module.exports = function (it) {
|
||
|
|
var result = toIntegerOrInfinity(it);
|
||
|
|
if (result < 0) throw RangeError("The argument can't be less than 0");
|
||
|
|
return result;
|
||
|
|
};
|