Apply new ESLint rules to legacy code

This commit is contained in:
Chris Svenningsen 2020-09-08 17:46:29 -07:00 committed by Scott Nonnenberg
parent 91cf075697
commit 8a2c17f65f
70 changed files with 376 additions and 516 deletions

View file

@ -363,21 +363,24 @@ describe('Backup', () => {
return attachment;
}
return Object.assign({}, attachment, {
return {
...attachment,
thumbnail: await mapper(attachment.thumbnail, context),
});
};
};
const quotedAttachments =
(message.quote && message.quote.attachments) || [];
return Object.assign({}, message, {
quote: Object.assign({}, message.quote, {
return {
...message,
quote: {
...message.quote,
attachments: await Promise.all(
quotedAttachments.map(wrappedMapper)
),
}),
});
},
};
};
}
@ -391,17 +394,20 @@ describe('Backup', () => {
return wrappedLoadAttachment(thumbnail);
});
return Object.assign({}, await loadThumbnails(message), {
return {
...(await loadThumbnails(message)),
contact: await Promise.all(
(message.contact || []).map(async contact => {
return contact && contact.avatar && contact.avatar.avatar
? Object.assign({}, contact, {
avatar: Object.assign({}, contact.avatar, {
? {
...contact,
avatar: {
...contact.avatar,
avatar: await wrappedLoadAttachment(
contact.avatar.avatar
),
}),
})
},
}
: contact;
})
),
@ -429,7 +435,7 @@ describe('Backup', () => {
return item;
})
),
});
};
}
let backupDir;