Skip to content

Commit

Permalink
Skyhigh173/JSON: fix json_is_valid() (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
Procybit authored Aug 5, 2024
1 parent eafceab commit 3ce22a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/Skyhigh173/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,9 @@
json_is_valid({ json }) {
if (typeof json != "string") {
return false;
} else if (
}
json = json.trim();
if (
(json.slice(0, 1) != "[" || json.slice(-1) != "]") &&
(json.slice(0, 1) != "{" || json.slice(-1) != "}")
) {
Expand Down

0 comments on commit 3ce22a6

Please sign in to comment.