mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add "strictNullChecks"
This commit is contained in:
@@ -104,7 +104,7 @@ export const makeSocket = ({
|
||||
})
|
||||
|
||||
if(sendMsg) {
|
||||
sendRawMessage(sendMsg).catch(onClose)
|
||||
sendRawMessage(sendMsg).catch(onClose!)
|
||||
}
|
||||
|
||||
return result
|
||||
@@ -134,9 +134,9 @@ export const makeSocket = ({
|
||||
)
|
||||
return result as any
|
||||
} finally {
|
||||
ws.off(`TAG:${msgId}`, onRecv)
|
||||
ws.off('close', onErr) // if the socket closes, you'll never receive the message
|
||||
ws.off('error', onErr)
|
||||
ws.off(`TAG:${msgId}`, onRecv!)
|
||||
ws.off('close', onErr!) // if the socket closes, you'll never receive the message
|
||||
ws.off('error', onErr!)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ export const makeSocket = ({
|
||||
]
|
||||
})
|
||||
const countChild = getBinaryNodeChild(result, 'count')
|
||||
return +countChild.attrs.value
|
||||
return +countChild!.attrs.value
|
||||
}
|
||||
|
||||
/** generates and uploads a set of pre-keys to the server */
|
||||
@@ -525,7 +525,7 @@ export const makeSocket = ({
|
||||
logger.info({ name }, 'updated pushName')
|
||||
sendNode({
|
||||
tag: 'presence',
|
||||
attrs: { name }
|
||||
attrs: { name: name! }
|
||||
})
|
||||
.catch(err => {
|
||||
logger.warn({ trace: err.stack }, 'error in sending presence update on name change')
|
||||
|
||||
Reference in New Issue
Block a user