Skip to content

Commit

Permalink
Merge pull request #620 from Fcmam5/fix/fix-Buffer-DeprecationWarning
Browse files Browse the repository at this point in the history
Use Buffer.alloc and Buffer.from instead of contrsuctor
  • Loading branch information
markstos committed Nov 20, 2020
2 parents 76ad4ee + 4b1d35a commit 2f192f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/config.js
Expand Up @@ -952,7 +952,7 @@ util.cloneDeep = function cloneDeep(parent, depth, circular, prototype) {
} else if (Utils.isDate(parent)) {
child = new Date(parent.getTime());
} else if (useBuffer && Buffer.isBuffer(parent)) {
child = new Buffer(parent.length);
child = Buffer.alloc(parent.length);
parent.copy(child);
return child;
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/config/default.js
Expand Up @@ -3,7 +3,7 @@ module.exports = {
TestModule: {
parm1:"value1",
arr1: ["arrValue1"],
buffer: new Buffer([1,2,3,4,5]),
buffer: Buffer.from([1,2,3,4,5]),
},
Customers: {
dbHost:'base',
Expand Down

0 comments on commit 2f192f7

Please sign in to comment.