Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

esnext.data-view.set-uint8-clamped.js 755B

12345678910111213141516171819
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var uncurryThis = require('../internals/function-uncurry-this');
  4. var aDataView = require('../internals/a-data-view');
  5. var toIndex = require('../internals/to-index');
  6. var toUint8Clamped = require('../internals/to-uint8-clamped');
  7. // eslint-disable-next-line es/no-typed-arrays -- safe
  8. var setUint8 = uncurryThis(DataView.prototype.setUint8);
  9. // `DataView.prototype.setUint8Clamped` method
  10. // https://github.com/tc39/proposal-dataview-get-set-uint8clamped
  11. $({ target: 'DataView', proto: true, forced: true }, {
  12. setUint8Clamped: function setUint8Clamped(byteOffset, value) {
  13. aDataView(this);
  14. var offset = toIndex(byteOffset);
  15. return setUint8(this, offset, toUint8Clamped(value));
  16. }
  17. });