mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): fixes n8n-local-rules/no-json-parse-json-stringify warnings (#4407)
* 🔨 fixes * 🔨 set rule to error
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import {
|
||||
deepCopy,
|
||||
IBinaryKeyData,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
@@ -67,7 +68,7 @@ return items;`,
|
||||
let items = this.getInputData();
|
||||
|
||||
// Copy the items as they may get changed in the functions
|
||||
items = JSON.parse(JSON.stringify(items));
|
||||
items = deepCopy(items);
|
||||
|
||||
// Assign item indexes
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
@@ -82,7 +83,7 @@ return items;`,
|
||||
inputData[key] = cleanupData(inputData[key] as IDataObject);
|
||||
} else {
|
||||
// Is some special object like a Date so stringify
|
||||
inputData[key] = JSON.parse(JSON.stringify(inputData[key]));
|
||||
inputData[key] = deepCopy(inputData[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user