feat: add "strictNullChecks"

This commit is contained in:
Adhiraj Singh
2022-07-08 10:38:25 +05:30
parent 7426b7aa2f
commit 40a1e268aa
42 changed files with 350 additions and 339 deletions

View File

@@ -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')