feat: add isVailedJSON utility function for JSON validation
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
export const isVailedJSON = (str: string): boolean => {
|
||||
try {
|
||||
JSON.parse(str);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
Reference in New Issue
Block a user