UNPKG

diamante-js-xdr

Version:

Read/write XDR encoded data structures (RFC 4506)

13 lines (10 loc) 398 B
// See https://github.com/diamcircle/js-xdr/issues/117 import { Buffer } from 'buffer'; if (!(Buffer.alloc(1).subarray(0, 1) instanceof Buffer)) { Buffer.prototype.subarray = function subarray(start, end) { const result = Uint8Array.prototype.subarray.call(this, start, end); Object.setPrototypeOf(result, Buffer.prototype); return result; }; } export default Buffer;