mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Move copyInputItems to node helpers (no-changelog) (#7299)
This commit is contained in:
committed by
GitHub
parent
34bda535e6
commit
597669aa62
@@ -2709,6 +2709,24 @@ const getBinaryHelperFunctions = (
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns a copy of the items which only contains the json data and
|
||||
* of that only the defined properties
|
||||
*/
|
||||
export function copyInputItems(items: INodeExecutionData[], properties: string[]): IDataObject[] {
|
||||
return items.map((item) => {
|
||||
const newItem: IDataObject = {};
|
||||
for (const property of properties) {
|
||||
if (item.json[property] === undefined) {
|
||||
newItem[property] = null;
|
||||
} else {
|
||||
newItem[property] = deepCopy(item.json[property]);
|
||||
}
|
||||
}
|
||||
return newItem;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the execute functions the poll nodes have access to.
|
||||
*/
|
||||
@@ -3239,6 +3257,7 @@ export function getExecuteFunctions(
|
||||
},
|
||||
helpers: {
|
||||
createDeferredPromise,
|
||||
copyInputItems,
|
||||
...getRequestHelperFunctions(workflow, node, additionalData),
|
||||
...getFileSystemHelperFunctions(node),
|
||||
...getBinaryHelperFunctions(additionalData, workflow.id),
|
||||
|
||||
Reference in New Issue
Block a user