mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
perf: update deepCopy (#4364)
* perf: update deepCopy * fix: using deepCopy in core and cli packages * fix: using deepCopy in editor * chore: formatting * fix: some micro optimisation in deepCopy
This commit is contained in:
@@ -122,6 +122,7 @@ import {
|
||||
INodeProperties,
|
||||
NodeHelpers,
|
||||
NodeParameterValue,
|
||||
deepCopy,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeUi, INodeUpdatePropertiesInformation, IUpdateInformation } from '@/Interface';
|
||||
|
||||
@@ -427,7 +428,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers).extend({
|
||||
// Value should be set
|
||||
if (typeof value === 'object') {
|
||||
// @ts-ignore
|
||||
Vue.set(get(this.nodeValues, nameParts.join('.')), lastNamePart, JSON.parse(JSON.stringify(value)));
|
||||
Vue.set(get(this.nodeValues, nameParts.join('.')), lastNamePart, deepCopy(value));
|
||||
} else {
|
||||
// @ts-ignore
|
||||
Vue.set(get(this.nodeValues, nameParts.join('.')), lastNamePart, value);
|
||||
@@ -500,7 +501,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers).extend({
|
||||
|
||||
// Copy the data because it is the data of vuex so make sure that
|
||||
// we do not edit it directly
|
||||
nodeParameters = JSON.parse(JSON.stringify(nodeParameters));
|
||||
nodeParameters = deepCopy(nodeParameters);
|
||||
|
||||
for (const parameterName of Object.keys(parameterData.value)) {
|
||||
//@ts-ignore
|
||||
@@ -591,7 +592,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers).extend({
|
||||
|
||||
// Copy the data because it is the data of vuex so make sure that
|
||||
// we do not edit it directly
|
||||
nodeParameters = JSON.parse(JSON.stringify(nodeParameters));
|
||||
nodeParameters = deepCopy(nodeParameters);
|
||||
|
||||
// Remove the 'parameters.' from the beginning to just have the
|
||||
// actual parameter name
|
||||
@@ -734,7 +735,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers).extend({
|
||||
}
|
||||
}
|
||||
|
||||
Vue.set(this.nodeValues, 'parameters', JSON.parse(JSON.stringify(this.node.parameters)));
|
||||
Vue.set(this.nodeValues, 'parameters', deepCopy(this.node.parameters));
|
||||
} else {
|
||||
this.nodeValid = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user