mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
Fix Node.js 10 deprecation warnings
This commit is contained in:
parent
476e8f2f0c
commit
f16eb6f3e6
12 changed files with 42 additions and 41 deletions
|
@ -78,7 +78,7 @@ module.exports = class ArchiveUtil {
|
|||
Object.keys(Config.fileTypes).forEach(mimeType => {
|
||||
const fileType = Config.fileTypes[mimeType];
|
||||
if(fileType.sig) {
|
||||
fileType.sig = new Buffer(fileType.sig, 'hex');
|
||||
fileType.sig = Buffer.alloc(fileType.sig, 'hex');
|
||||
fileType.offset = fileType.offset || 0;
|
||||
|
||||
// :TODO: this is broken: sig is NOT this long, it's sig.length long; offset needs to allow for -negative values as well
|
||||
|
@ -120,7 +120,7 @@ module.exports = class ArchiveUtil {
|
|||
return cb(err);
|
||||
}
|
||||
|
||||
const buf = new Buffer(this.longestSignature);
|
||||
const buf = Buffer.from(this.longestSignature);
|
||||
fs.read(fd, buf, 0, buf.length, 0, (err, bytesRead) => {
|
||||
if(err) {
|
||||
return cb(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue