From 441f1a070601a8f41f83319f388e6659a0ac360a Mon Sep 17 00:00:00 2001 From: Yehuda Graber Date: Wed, 15 Aug 2018 16:59:07 -0400 Subject: [PATCH] Switched to using 'pretty-data' from 'jsonc-parser' MUCH quicker. --- src/utils/responseFormatUtility.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/utils/responseFormatUtility.ts b/src/utils/responseFormatUtility.ts index e2c126e2..ad3db1a5 100644 --- a/src/utils/responseFormatUtility.ts +++ b/src/utils/responseFormatUtility.ts @@ -1,7 +1,5 @@ 'use strict'; -import { applyEdits, format as JSONFormat } from "jsonc-parser/lib/umd/main"; -import { EOL } from "os"; import { window } from 'vscode'; import { MimeUtility } from './mimeUtility'; const pd = require('pretty-data').pd; @@ -11,8 +9,7 @@ export class ResponseFormatUtility { if (contentType) { if (MimeUtility.isJSON(contentType)) { if (ResponseFormatUtility.IsJsonString(body)) { - const edits = JSONFormat(body, undefined, { tabSize: 2, insertSpaces: true, eol: EOL }); - body = applyEdits(body, edits); + body = pd.json(body) } else if (!suppressValidation) { window.showWarningMessage('The content type of response is application/json, while response body is not a valid json string'); }