From b72370c353deb3f68ac2a0daae76a9da7580d30b Mon Sep 17 00:00:00 2001 From: ankitchaudharyy Date: Mon, 10 Oct 2022 16:58:01 +0530 Subject: [PATCH] fix: changed substr to slice (#336) --- src/adapters/mqtt/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapters/mqtt/index.ts b/src/adapters/mqtt/index.ts index 3ba70ecca..95e428110 100644 --- a/src/adapters/mqtt/index.ts +++ b/src/adapters/mqtt/index.ts @@ -45,7 +45,7 @@ class MqttAdapter extends Adapter { this.client = mqtt.connect({ host: url.host, port: url.port || (url.protocol === 'mqtt:' ? 1883 : 8883), - protocol: url.protocol.substr(0, url.protocol.length - 1), + protocol: url.protocol.slice(0, url.protocol.length - 1), clientId: serverBinding && serverBinding.clientId, clean: serverBinding && serverBinding.cleanSession, will: serverBinding && serverBinding.will && {