From a29138758cbbb0c1c46f95f05500f5dd50a67e43 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Fri, 14 Mar 2025 23:38:53 +0200 Subject: [PATCH] socket, binary, usync: fix linting --- src/Socket/messages-send.ts | 2 +- src/Socket/socket.ts | 2 +- src/WABinary/generic-utils.ts | 2 +- src/WAUSync/Protocols/USyncDeviceProtocol.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Socket/messages-send.ts b/src/Socket/messages-send.ts index 673ea24d..952c5df5 100644 --- a/src/Socket/messages-send.ts +++ b/src/Socket/messages-send.ts @@ -522,7 +522,7 @@ export const makeMessagesSocket = (config: SocketConfig) => { const stanza: BinaryNode = { tag: 'message', attrs: { - id: msgId!, + id: msgId, type: getMessageType(message), ...(additionalAttributes || {}) }, diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index f6fdb957..63abd889 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -65,7 +65,7 @@ export const makeSocket = (config: SocketConfig) => { } = config if(printQRInTerminal) { - console.warn('⚠️ The printQRInTerminal option has been deprecated. You will no longer receive QR codes in the terminal automatically. Please listen to the connection.update event yourself and handle the QR your way. You can remove this message by removing this opttion. This message will be removed in a future version.') + console.warn('⚠️ The printQRInTerminal option has been deprecated. You will no longer receive QR codes in the terminal automatically. Please listen to the connection.update event yourself and handle the QR your way. You can remove this message by removing this opttion. This message will be removed in a future version.') } const url = typeof waWebSocketUrl === 'string' ? new URL(waWebSocketUrl) : waWebSocketUrl diff --git a/src/WABinary/generic-utils.ts b/src/WABinary/generic-utils.ts index 48b323c5..f519e682 100644 --- a/src/WABinary/generic-utils.ts +++ b/src/WABinary/generic-utils.ts @@ -6,7 +6,7 @@ import { BinaryNode } from './types' export const getBinaryNodeChildren = (node: BinaryNode | undefined, childTag: string) => { if(Array.isArray(node?.content)) { - return node!.content.filter(item => item.tag === childTag) + return node.content.filter(item => item.tag === childTag) } return [] diff --git a/src/WAUSync/Protocols/USyncDeviceProtocol.ts b/src/WAUSync/Protocols/USyncDeviceProtocol.ts index f03a0c0e..d5bef2fc 100644 --- a/src/WAUSync/Protocols/USyncDeviceProtocol.ts +++ b/src/WAUSync/Protocols/USyncDeviceProtocol.ts @@ -48,7 +48,7 @@ export class USyncDeviceProtocol implements USyncQueryProtocol { const keyIndexNode = getBinaryNodeChild(node, 'key-index-list') if(Array.isArray(deviceListNode?.content)) { - for(const { tag, attrs } of deviceListNode!.content) { + for(const { tag, attrs } of deviceListNode.content) { const id = +attrs.id const keyIndex = +attrs['key-index'] if(tag === 'device') {