Skip to content

Commit

Permalink
🐛 Replace jsonBigint with lossless-json (usebruno#2006)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJSaunders1997 authored Apr 9, 2024
1 parent 484f6ef commit 920c490
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
15 changes: 13 additions & 2 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@
"test:prettier:web": "npm run test:prettier --workspace=packages/bruno-app",
"prepare": "husky install"
},

"overrides": {
"rollup": "3.2.5"
},
"dependencies": {
"json-bigint": "^1.0.0"
"json-bigint": "^1.0.0",
"lossless-json": "^4.0.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { humanizeRequestBodyMode } from 'utils/collections';
import StyledWrapper from './StyledWrapper';
import { updateRequestBody } from 'providers/ReduxStore/slices/collections/index';
import { toastError } from 'utils/common/error';
import jsonBigint from 'json-bigint';
import { parse, stringify } from 'lossless-json';

const RequestBodyMode = ({ item, collection }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -38,8 +38,8 @@ const RequestBodyMode = ({ item, collection }) => {
const onPrettify = () => {
if (body?.json && bodyMode === 'json') {
try {
const bodyJson = jsonBigint.parse(body.json);
const prettyBodyJson = jsonBigint.stringify(bodyJson, null, 2);
const bodyJson = parse(body.json);
const prettyBodyJson = stringify(bodyJson, null, 2);
dispatch(
updateRequestBody({
content: prettyBodyJson,
Expand Down

0 comments on commit 920c490

Please sign in to comment.