Compare commits
1 Commits
refactor/w
...
fix/precis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b842fe197 |
@@ -89,6 +89,7 @@ import { readFileAsText } from "~/helpers/functional/files"
|
|||||||
import xmlFormat from "xml-formatter"
|
import xmlFormat from "xml-formatter"
|
||||||
import { useNestedSetting } from "~/composables/settings"
|
import { useNestedSetting } from "~/composables/settings"
|
||||||
import { toggleNestedSetting } from "~/newstore/settings"
|
import { toggleNestedSetting } from "~/newstore/settings"
|
||||||
|
import * as LJSON from "lossless-json"
|
||||||
|
|
||||||
type PossibleContentTypes = Exclude<
|
type PossibleContentTypes = Exclude<
|
||||||
ValidContentTypes,
|
ValidContentTypes,
|
||||||
@@ -187,8 +188,8 @@ const prettifyRequestBody = () => {
|
|||||||
let prettifyBody = ""
|
let prettifyBody = ""
|
||||||
try {
|
try {
|
||||||
if (body.value.contentType.endsWith("json")) {
|
if (body.value.contentType.endsWith("json")) {
|
||||||
const jsonObj = JSON.parse(rawParamsBody.value as string)
|
const jsonObj = LJSON.parse(rawParamsBody.value as string)
|
||||||
prettifyBody = JSON.stringify(jsonObj, null, 2)
|
prettifyBody = LJSON.stringify(jsonObj, undefined, 2) as string
|
||||||
} else if (body.value.contentType === "application/xml") {
|
} else if (body.value.contentType === "application/xml") {
|
||||||
prettifyBody = prettifyXML(rawParamsBody.value as string)
|
prettifyBody = prettifyXML(rawParamsBody.value as string)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user