diff --git a/script.js b/script.js index a81a11a..4467bf4 100644 --- a/script.js +++ b/script.js @@ -226,4 +226,13 @@ async function fetchWithTimeout(resource, options = {}) { clearTimeout(id); return response; +} + +function isValidJson(json) { + try { + JSON.parse(json); + } catch (e) { + return false; + } + return true; } \ No newline at end of file