UNPKG

teletype-client-modified

Version:

I have modified the library developed by Atom to make it compatible with non-browser facility. I am using it only for experimentation purposes. I will remove this package post my experiment and raise a PR at Atom to finally merge this package so that this

12 lines (10 loc) 299 B
module.exports = function convertToProtobufCompatibleBuffer (data) { if (data == null) return data if (!(data instanceof Buffer)) { data = Buffer.from(data) } // Hack to convince protocol buffers that this Buffer really *is* a Uint8Array data.constructor = Uint8Array return data }