From 0d2d3f4deabe2a3cc1ab84a1826d835cbb07b4b5 Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Thu, 16 Nov 2023 10:13:22 -0300 Subject: [PATCH] =?UTF-8?q?Move=20simpleAttributes=20const=20inside=20only?= =?UTF-8?q?=20place=20it=E2=80=99s=20used?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And define it more simply. --- src/common/lib/types/protocolmessage.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/lib/types/protocolmessage.ts b/src/common/lib/types/protocolmessage.ts index b721fe9e10..a8b2f360ea 100644 --- a/src/common/lib/types/protocolmessage.ts +++ b/src/common/lib/types/protocolmessage.ts @@ -58,8 +58,6 @@ function toStringArray(array?: any[]): string { return '[ ' + result.join(', ') + ' ]'; } -const simpleAttributes = 'id channel channelSerial connectionId count msgSerial timestamp'.split(' '); - class ProtocolMessage { action?: number; flags?: number; @@ -133,6 +131,7 @@ class ProtocolMessage { let result = '[ProtocolMessage'; if (msg.action !== undefined) result += '; action=' + ProtocolMessage.ActionName[msg.action] || msg.action; + const simpleAttributes = ['id', 'channel', 'channelSerial', 'connectionId', 'count', 'msgSerial', 'timestamp']; let attribute; for (let attribIndex = 0; attribIndex < simpleAttributes.length; attribIndex++) { attribute = simpleAttributes[attribIndex];