good morning!!!!

Skip to content
Snippets Groups Projects
Commit f960fc06 authored by Marek Kotewicz's avatar Marek Kotewicz
Browse files

fixed printing BigNumbers

parent bb3ae302
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,8 @@ function pp(object, indent) { ...@@ -25,6 +25,8 @@ function pp(object, indent) {
str += " ]"; str += " ]";
} else if (object instanceof Error) { } else if (object instanceof Error) {
str += "\033[31m" + "Error"; str += "\033[31m" + "Error";
} else if (isBigNumber(object)) {
str += "\033[32m'" + object.toString(10) + "'";
} else if(typeof(object) === "object") { } else if(typeof(object) === "object") {
str += "{\n"; str += "{\n";
indent += " "; indent += " ";
...@@ -61,6 +63,11 @@ function pp(object, indent) { ...@@ -61,6 +63,11 @@ function pp(object, indent) {
return str; return str;
} }
var isBigNumber = function (object) {
return typeof BigNumber !== 'undefined' && object instanceof BigNumber;
};
function prettyPrint(/* */) { function prettyPrint(/* */) {
var args = arguments; var args = arguments;
var ret = ""; var ret = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment