fix(types): resolve all TypeScript compilation errors from non-null assertion removal
Fixes: - chats.ts: revert encodeResult/initial to ! (guaranteed by callback assignment) - groups.ts: fix operator precedence with ?? (wrap +attrs in parens), fix groupId type - messages-recv.ts: extract messageKey.id to local const with fallback - socket.ts: revert onClose! (guaranteed by synchronous callback assignment) - event-buffer.ts: add 'notify' fallback for MessageUpsertType - messages.ts: add filePath const after null guard, fix contextInfo type assertion - noise-handler.ts: restore array index ! (guaranteed by length check) Build now compiles with zero new errors. https://claude.ai/code/session_01E2cfX1N3sJgCJBTvzGazSG
This commit is contained in:
@@ -316,7 +316,7 @@ export const extractGroupMetadata = (result: BinaryNode) => {
|
||||
descId = descChild.attrs.id
|
||||
}
|
||||
|
||||
const groupId = (group.attrs.id ?? '').includes('@') ? group.attrs.id : jidEncode(group.attrs.id ?? '', 'g.us')
|
||||
const groupId = (group.attrs.id ?? '').includes('@') ? (group.attrs.id ?? '') : jidEncode(group.attrs.id ?? '', 'g.us')
|
||||
const eph = getBinaryNodeChild(group, 'ephemeral')?.attrs.expiration
|
||||
const memberAddMode = getBinaryNodeChildString(group, 'member_add_mode') === 'all_member_add'
|
||||
const metadata: GroupMetadata = {
|
||||
@@ -326,9 +326,9 @@ export const extractGroupMetadata = (result: BinaryNode) => {
|
||||
subject: group.attrs.subject ?? '',
|
||||
subjectOwner: group.attrs.s_o,
|
||||
subjectOwnerPn: group.attrs.s_o_pn,
|
||||
subjectTime: +group.attrs.s_t ?? '0',
|
||||
subjectTime: +(group.attrs.s_t ?? '0'),
|
||||
size: group.attrs.size ? +group.attrs.size : getBinaryNodeChildren(group, 'participant').length,
|
||||
creation: +group.attrs.creation ?? '0',
|
||||
creation: +(group.attrs.creation ?? '0'),
|
||||
owner: group.attrs.creator ? jidNormalizedUser(group.attrs.creator) : undefined,
|
||||
ownerPn: group.attrs.creator_pn ? jidNormalizedUser(group.attrs.creator_pn) : undefined,
|
||||
owner_country_code: group.attrs.creator_country_code,
|
||||
|
||||
Reference in New Issue
Block a user