to-offset.js 256 B

123456789
  1. var toPositiveInteger = require('../internals/to-positive-integer');
  2. var $RangeError = RangeError;
  3. module.exports = function (it, BYTES) {
  4. var offset = toPositiveInteger(it);
  5. if (offset % BYTES) throw $RangeError('Wrong offset');
  6. return offset;
  7. };