refactor: use Buffer.from and Buffer.alloc instead of new Buffer() (#957)

This commit is contained in:
Róbert Kiss
2019-05-29 21:56:01 +02:00
committed by László Monda
parent 999feea488
commit 82c9126d82
24 changed files with 47 additions and 47 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ function uint32ToArray(value) {
}
function writeDevice(device, data, options={}) {
const dataBuffer = new Buffer(data);
const dataBuffer = Buffer.from(data);
if (!options.noDebug) {
writeLog('W: ', dataBuffer);
}
@@ -396,7 +396,7 @@ async function writeHca(device, isIso) {
}
async function eraseHca(device) {
const buffer = new Buffer(Array(64).fill(0xff));
const buffer = Buffer.from(Array(64).fill(0xff));
await uhk.writeConfig(device, buffer, true);
await uhk.launchEepromTransfer(device, uhk.eepromOperations.write, configBufferIds.hardwareConfig);
}