Skip to content

Commit

Permalink
fix[tchiotludo#1006]: replaced 'json-bigint' parser with 'lossless-json'
Browse files Browse the repository at this point in the history
this replacement allows for pretty-printing the json data, but still keeping the original values
especially for floating numbers and bigints.
  • Loading branch information
Tristan Baumbusch committed Nov 1, 2022
1 parent e57cc02 commit c3b3100
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
18 changes: 5 additions & 13 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"css-loader": "^3.4.1",
"font-awesome": "^4.7.0",
"joi-validation": "^2.0.0",
"json-bigint": "^1.0.0",
"lossless-json": "^2.0.1",
"lodash": "^4.17.21",
"moment": "^2.24.0",
"node-sass": "^4.14.1",
Expand Down
6 changes: 3 additions & 3 deletions client/src/containers/Topic/Topic/TopicData/TopicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import DateTime from '../../../../components/DateTime';
import { capitalizeTxt, getClusterUIOptions } from '../../../../utils/functions';
import { setProduceToTopicValues, setUIOptions} from '../../../../utils/localstorage';
import Select from '../../../../components/Form/Select';
import JSONbig from 'json-bigint';
import * as LosslessJson from 'lossless-json'

class TopicData extends Root {
state = {
Expand Down Expand Up @@ -928,8 +928,8 @@ class TopicData extends Root {
extraRowContent: (obj, index) => {
let value = obj.value;
try {
let json = JSONbig.parse(obj.value);
value = JSONbig.stringify(json, null, 2);
let json = LosslessJson.parse(obj.value);
value = LosslessJson.stringify(json, undefined, " ");
// eslint-disable-next-line no-empty
} catch (e) {}

Expand Down

0 comments on commit c3b3100

Please sign in to comment.