Skip to content

Commit

Permalink
fix(package): update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriVanHoudt committed Feb 18, 2021
1 parent 01ab182 commit 6d8100c
Show file tree
Hide file tree
Showing 5 changed files with 537 additions and 409 deletions.
12 changes: 6 additions & 6 deletions lib/unimail-gmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ class GmailConnector extends EventEmitter {
}

const fileListObject = {
// eslint-disable-next-line unicorn/no-reduce
// eslint-disable-next-line unicorn/no-array-reduce
files: messages.map((message) => message.files).reduce((allFiles, files) => allFiles.concat(files))
};

Expand Down Expand Up @@ -638,7 +638,7 @@ class GmailConnector extends EventEmitter {
size: Number(part.body.size),
service_message_id: message.formattedMessage.service_message_id,
service_thread_id: message.formattedMessage.service_thread_id,
email_message_id: (message.headers['message-id'] && message.headers['message-id'].length && message.headers['message-id'][0]) || null,
email_message_id: (message.headers['message-id'] && message.headers['message-id'].length > 0 && message.headers['message-id'][0]) || null,
date: message.date,
addresses: internals.getAddressesObject(message),
file_name: part.filename,
Expand Down Expand Up @@ -697,16 +697,16 @@ class GmailConnector extends EventEmitter {

const formattedMessage = {
service_type: this.name,
email_message_id: (mail.headers['message-id'] && mail.headers['message-id'].length && mail.headers['message-id'][0]) || null,
email_message_id: (mail.headers['message-id'] && mail.headers['message-id'].length > 0 && mail.headers['message-id'][0]) || null,
service_message_id: message.id,
service_thread_id: message.threadId,
date: mail.date || (mail.headers['delivery-date'] && mail.headers['delivery-date'].length && new Date(mail.headers['delivery-date'][0])),
subject: (mail.headers.subject && mail.headers.subject.length && mail.headers.subject[0]) || null,
date: mail.date || (mail.headers['delivery-date'] && mail.headers['delivery-date'].length > 0 && new Date(mail.headers['delivery-date'][0])),
subject: (mail.headers.subject && mail.headers.subject.length > 0 && mail.headers.subject[0]) || null,
folders: message.labelIds,
files: [],
body: [],
addresses: internals.getAddressesObject(mail),
in_reply_to: (mail.headers['in-reply-to'] && mail.headers['in-reply-to'].length && mail.headers['in-reply-to'][0]) || null,
in_reply_to: (mail.headers['in-reply-to'] && mail.headers['in-reply-to'].length > 0 && mail.headers['in-reply-to'][0]) || null,
headers: mail.headers
};

Expand Down
5 changes: 3 additions & 2 deletions lib/unimail-nylas.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ class NylasConnector extends EventEmitter {
return callback(null, { messages: results.flatMap((result) => result.messages) });
}

// eslint-disable-next-line unicorn/no-reduce
// eslint-disable-next-line unicorn/no-array-reduce
const responseObject = results.reduce((accumulator, currentValue) => {

return {
messages: accumulator.messages.concat(currentValue.messages.filter((message) => {

return !accumulator.messages.find((m) => {
return !accumulator.messages.some((m) => {

return m.service_message_id === message.service_message_id;
});
Expand Down Expand Up @@ -267,6 +267,7 @@ class NylasConnector extends EventEmitter {

return nylas.messages.list(nylasParams).then((response) => {

// eslint-disable-next-line unicorn/explicit-length-check
const limit = clonedParams.limit || response.length;

const responseObject = {
Expand Down
4 changes: 2 additions & 2 deletions lib/unimail-office365.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class Office365Connector extends EventEmitter {
message.hasAttachments = true;
message.attachments = attachments;

if (attachments.find((attachment) => attachment['@odata.type'] === '#Microsoft.OutlookServices.ReferenceAttachment')) {
if (attachments.some((attachment) => attachment['@odata.type'] === '#Microsoft.OutlookServices.ReferenceAttachment')) {
version = 'beta';
}
}
Expand Down Expand Up @@ -843,7 +843,7 @@ class Office365Connector extends EventEmitter {
return callback(new Error('No corresponding folders found for your query'));
}

if (folderIds.length !== 0) {
if (folderIds.length > 0) {
requestFolders = folderIds;
}

Expand Down
Loading

0 comments on commit 6d8100c

Please sign in to comment.