feat: Migrate packages from lodash to lodash-es (no-changelog) (#5538)

This commit is contained in:
Alex Grozav
2023-02-23 17:16:05 +02:00
committed by GitHub
parent e2d7c1804f
commit f0695827f5
91 changed files with 737 additions and 182 deletions

View File

@@ -22,7 +22,8 @@ import { connect as imapConnect, getParts } from 'imap-simple';
import type { Source as ParserSource } from 'mailparser';
import { simpleParser } from 'mailparser';
import _ from 'lodash';
import isEmpty from 'lodash.isempty';
import find from 'lodash.find';
export async function parseRawEmail(
this: ITriggerFunctions,
@@ -241,7 +242,7 @@ export class EmailReadImapV1 implements INodeType {
if (credentials.secure) {
tlsOptions.servername = credentials.host as string;
}
if (!_.isEmpty(tlsOptions)) {
if (!isEmpty(tlsOptions)) {
config.imap.tlsOptions = tlsOptions;
}
const conn = imapConnect(config).then(async (entry) => {
@@ -385,7 +386,7 @@ export class EmailReadImapV1 implements INodeType {
) {
staticData.lastMessageUid = message.attributes.uid;
}
const part = _.find(message.parts, { which: '' });
const part = find(message.parts, { which: '' });
if (part === undefined) {
throw new NodeOperationError(this.getNode(), 'Email part could not be parsed.');
@@ -474,7 +475,7 @@ export class EmailReadImapV1 implements INodeType {
) {
staticData.lastMessageUid = message.attributes.uid;
}
const part = _.find(message.parts, { which: 'TEXT' });
const part = find(message.parts, { which: 'TEXT' });
if (part === undefined) {
throw new NodeOperationError(this.getNode(), 'Email part could not be parsed.');
@@ -569,7 +570,7 @@ export class EmailReadImapV1 implements INodeType {
tlsOptions.servername = credentials.host as string;
}
if (!_.isEmpty(tlsOptions)) {
if (!isEmpty(tlsOptions)) {
config.imap.tlsOptions = tlsOptions;
}