@nethesis/phone-island
Version:
NethVoice CTI Phone Island
3 lines (2 loc) • 709 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js"),r=require("./contrib/base64-arraybuffer.js");const t="function"==typeof ArrayBuffer,s=(e,s)=>{if(t){const t=r.decode(e);return a(t,s)}return{base64:!0,data:e}},a=(e,r)=>"blob"===r?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;exports.decodePacket=(r,t)=>{if("string"!=typeof r)return{type:"message",data:a(r,t)};const n=r.charAt(0);if("b"===n)return{type:"message",data:s(r.substring(1),t)};return e.PACKET_TYPES_REVERSE[n]?r.length>1?{type:e.PACKET_TYPES_REVERSE[n],data:r.substring(1)}:{type:e.PACKET_TYPES_REVERSE[n]}:e.ERROR_PACKET};
//# sourceMappingURL=decodePacket.browser.js.map