Skip to content

Commit

Permalink
fix then data.toString is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
NumminorihSF committed Jun 14, 2016
1 parent a483fa9 commit 15b88af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion both-formatter/text/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module.exports = function(syncWrapper){
return cb(null, syncWrapper.array(data));
}
if (data.toString === Object.prototype.toString) return cb(null,syncWrapper.object(data));
return cb(null, '<pre>'+data.toString()+'</pre>');
if (data.toString instanceof Function) return cb(null, '<pre>'+data.toString()+'</pre>');
return cb(null, '<pre>'+Object.prototype.toString.call(data)+'</pre>');
}
};
return formats;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "response-formatter",
"version": "1.0.1",
"version": "1.0.2",
"description": "An express.js middleware to format your response from server to format, that client waits.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 15b88af

Please sign in to comment.