mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-24 04:59:13 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
||||
IPairedItemData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
|
||||
export class Merge implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Merge',
|
||||
@@ -35,7 +34,8 @@ export class Merge implements INodeType {
|
||||
{
|
||||
name: 'Append',
|
||||
value: 'append',
|
||||
description: 'Combines data of both inputs. The output will contain items of input 1 and input 2.',
|
||||
description:
|
||||
'Combines data of both inputs. The output will contain items of input 1 and input 2.',
|
||||
},
|
||||
{
|
||||
name: 'Keep Key Matches',
|
||||
@@ -45,22 +45,26 @@ export class Merge implements INodeType {
|
||||
{
|
||||
name: 'Merge By Index',
|
||||
value: 'mergeByIndex',
|
||||
description: 'Merges data of both inputs. The output will contain items of input 1 merged with data of input 2. Merge happens depending on the index of the items. So first item of input 1 will be merged with first item of input 2 and so on.',
|
||||
description:
|
||||
'Merges data of both inputs. The output will contain items of input 1 merged with data of input 2. Merge happens depending on the index of the items. So first item of input 1 will be merged with first item of input 2 and so on.',
|
||||
},
|
||||
{
|
||||
name: 'Merge By Key',
|
||||
value: 'mergeByKey',
|
||||
description: 'Merges data of both inputs. The output will contain items of input 1 merged with data of input 2. Merge happens depending on a defined key.',
|
||||
description:
|
||||
'Merges data of both inputs. The output will contain items of input 1 merged with data of input 2. Merge happens depending on a defined key.',
|
||||
},
|
||||
{
|
||||
name: 'Multiplex',
|
||||
value: 'multiplex',
|
||||
description: 'Merges each value of one input with each value of the other input. The output will contain (m * n) items where (m) and (n) are lengths of the inputs.',
|
||||
description:
|
||||
'Merges each value of one input with each value of the other input. The output will contain (m * n) items where (m) and (n) are lengths of the inputs.',
|
||||
},
|
||||
{
|
||||
name: 'Pass-Through',
|
||||
value: 'passThrough',
|
||||
description: 'Passes through data of one input. The output will contain only items of the defined input.',
|
||||
description:
|
||||
'Passes through data of one input. The output will contain only items of the defined input.',
|
||||
},
|
||||
{
|
||||
name: 'Remove Key Matches',
|
||||
@@ -70,7 +74,8 @@ export class Merge implements INodeType {
|
||||
{
|
||||
name: 'Wait',
|
||||
value: 'wait',
|
||||
description: 'Waits till data of both inputs is available and will then output a single empty item. Source Nodes must connect to both Input 1 and 2. This node only supports 2 Sources, if you need more Sources, connect multiple Merge nodes in series. This node will not output any data.',
|
||||
description:
|
||||
'Waits till data of both inputs is available and will then output a single empty item. Source Nodes must connect to both Input 1 and 2. This node only supports 2 Sources, if you need more Sources, connect multiple Merge nodes in series. This node will not output any data.',
|
||||
},
|
||||
],
|
||||
default: 'append',
|
||||
@@ -82,30 +87,32 @@ export class Merge implements INodeType {
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
mode: [
|
||||
'mergeByIndex',
|
||||
],
|
||||
mode: ['mergeByIndex'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Inner Join',
|
||||
value: 'inner',
|
||||
description: 'Merges as many items as both inputs contain. (Example: Input1 = 5 items, Input2 = 3 items | Output will contain 3 items).',
|
||||
description:
|
||||
'Merges as many items as both inputs contain. (Example: Input1 = 5 items, Input2 = 3 items | Output will contain 3 items).',
|
||||
},
|
||||
{
|
||||
name: 'Left Join',
|
||||
value: 'left',
|
||||
description: 'Merges as many items as first input contains. (Example: Input1 = 3 items, Input2 = 5 items | Output will contain 3 items).',
|
||||
description:
|
||||
'Merges as many items as first input contains. (Example: Input1 = 3 items, Input2 = 5 items | Output will contain 3 items).',
|
||||
},
|
||||
{
|
||||
name: 'Outer Join',
|
||||
value: 'outer',
|
||||
description: 'Merges as many items as input contains with most items. (Example: Input1 = 3 items, Input2 = 5 items | Output will contain 5 items).',
|
||||
description:
|
||||
'Merges as many items as input contains with most items. (Example: Input1 = 3 items, Input2 = 5 items | Output will contain 5 items).',
|
||||
},
|
||||
],
|
||||
default: 'left',
|
||||
description: 'How many items the output will contain if inputs contain different amount of items',
|
||||
description:
|
||||
'How many items the output will contain if inputs contain different amount of items',
|
||||
},
|
||||
{
|
||||
displayName: 'Property Input 1',
|
||||
@@ -116,11 +123,7 @@ export class Merge implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
mode: [
|
||||
'keepKeyMatches',
|
||||
'mergeByKey',
|
||||
'removeKeyMatches',
|
||||
],
|
||||
mode: ['keepKeyMatches', 'mergeByKey', 'removeKeyMatches'],
|
||||
},
|
||||
},
|
||||
description: 'Name of property which decides which items to merge of input 1',
|
||||
@@ -134,11 +137,7 @@ export class Merge implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
mode: [
|
||||
'keepKeyMatches',
|
||||
'mergeByKey',
|
||||
'removeKeyMatches',
|
||||
],
|
||||
mode: ['keepKeyMatches', 'mergeByKey', 'removeKeyMatches'],
|
||||
},
|
||||
},
|
||||
description: 'Name of property which decides which items to merge of input 2',
|
||||
@@ -149,9 +148,7 @@ export class Merge implements INodeType {
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
mode: [
|
||||
'passThrough',
|
||||
],
|
||||
mode: ['passThrough'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -173,9 +170,7 @@ export class Merge implements INodeType {
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
mode: [
|
||||
'mergeByKey',
|
||||
],
|
||||
mode: ['mergeByKey'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -201,7 +196,6 @@ export class Merge implements INodeType {
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
|
||||
@@ -312,7 +306,8 @@ export class Merge implements INodeType {
|
||||
for (entry2 of dataInput2) {
|
||||
returnData.push({
|
||||
json: {
|
||||
...(entry1.json), ...(entry2.json),
|
||||
...entry1.json,
|
||||
...entry2.json,
|
||||
},
|
||||
pairedItem: [
|
||||
entry1.pairedItem as IPairedItemData,
|
||||
@@ -462,7 +457,7 @@ export class Merge implements INodeType {
|
||||
|
||||
if (output === 'input1') {
|
||||
returnData.push.apply(returnData, this.getInputData(0));
|
||||
} else {
|
||||
} else {
|
||||
returnData.push.apply(returnData, this.getInputData(1));
|
||||
}
|
||||
} else if (mode === 'wait') {
|
||||
|
||||
Reference in New Issue
Block a user