wip
This commit is contained in:
@@ -90,7 +90,7 @@ function calculateDiff(provVarsVariable, oldValue, newValue) {
|
|||||||
allKeys.forEach(key => {
|
allKeys.forEach(key => {
|
||||||
const oldKeyValue = oldVal[key];
|
const oldKeyValue = oldVal[key];
|
||||||
const newKeyValue = newVal[key];
|
const newKeyValue = newVal[key];
|
||||||
const currentPath = path ? `${path}['${key}']` : `['${key}']`;
|
const currentPath = path ? `${path}[${JSON.stringify(key)}]` : `[${JSON.stringify(key)}]`;
|
||||||
|
|
||||||
if (!oldVal || !(key in oldVal)) {
|
if (!oldVal || !(key in oldVal)) {
|
||||||
// New key added
|
// New key added
|
||||||
@@ -121,9 +121,9 @@ function calculateDiff(provVarsVariable, oldValue, newValue) {
|
|||||||
|
|
||||||
// Adjust initial call to handle non-object types
|
// Adjust initial call to handle non-object types
|
||||||
if ((typeof oldValue === 'object' && oldValue !== null) && (typeof newValue === 'object' && newValue !== null)) {
|
if ((typeof oldValue === 'object' && oldValue !== null) && (typeof newValue === 'object' && newValue !== null)) {
|
||||||
findChanges('progvars['+provVarsVariable+']', oldValue, newValue);
|
findChanges('progvars['+JSON.stringify(provVarsVariable)+']', oldValue, newValue);
|
||||||
} else if (oldValue !== newValue) {
|
} else if (oldValue !== newValue) {
|
||||||
changes.push(`progvars[${provVarsVariable}] = ${JSON.stringify(newValue)};`);
|
changes.push(`progvars[${JSON.stringify(provVarsVariable)}] = ${JSON.stringify(newValue)};`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return changes.join('\n');
|
return changes.join('\n');
|
||||||
|
|||||||
Reference in New Issue
Block a user