chore: release 1.7.11

This commit is contained in:
IndieKKY
2024-01-20 13:31:00 +08:00
parent 4dbce345c2
commit c70fa81482
4 changed files with 84 additions and 2 deletions

View File

@@ -253,6 +253,14 @@ export const extractJsonObject = (content: string) => {
const start = content.indexOf('```')
const end = content.lastIndexOf('```')
if (start >= 0 && end >= 0) {
// 异常情况
if (start === end) {
if (content.startsWith('```')) {
content = content.slice(3)
} else {
content = content.slice(0, -3)
}
}
content = content.slice(start + 3, end)
}
// get content between { and }
@@ -269,6 +277,14 @@ export const extractJsonArray = (content: string) => {
const start = content.indexOf('```')
const end = content.lastIndexOf('```')
if (start >= 0 && end >= 0) {
// 异常情况
if (start === end) {
if (content.startsWith('```')) {
content = content.slice(3)
} else {
content = content.slice(0, -3)
}
}
content = content.slice(start + 3, end)
}
// get content between [ and ]