Skip to content

Commit 6b5abf1

Browse files
DJSaunders1997slowjoe007
authored andcommitted
🐛 Replace jsonBigint with lossless-json (usebruno#2006)
1 parent f4001ea commit 6b5abf1

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

package-lock.json

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@
4747
"test:prettier:web": "npm run test:prettier --workspace=packages/bruno-app",
4848
"prepare": "husky install"
4949
},
50+
5051
"overrides": {
5152
"rollup": "3.2.5"
5253
},
5354
"dependencies": {
54-
"json-bigint": "^1.0.0"
55+
"json-bigint": "^1.0.0",
56+
"lossless-json": "^4.0.1"
5557
}
5658
}

packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { humanizeRequestBodyMode } from 'utils/collections';
88
import StyledWrapper from './StyledWrapper';
99
import { updateRequestBody } from 'providers/ReduxStore/slices/collections/index';
1010
import { toastError } from 'utils/common/error';
11-
import jsonBigint from 'json-bigint';
11+
import { parse, stringify } from 'lossless-json';
1212

1313
const RequestBodyMode = ({ item, collection }) => {
1414
const dispatch = useDispatch();
@@ -38,8 +38,8 @@ const RequestBodyMode = ({ item, collection }) => {
3838
const onPrettify = () => {
3939
if (body?.json && bodyMode === 'json') {
4040
try {
41-
const bodyJson = jsonBigint.parse(body.json);
42-
const prettyBodyJson = jsonBigint.stringify(bodyJson, null, 2);
41+
const bodyJson = parse(body.json);
42+
const prettyBodyJson = stringify(bodyJson, null, 2);
4343
dispatch(
4444
updateRequestBody({
4545
content: prettyBodyJson,

0 commit comments

Comments
 (0)