This commit is contained in:
2021-06-04 00:27:07 +00:00
parent ea0e1736ea
commit 76c20bd3ca
4 changed files with 68 additions and 38 deletions

View File

@@ -125,6 +125,26 @@ export default {
}
}
},
///////////////////////////////
// DEEP COPY FOR API UPDATE
// Deep copy an object skipping all *Viz and named properties from object
//
deepCopySkip: function(source, skipNames) {
if (skipNames == null) {
skipNames = [];
}
let o = {};
for (let key in source) {
if (
!key.endsWith("Viz") &&
!skipNames.some(x => x == key) &&
source.hasOwnProperty(key)
) {
o[key] = source[key];
}
}
return o;
},
/**
* Copy a string to clipboard
* @param {String} string The string to be copied to clipboard