Skip to content

Commit 83c8f59

Browse files
committed
Lint: fix errors about redundant optional default values
1 parent e3c1d74 commit 83c8f59

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/crypto/argon2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface Argon2Options {
99
password: string,
1010
salt: Uint8Array<ArrayBuffer>,
1111
/** see https://www.rfc-editor.org/rfc/rfc9106.html#name-parameter-choice */
12-
params: Argon2Params
12+
params?: Argon2Params
1313
}
1414

1515
// We manually reload the module if no memory-heavy (128MB+) argon2 computation has been requested in a while,

lib/message/processMIME.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ const verifySignature = async (
4141
if (parts.length < 3) {
4242
return { subdata: data, verificationStatus: VERIFICATION_STATUS.NOT_SIGNED, signatures: [] };
4343
}
44-
const { attachments: [sigAttachment] = [] } = await parseMail(parts[2].trim());
45-
const { contentType: sigAttachmentContentType = '', content: sigAttachmentContent = new Uint8Array() } = sigAttachment ?? {};
44+
const { attachments: [sigAttachment] } = await parseMail(parts[2].trim());
45+
const { contentType: sigAttachmentContentType = '', content: sigAttachmentContent = new Uint8Array() } = (
46+
sigAttachment as Attachment | undefined /** explicit typing needed due to TS inference limitation with array destructuring */
47+
) ?? {};
4648
if (sigAttachmentContentType.toLowerCase() !== 'application/pgp-signature') {
4749
return { subdata: data, verificationStatus: VERIFICATION_STATUS.NOT_SIGNED, signatures: [] };
4850
}
@@ -93,7 +95,7 @@ const parse = async (
9395
signatures: OpenPGPSignature[] = []
9496
): Promise<ProcessMIMEResult> => {
9597
// cf. https://github.com/autocrypt/memoryhole subject can be in the MIME headers
96-
const { attachments: parsedAttachments = [], body: { text = '', html = '' }, subject: mimeSubject = '' } = await parseMail(mailContent);
98+
const { attachments: parsedAttachments, body: { text, html }, subject: mimeSubject = '' } = await parseMail(mailContent);
9799

98100
// normalise attachments and look for encrypted subject
99101
let encryptedSubjectHeader;

0 commit comments

Comments
 (0)