LaiTool/src/define/Tools/validate.ts
lq1405 22cfe65dde 3.1.9 2024.10.28
1. (聚合推文)MJ反推、SD反推 添加剪映分镜
2. (聚合推文)完善SD反推分类(界面同MJ反推,些许不一致)
3. (聚合推文)完成一键合成视频(单个和批量)
4. 修改聚合推文进入界面小说批次任务表格样式
5. (聚合推文)完善一键重置
6. (聚合推文)完善一键删除
2024-10-28 18:38:11 +08:00

14 lines
278 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 校验是不是可以进行JSON解析
* @param str 要解析的字符串
* @returns 可以解析返回true否则返回false
*/
export function ValidateJson(str: string): boolean {
try {
JSON.parse(str);
return true
} catch (e) {
return false;
}
}