mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Refactor some imports to reduce baseline memory usage (#15916)
This commit is contained in:
committed by
GitHub
parent
8abd556597
commit
7c806ff532
@@ -1,5 +1,5 @@
|
||||
import { mockDeep } from 'jest-mock-extended';
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import type { IExecuteFunctions } from 'n8n-workflow';
|
||||
|
||||
import * as getSchema from '../../../../v2/actions/base/getSchema.operation';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type {
|
||||
IDataObject,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import difference from 'lodash/difference';
|
||||
import get from 'lodash/get';
|
||||
import intersection from 'lodash/intersection';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import {
|
||||
type ITriggerFunctions,
|
||||
type IDataObject,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import FormData from 'form-data';
|
||||
import { isEmpty } from 'lodash';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { extension } from 'mime-types';
|
||||
import type {
|
||||
IBinaryKeyData,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getParts, type ImapSimple, type Message, type MessagePart } from '@n8n/imap';
|
||||
import { find } from 'lodash';
|
||||
import find from 'lodash/find';
|
||||
import { simpleParser, type Source as ParserSource } from 'mailparser';
|
||||
import {
|
||||
type IBinaryData,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ from 'lodash';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import {
|
||||
type INodeExecutionData,
|
||||
NodeConnectionTypes,
|
||||
@@ -217,7 +217,7 @@ export class ExecuteWorkflowTrigger implements INodeType {
|
||||
...Object.fromEntries(newParams.fields.map((x) => [x.name, FALLBACK_DEFAULT_VALUE])),
|
||||
// Need to trim to the expected schema to support legacy Execute Workflow callers passing through all their data
|
||||
// which we do not want to expose past this node.
|
||||
..._.pickBy(json, (_value, key) => newKeys.has(key)),
|
||||
...pickBy(json, (_value, key) => newKeys.has(key)),
|
||||
},
|
||||
index,
|
||||
binary,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { omit } from 'lodash';
|
||||
import omit from 'lodash/omit';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
@@ -2,7 +2,9 @@ import { Readability } from '@mozilla/readability';
|
||||
import * as cheerio from 'cheerio';
|
||||
import { convert } from 'html-to-text';
|
||||
import { JSDOM } from 'jsdom';
|
||||
import { get, set, unset } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import set from 'lodash/set';
|
||||
import unset from 'lodash/unset';
|
||||
import {
|
||||
type INodeProperties,
|
||||
jsonParse,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import {
|
||||
NodeOperationError,
|
||||
type IExecuteFunctions,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { merge } from 'lodash';
|
||||
import merge from 'lodash/merge';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteSingleFunctions,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { merge } from 'lodash';
|
||||
import merge from 'lodash/merge';
|
||||
import type { DateTime } from 'luxon';
|
||||
import {
|
||||
NodeOperationError,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import {
|
||||
NodeOperationError,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import {
|
||||
type IDataObject,
|
||||
type IExecuteFunctions,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
|
||||
export const telegramNode: INode = {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { isEqual, lt, pick } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import lt from 'lodash/lt';
|
||||
import pick from 'lodash/pick';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INode, INodeExecutionData } from 'n8n-workflow';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { isEqual, isNull, merge, isObject, reduce, get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNull from 'lodash/isNull';
|
||||
import isObject from 'lodash/isObject';
|
||||
import merge from 'lodash/merge';
|
||||
import reduce from 'lodash/reduce';
|
||||
import type {
|
||||
IDataObject,
|
||||
IDisplayOptions,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { json as generateSchemaFromExample, type SchemaObject } from 'generate-schema';
|
||||
import type { JSONSchema7 } from 'json-schema';
|
||||
import _ from 'lodash';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import type {
|
||||
FieldValueOption,
|
||||
FieldType,
|
||||
@@ -157,7 +157,7 @@ export function getCurrentWorkflowInputData(this: IExecuteFunctions | ISupplyDat
|
||||
const filteredInputData: INodeExecutionData[] = inputData.map(({ json, binary }, index) => ({
|
||||
index,
|
||||
pairedItem: { item: index },
|
||||
json: _.pickBy(json, (_v, key) => !removedKeys.has(key)),
|
||||
json: pickBy(json, (_v, key) => !removedKeys.has(key)),
|
||||
binary,
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user