Revert "fix: BigInters are now correctly shown in the response (#2736)" (#2768)

This reverts commit 3e2a3b65a4.
This commit is contained in:
Anoop M D 2024-08-06 16:00:49 +05:30 committed by GitHub
parent 92073e7573
commit d7ec3d1cc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 10 deletions

View File

@ -1,6 +1,5 @@
import { customAlphabet } from 'nanoid';
import xmlFormat from 'xml-formatter';
import { stringify } from 'lossless-json';
// a customized version of nanoid without using _ and -
export const uuid = () => {
@ -44,9 +43,9 @@ export const safeStringifyJSON = (obj, indent = false) => {
}
try {
if (indent) {
return stringify(obj, null, 2);
return JSON.stringify(obj, null, 2);
}
return stringify(obj);
return JSON.stringify(obj);
} catch (e) {
return obj;
}

View File

@ -50,7 +50,6 @@
"js-yaml": "^4.1.0",
"json-bigint": "^1.0.0",
"lodash": "^4.17.21",
"lossless-json": "^4.0.1",
"mime-types": "^2.1.35",
"mustache": "^4.2.0",
"nanoid": "3.3.4",

View File

@ -38,7 +38,6 @@ const {
} = require('./oauth2-helper');
const Oauth2Store = require('../../store/oauth2');
const iconv = require('iconv-lite');
const { parse, LosslessNumber } = require('lossless-json');
// override the default escape function to prevent escaping
Mustache.escape = function (value) {
@ -286,11 +285,7 @@ const parseDataFromResponse = (response) => {
// Filter out ZWNBSP character
// https://gist.github.com/antic183/619f42b559b78028d1fe9e7ae8a1352d
data = data.replace(/^\uFEFF/, '');
data = parse(data, null, (value) => {
// By default, this will return the LosslessNumber object, but because it's passed into ipc we
// need to convert it into a number because LosslessNumber is converted into an object
return new LosslessNumber(value).valueOf();
});
data = JSON.parse(data);
} catch {}
return { data, dataBuffer };