()
| 230 | this.subscriptionsCount.get(responseChannel) || 0; |
| 231 | |
| 232 | const publishPacket = () => { |
| 233 | subscriptionsCount = this.subscriptionsCount.get(responseChannel) || 0; |
| 234 | this.subscriptionsCount.set(responseChannel, subscriptionsCount + 1); |
| 235 | this.routingMap.set(packet.id, callback); |
| 236 | |
| 237 | const options = |
| 238 | isObject(packet?.data) && packet.data instanceof MqttRecord |
| 239 | ? packet.data.options |
| 240 | : undefined; |
| 241 | delete packet?.data?.options; |
| 242 | const serializedPacket: string | Buffer = |
| 243 | this.serializer.serialize(packet); |
| 244 | |
| 245 | this.mqttClient!.publish( |
| 246 | this.getRequestPattern(pattern), |
| 247 | serializedPacket, |
| 248 | this.mergePacketOptions(options), |
| 249 | ); |
| 250 | }; |
| 251 | |
| 252 | if (subscriptionsCount <= 0) { |
| 253 | this.mqttClient!.subscribe( |
nothing calls this directly
no test coverage detected