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:
Csaba Tuncsik
2022-10-18 13:33:31 +02:00
committed by GitHub
parent 638d6f60d3
commit 1aa21ed3df
14 changed files with 101 additions and 27 deletions

View File

@@ -38,6 +38,7 @@ import {
} from '@/Interface';
import {
deepCopy,
INodeProperties,
INodePropertyOptions,
} from 'n8n-workflow';
@@ -161,7 +162,7 @@ export default mixins(
} else {
// Everything else saves them directly as an array.
newValue = get(this.nodeValues, `${this.path}.${optionName}`, []);
newValue.push(JSON.parse(JSON.stringify(option.default)));
newValue.push(deepCopy(option.default));
}
parameterData = {
@@ -172,7 +173,7 @@ export default mixins(
// Add a new option
parameterData = {
name,
value: JSON.parse(JSON.stringify(option.default)),
value: deepCopy(option.default),
};
}