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) • 399 B
JavaScript
;
var getPolyfill = require('./polyfill');
var define = require('define-properties');
module.exports = function shimUint8ArrayPrototypeToHex() {
var polyfill = getPolyfill();
if (typeof Uint8Array === 'function') {
define(
Uint8Array.prototype,
{ toHex: polyfill },
{ toHex: function () { return Uint8Array.prototype.toHex !== polyfill; } }
);
}
return polyfill;
};