refactor: use Buffer.from and Buffer.alloc instead of new Buffer() (#957)
This commit is contained in:
committed by
László Monda
parent
999feea488
commit
82c9126d82
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user