From ea08dfac8d5c1e43b2c5ee9d55ae4ea1d28e0c62 Mon Sep 17 00:00:00 2001 From: acodercat Date: Thu, 5 May 2022 16:23:43 +0800 Subject: [PATCH] Remove JSON.stringify. --- src/mqtt.service.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mqtt.service.ts b/src/mqtt.service.ts index 4b590e2..21b56a7 100644 --- a/src/mqtt.service.ts +++ b/src/mqtt.service.ts @@ -34,9 +34,6 @@ export class MqttService { publish(topic: string, message: string | Buffer | object, opts?: IClientPublishOptions): Promise { return new Promise((resolve, reject) => { - if (typeof message === 'object') { - message = JSON.stringify(message); - } this.client.publish(topic, message, opts || null, (error, packet) => { if (error) { reject(error);