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.uint8-array.set-from-hex.js 726B

12345678910111213141516171819
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var globalThis = require('../internals/global-this');
  4. var aString = require('../internals/a-string');
  5. var anUint8Array = require('../internals/an-uint8-array');
  6. var notDetached = require('../internals/array-buffer-not-detached');
  7. var $fromHex = require('../internals/uint8-from-hex');
  8. // `Uint8Array.prototype.setFromHex` method
  9. // https://github.com/tc39/proposal-arraybuffer-base64
  10. if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true }, {
  11. setFromHex: function setFromHex(string) {
  12. anUint8Array(this);
  13. aString(string);
  14. notDetached(this.buffer);
  15. var read = $fromHex(string, this).read;
  16. return { read: read, written: read / 2 };
  17. }
  18. });