mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
Merge branch 'master' into static-stateless-webhooks
This commit is contained in:
@@ -1158,3 +1158,27 @@ export function mergeIssues(destination: INodeIssues, source: INodeIssues | null
|
||||
destination.typeUnknown = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Merges the given node properties
|
||||
*
|
||||
* @export
|
||||
* @param {INodeProperties[]} mainProperties
|
||||
* @param {INodeProperties[]} addProperties
|
||||
*/
|
||||
export function mergeNodeProperties(mainProperties: INodeProperties[], addProperties: INodeProperties[]): void {
|
||||
let existingIndex: number;
|
||||
for (const property of addProperties) {
|
||||
existingIndex = mainProperties.findIndex(element => element.name === property.name);
|
||||
|
||||
if (existingIndex === -1) {
|
||||
// Property does not exist yet, so add
|
||||
mainProperties.push(property);
|
||||
} else {
|
||||
// Property exists already, so overwrite
|
||||
mainProperties[existingIndex] = property;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user