Skip to content

Commit

Permalink
Use Buffer.from
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Jan 5, 2019
1 parent 08398bd commit 1837dc2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -2,7 +2,7 @@ module.exports = function () {
return {
dir: __dirname,
file: __filename,
buf: new Buffer(process.title).toString('base64'),
buf: Buffer.from(process.title).toString('base64'),
global: !!global.document
};
};
2 changes: 1 addition & 1 deletion packages/core/integration-tests/test/javascript.js
Expand Up @@ -802,7 +802,7 @@ describe('javascript', function() {
assert.deepEqual(output(), {
dir: path.join(__dirname, '/integration/globals'),
file: path.join(__dirname, '/integration/globals/index.js'),
buf: new Buffer('browser').toString('base64'),
buf: Buffer.from('browser').toString('base64'),
global: true
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/parcel-bundler/src/assets/JSAsset.js
Expand Up @@ -95,7 +95,7 @@ class JSAsset extends Asset {
let json, filename;
if (dataURLMatch) {
filename = this.name;
json = new Buffer(dataURLMatch[1], 'base64').toString();
json = Buffer.from(dataURLMatch[1], 'base64').toString();
} else {
filename = path.join(path.dirname(this.name), url);
json = await fs.readFile(filename, 'utf8');
Expand Down

0 comments on commit 1837dc2

Please sign in to comment.