From 9b905c2833d54cf34d1875148075b2bf756d943a Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 18 Jan 2020 16:01:02 +0200 Subject: Try to fix Node 12 Buffer() deprecation errors. Thanks to xet7 ! --- models/export.js | 2 +- models/wekanCreator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/export.js b/models/export.js index 69aaf619..cd72a6a4 100644 --- a/models/export.js +++ b/models/export.js @@ -138,7 +138,7 @@ export class Exporter { // [Old] for attachments we only export IDs and absolute url to original doc // [New] Encode attachment to base64 const getBase64Data = function(doc, callback) { - let buffer = new Buffer.alloc(0); + let buffer = Buffer.from(0); // callback has the form function (err, res) {} const tmpFile = path.join( os.tmpdir(), diff --git a/models/wekanCreator.js b/models/wekanCreator.js index 26d34170..9914f817 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -441,7 +441,7 @@ export class WekanCreator { }); } else if (att.file) { file.attachData( - new Buffer.alloc(att.file, 'base64'), + Buffer.from(att.file, 'base64'), { type: att.type, }, -- cgit v1.2.3-1-g7c22