Merge pull request #2936 from adroitwhiz/remove-new-buffer

Replace `new Buffer()` with `Buffer.from()`
This commit is contained in:
Karishma Chadha 2021-10-27 13:59:05 -04:00 committed by GitHub
commit 2d6cce5f7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ const fs = require('fs');
module.exports = {
readFileToBuffer: function (path) {
return new Buffer(fs.readFileSync(path));
return Buffer.from(fs.readFileSync(path));
},
extractProjectJson: function (path) {
const zip = new AdmZip(path);

View file

@ -13,7 +13,7 @@ const VirtualMachine = require('../../src/index');
const projectUri = path.resolve(__dirname, '../fixtures/offline-custom-assets.sb2');
const projectZip = AdmZip(projectUri);
const project = new Buffer(fs.readFileSync(projectUri));
const project = Buffer.from(fs.readFileSync(projectUri));
// Custom costume from sb2 file (which was downloaded from offline editor)
// This sound should not be available on our servers
const costume = projectZip.readFile('1.svg');