( encodedPayload: string, binaryType?: BinaryType, )
| 31 | }; |
| 32 | |
| 33 | const decodePayload = ( |
| 34 | encodedPayload: string, |
| 35 | binaryType?: BinaryType, |
| 36 | ): Packet[] => { |
| 37 | const encodedPackets = encodedPayload.split(SEPARATOR); |
| 38 | const packets = []; |
| 39 | for (let i = 0; i < encodedPackets.length; i++) { |
| 40 | const decodedPacket = decodePacket(encodedPackets[i], binaryType); |
| 41 | packets.push(decodedPacket); |
| 42 | if (decodedPacket.type === class="st">"error") { |
| 43 | break; |
| 44 | } |
| 45 | } |
| 46 | return packets; |
| 47 | }; |
| 48 | |
| 49 | export function createPacketEncoderStream(): any { |
| 50 | return new TransformStream({ |
no test coverage detected