diff --git a/lib/compile.js b/lib/compile.js index a2bcb4f..a6b7827 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -23,7 +23,7 @@ module.exports = function (options) { var compiler = new Compiler(options); var contents = compiler.convertPo([file.contents.toString()]); - file.contents = new Buffer(contents); + file.contents = Buffer.from(contents); var dirname = path.dirname(file.path); var basename = path.basename(file.path, '.po'); diff --git a/lib/extract.js b/lib/extract.js index 6d651d2..7e5458f 100644 --- a/lib/extract.js +++ b/lib/extract.js @@ -37,7 +37,7 @@ module.exports = function (out, config) { } extractor.parse(file.relative, file.contents.toString()); - file.contents = new Buffer(extractor.toString()); + file.contents = Buffer.from(extractor.toString()); var extension = path.extname(file.path); var extIndex = file.path.lastIndexOf(extension); @@ -79,7 +79,7 @@ module.exports = function (out, config) { cwd: firstFile.cwd, base: firstFile.base, path: path.join(firstFile.base, out), - contents: new Buffer(extractor.toString()) + contents: Buffer.from(extractor.toString()) })); cb(); diff --git a/test/main.js b/test/main.js index 44c034c..3c1f648 100644 --- a/test/main.js +++ b/test/main.js @@ -16,7 +16,7 @@ var createFixtureFile = function (filename, content) { cwd: __dirname, base: fixturesDir, path: path.join(fixturesDir, filename), - contents: new Buffer(content) + contents: Buffer.from(content) }); }; @@ -166,13 +166,13 @@ describe('gulp-angular-gettext', function () { cwd: __dirname, base: anotherDir, path: path.join(fixturesDir, 'partial1.html'), - contents: new Buffer('
Hello
') + contents: Buffer.from('
Hello
') }); var partial2 = new Vinyl({ cwd: __dirname, base: anotherDir, path: path.join(fixturesDir, 'partial2.html'), - contents: new Buffer('
world
') + contents: Buffer.from('
world
') }); var stream = extract('out.pot');