es-arraybuffer-base64
Version:
An ES-spec-compliant shim/polyfill/replacement for ArrayBuffer base64 methods that works as far down as ES3
19 lines (14 loc) • 410 B
JavaScript
;
var getPolyfill = require('./polyfill');
var define = require('define-properties');
module.exports = function shimUint8ArraySetFromHex() {
var polyfill = getPolyfill();
if (typeof Uint8Array === 'function') {
define(
Uint8Array.prototype,
{ setFromHex: polyfill },
{ setFromHex: function () { return Uint8Array.prototype.setFromHex !== polyfill; } }
);
}
return polyfill;
};