remove use of deprecated 'new Buffer' instanciation

This commit is contained in:
ansuz
2020-01-06 14:29:45 -05:00
parent 32bdfacd92
commit 4aaef2d811
4 changed files with 4 additions and 4 deletions

2
rpc.js
View File

@@ -1062,7 +1062,7 @@ var writeLoginBlock = function (Env, msg, cb) { // FIXME BLOCKS
// flow is dumb and I need to guard against this which will never happen
/*:: if (typeof(validatedBlock) === 'undefined') { throw new Error('should never happen'); } */
/*:: if (typeof(path) === 'undefined') { throw new Error('should never happen'); } */
Fs.writeFile(path, new Buffer(validatedBlock), { encoding: "binary", }, function (err) {
Fs.writeFile(path, Buffer.from(validatedBlock), { encoding: "binary", }, function (err) {
if (err) { return void cb(err); }
cb();
});