Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request #97 from nodesecurity/debug_buffer_toString
Browse files Browse the repository at this point in the history
formatters: buffer.toString for debug output | closes #96
  • Loading branch information
nlf committed Apr 21, 2016
2 parents c6e26c2 + ec81e36 commit 9bcdc81
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/formatters/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (err, data) {

if (err) {
if (data) {
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(data) + '\n';
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n';
}

return returnString + Chalk.yellow('(+) ') + err;
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = function (err, data) {

if (err) {
return 'Debug output: ' + JSON.stringify(data) + '\n' + JSON.stringify(err);
return 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n' + JSON.stringify(err);
}

return JSON.stringify(data, null, 2);
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (err, data) {

if (err) {
if (data) {
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(data) + '\n';
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n';
}

return returnString + Chalk.yellow('(+) ') + err;
Expand Down

0 comments on commit 9bcdc81

Please sign in to comment.