debian-mirror-gitlab/core-js/internals/to-offset.js

8 lines
224 B
JavaScript
Raw Normal View History

2019-10-31 01:37:42 +05:30
var toPositiveInteger = require('../internals/to-positive-integer');
2019-09-25 13:30:05 +05:30
module.exports = function (it, BYTES) {
2019-10-31 01:37:42 +05:30
var offset = toPositiveInteger(it);
if (offset % BYTES) throw RangeError('Wrong offset');
2019-09-25 13:30:05 +05:30
return offset;
};