From 331d92d6358553b36f7f20b873f1ffcc42402bec Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 7 Nov 2024 15:35:40 -0800 Subject: [PATCH] Replace deprecated Buffer() constructor https://nodejs.org/api/deprecations.html#DEP0005 Signed-off-by: Anders Kaseorg --- src/generateFonts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generateFonts.js b/src/generateFonts.js index 085b3d8..d466937 100644 --- a/src/generateFonts.js +++ b/src/generateFonts.js @@ -85,7 +85,7 @@ var generators = { var formatOptions = options.formatOptions['ttf'] || {}; formatOptions.ts = 1484141760000; var font = svg2ttf(svgFont, formatOptions) - font = new Buffer(font.buffer) + font = Buffer.from(font.buffer) done(null, font) } }, @@ -94,7 +94,7 @@ var generators = { deps: ['ttf'], fn: function(options, ttfFont, done) { var font = ttf2woff(new Uint8Array(ttfFont), options.formatOptions['woff']) - font = new Buffer(font.buffer) + font = Buffer.from(font.buffer) done(null, font) } }, @@ -103,7 +103,7 @@ var generators = { deps: ['ttf'], fn: function(options, ttfFont, done) { var font = ttf2woff2(new Uint8Array(ttfFont), options.formatOptions['woff2']) - font = new Buffer(font.buffer) + font = Buffer.from(font.buffer) done(null, font) } }, @@ -112,7 +112,7 @@ var generators = { deps: ['ttf'], fn: function(options, ttfFont, done) { var font = ttf2eot(new Uint8Array(ttfFont), options.formatOptions['eot']) - font = new Buffer(font) + font = Buffer.from(font) done(null, font) } }