Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix big integer case. #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion _site/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// convert LosslessNumber to Decimal
function reviver (key, value) {
if (value && value.isLosslessNumber) {
return new Decimal(value.toString())
}
return value
}

// convert Decimal to LosslessNumber
function replacer (key, value) {
if (value instanceof Decimal) {
return new LosslessJSON.LosslessNumber(value.toString());
}
else {
return value;
}
}

(function() {

var window = this,
Expand Down Expand Up @@ -1104,7 +1122,7 @@
this.data = res.hits.hits.map(function(hit) {
var row = (function(path, spec, row) {
for(var prop in spec) {
if(acx.isObject(spec[prop])) {
if (spec[prop].constructor.name != "Decimal" && acx.isObject(spec[prop])) {
arguments.callee(path.concat(prop), spec[prop], row);
} else if(acx.isArray(spec[prop])) {
if(spec[prop].length) {
Expand Down Expand Up @@ -2258,6 +2276,9 @@
}, this);
return [ "{ ", ((results.length > 0) ? { tag: "UL", cls: "uiJsonPretty-object", children: results } : null ), "}" ];
},
"decimal": function(value) {
return this['value']('number', value.toString())
},
"number": function (value) {
return this['value']('number', value.toString());
},
Expand Down
Loading