UNPKG

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) 378 B
'use strict'; var getPolyfill = require('./polyfill'); var define = require('define-properties'); module.exports = function shimUint8ArrayFromHex() { var polyfill = getPolyfill(); if (typeof Uint8Array === 'function') { define( Uint8Array, { fromHex: polyfill }, { fromHex: function () { return Uint8Array.fromHex !== polyfill; } } ); } return polyfill; };