main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
726 bytes
|
Rev | Line | |
---|
[79a0317] | 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 |
|
---|
| 9 | // `Uint8Array.prototype.setFromHex` method
|
---|
| 10 | // https://github.com/tc39/proposal-arraybuffer-base64
|
---|
| 11 | if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true }, {
|
---|
| 12 | setFromHex: function setFromHex(string) {
|
---|
| 13 | anUint8Array(this);
|
---|
| 14 | aString(string);
|
---|
| 15 | notDetached(this.buffer);
|
---|
| 16 | var read = $fromHex(string, this).read;
|
---|
| 17 | return { read: read, written: read / 2 };
|
---|
| 18 | }
|
---|
| 19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.