Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove zprint-clj and EDN beautifying #4603

Merged
merged 5 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removes zprint beautify
  • Loading branch information
dimitropoulos committed Mar 18, 2022
commit 3840b2071ee10f1de58161f379c6efcbfa57a1ec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import React, { Component, CSSProperties, forwardRef, ForwardRefRenderFunction,
import { useSelector } from 'react-redux';
import { unreachable } from 'ts-assert-unreachable';
import vkBeautify from 'vkbeautify';
import zprint from 'zprint-clj';

import {
AUTOBIND_CFG,
Expand Down Expand Up @@ -725,14 +724,6 @@ export class UnconnectedCodeEditor extends Component<CodeEditorProps, State> {
}
}

static _prettifyEDN(code: string) {
try {
return zprint(code, null);
} catch (e) {
return code;
}
}

_prettifyXML(code: string) {
if (this.props.updateFilter && this.state.filter) {
try {
Expand Down Expand Up @@ -1143,8 +1134,6 @@ export class UnconnectedCodeEditor extends Component<CodeEditorProps, State> {
if (shouldPrettify && this._canPrettify()) {
if (UnconnectedCodeEditor._isXML(mode)) {
code = this._prettifyXML(code);
} else if (UnconnectedCodeEditor._isEDN(mode)) {
code = UnconnectedCodeEditor._prettifyEDN(code);
} else if (UnconnectedCodeEditor._isJSON(mode)) {
code = this._prettifyJSON(code);
} else {
Expand Down Expand Up @@ -1190,7 +1179,7 @@ export class UnconnectedCodeEditor extends Component<CodeEditorProps, State> {

_canPrettify() {
const { mode } = this.props;
return UnconnectedCodeEditor._isJSON(mode) || UnconnectedCodeEditor._isXML(mode) || UnconnectedCodeEditor._isEDN(mode);
return UnconnectedCodeEditor._isJSON(mode) || UnconnectedCodeEditor._isXML(mode);
}

_showFilterHelp() {
Expand Down Expand Up @@ -1266,8 +1255,6 @@ export class UnconnectedCodeEditor extends Component<CodeEditorProps, State> {
contentTypeName = 'JSON';
} else if (UnconnectedCodeEditor._isXML(mode)) {
contentTypeName = 'XML';
} else if (UnconnectedCodeEditor._isEDN(mode)) {
contentTypeName = 'EDN';
}

toolbarChildren.push(
Expand Down
6 changes: 2 additions & 4 deletions packages/insomnia-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
"srp-js",
"styled-components",
"swagger-ui-react",
"vkbeautify",
"zprint-clj"
"vkbeautify"
],
"dependencies": {
"@getinsomnia/node-libcurl": "2.3.4-3",
Expand Down Expand Up @@ -173,8 +172,7 @@
"vkbeautify": "^0.99.1",
"whatwg-fetch": "^2.0.1",
"yaml": "^1.5.0",
"yaml-source-map": "^2.1.1",
"zprint-clj": "0.8.0"
"yaml-source-map": "^2.1.1"
},
"devDependencies": {
"@babel/preset-env": "^7.15.8",
Expand Down