Skip to content

Commit

Permalink
new Buffer being deprecated and replaced by Buffer.form
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchereau committed May 10, 2018
1 parent 50430ce commit eb43007
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion webapp/lib/db_child.js
Expand Up @@ -136,7 +136,7 @@ function formatIndexEntry(response, callback) {
}
}

var buf = new Buffer(response.content, 'base64');
var buf = Buffer.from(response.content, 'base64');
var content = buf.toString();
var path = response.path;
// var name = response.name;
Expand Down
4 changes: 2 additions & 2 deletions webapp/lib/github.js
Expand Up @@ -58,7 +58,7 @@ module.exports = {
var uri = github + '/repos/' + repo + '/contents/' + path;
var data = {
branch: branch,
content: new Buffer(content).toString('base64'),
content: Buffer.from(content).toString('base64'),
message: 'System creation'
};
// Note content creation requires PUT instead of POST
Expand All @@ -83,7 +83,7 @@ module.exports = {
var uri = github + '/repos/' + repo + '/contents/' + path;
var data = {
branch: branch,
content: new Buffer(content).toString('base64'),
content: Buffer.from(content).toString('base64'),
message: 'System update',
sha: sha
};
Expand Down
2 changes: 1 addition & 1 deletion webapp/models/menuModel.js
Expand Up @@ -27,7 +27,7 @@ module.exports = {
} else {
github.getContent(convert.getMenuPath(language), function (error, response) {
if (!error && response) {
var buf = new Buffer(response.content, 'base64');
var buf = Buffer.from(response.content, 'base64');
var content = buf.toString();
var menu = JSON.parse(content);
cache[language] = menu;
Expand Down

0 comments on commit eb43007

Please sign in to comment.