summaryrefslogtreecommitdiff
path: root/test/json-schema.test.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-19 00:33:38 -0500
committerGitHub <noreply@github.com>2023-12-19 05:33:38 +0000
commit1ced9aafc00c10992bab8bd3f1b6b1397f05b7b9 (patch)
tree305bb2b3bfc7fc3b051ee1cd3d1c35f442af0de4 /test/json-schema.test.js
parent5f96276fda93dcad39f2165fd3c8d890aa5f9be5 (diff)
Make JSON.parse usage safer (#373)
* Make JSON.parse usage safer * Fix any type * Add readResponseJson * Use readResponseJson * Additional updates * Rename files * Add types
Diffstat (limited to 'test/json-schema.test.js')
-rw-r--r--test/json-schema.test.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/json-schema.test.js b/test/json-schema.test.js
index a93e5002..e6817d23 100644
--- a/test/json-schema.test.js
+++ b/test/json-schema.test.js
@@ -19,6 +19,7 @@
/* eslint-disable no-multi-spaces */
import {expect, test} from 'vitest';
+import {parseJson} from '../dev/json.js';
import {JsonSchema} from '../ext/js/data/json-schema.js';
/**
@@ -54,7 +55,7 @@ function createProxy(schema, value) {
* @returns {T}
*/
function clone(value) {
- return JSON.parse(JSON.stringify(value));
+ return parseJson(JSON.stringify(value));
}