diff --git a/src/views/FormatJSON.vue b/src/views/FormatJSON.vue index 7827441..e3ac6f8 100644 --- a/src/views/FormatJSON.vue +++ b/src/views/FormatJSON.vue @@ -48,10 +48,11 @@ import 'vue-json-pretty/lib/styles.css' import copyIcon from '../assets/copy-icon.png' import { toast } from 'vue3-toastify' import TwoPaneLayout from '../Layouts/TwoPaneLayout.vue' +import type { JSONDataType } from 'vue-json-pretty/types/utils' let JSONInput = ref('{}') const isJSONValid = ref(true) -const formattedJSON = ref({}) +const formattedJSON = ref({}) function formatJSON() { JSONInput.value.replace(/'/g, '"') diff --git a/src/views/PHPArrayToJSON.vue b/src/views/PHPArrayToJSON.vue index 96f2934..fd874c8 100644 --- a/src/views/PHPArrayToJSON.vue +++ b/src/views/PHPArrayToJSON.vue @@ -36,6 +36,8 @@ const PHPArray = ref('') const json = ref() function convert() { - json.value = PHPArrayToJSON(PHPArray.value) + try { + json.value = PHPArrayToJSON(PHPArray.value) + } catch (e) {} } diff --git a/src/views/StringInspector.vue b/src/views/StringInspector.vue index 7004a39..60ea431 100644 --- a/src/views/StringInspector.vue +++ b/src/views/StringInspector.vue @@ -2,13 +2,12 @@