We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96f740b commit 765105cCopy full SHA for 765105c
src/Shared/validations.tsx
@@ -248,3 +248,17 @@ export const validateUniqueKeys = (keys: string[]) => {
248
message: `Duplicate variable name: ${duplicateKeys.join(', ')}`,
249
}
250
251
+
252
+export const validateJSON = (json: string): ValidationResponseType => {
253
+ try {
254
+ JSON.parse(json)
255
+ return {
256
+ isValid: true,
257
+ }
258
+ } catch (err) {
259
260
+ isValid: false,
261
+ message: err.message,
262
263
264
+}
0 commit comments