Use rfdc module for cloning when we know its pure JSON

This commit is contained in:
Nick O'Leary
2024-05-03 16:45:50 +01:00
parent a712a9363b
commit 1a3cc06935
6 changed files with 32 additions and 30 deletions

View File

@@ -14,9 +14,8 @@
* limitations under the License.
**/
var path = require("path");
var fs = require("fs");
var clone = require("clone");
const jsonClone = require("rfdc")();
var util = require("util");
var registry = require("@node-red/registry");
@@ -98,7 +97,7 @@ function createNode(node,def) {
}
var creds = credentials.get(id);
if (creds) {
creds = clone(creds);
creds = jsonClone(creds);
//console.log("Attaching credentials to ",node.id);
// allow $(foo) syntax to substitute env variables for credentials also...
for (var p in creds) {