Skip to content

Commit

Permalink
try to resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyhigh173 authored Dec 30, 2024
1 parent 720fe4e commit 603f6b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions extensions/Skyhigh173/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,13 @@
json_is_valid({ json }) {
if (typeof json != "string") {
return false;
}
json = json.trim();
if (
(json.slice(0, 1) != "[" || json.slice(-1) != "]") &&
(json.slice(0, 1) != "{" || json.slice(-1) != "}")
) {
return false;
} else {
try {
JSON.parse(json);
Expand Down

0 comments on commit 603f6b6

Please sign in to comment.