From a10fcadc8b746bdc960d9c3e461f415ec116635c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E9=95=BF?= Date: Wed, 21 Feb 2024 07:07:51 +0000 Subject: [PATCH] fix: refactor deprecated Buffer usage Co-authored-by: legobt <6wbvkn0j@anonaddy.me> --- index.js | 2 +- test/inline-source-map.js | 2 +- test/source-content.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index df74d61..833a484 100644 --- a/index.js +++ b/index.js @@ -91,7 +91,7 @@ Generator.prototype.addSourceContent = function (sourceFile, sourcesContent) { */ Generator.prototype.base64Encode = function () { var map = this.toString(); - return new Buffer(map).toString('base64'); + return Buffer.from(map).toString('base64'); }; /** diff --git a/test/inline-source-map.js b/test/inline-source-map.js index a6b9f5e..5fe60a4 100644 --- a/test/inline-source-map.js +++ b/test/inline-source-map.js @@ -15,7 +15,7 @@ var bar = '' + function bar () { } function decode(base64) { - return new Buffer(base64, 'base64').toString(); + return Buffer.from(base64, 'base64').toString(); } function inspect(obj, depth) { diff --git a/test/source-content.js b/test/source-content.js index d18997d..cc0b749 100644 --- a/test/source-content.js +++ b/test/source-content.js @@ -15,7 +15,7 @@ var bar = '' + function bar () { } function decode(base64) { - return new Buffer(base64, 'base64').toString(); + return Buffer.from(base64, 'base64').toString(); } function inspect(obj, depth) {