mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-23 08:25:57 +00:00
fix: replace json before js fence (#344)
This commit is contained in:
@@ -7,8 +7,8 @@ export function parseJSON<T>(json: string | null | undefined, fallback: T) {
|
|||||||
try {
|
try {
|
||||||
const raw = json
|
const raw = json
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^```js\s*/, "")
|
|
||||||
.replace(/^```json\s*/, "")
|
.replace(/^```json\s*/, "")
|
||||||
|
.replace(/^```js\s*/, "")
|
||||||
.replace(/^```ts\s*/, "")
|
.replace(/^```ts\s*/, "")
|
||||||
.replace(/^```plaintext\s*/, "")
|
.replace(/^```plaintext\s*/, "")
|
||||||
.replace(/^```\s*/, "")
|
.replace(/^```\s*/, "")
|
||||||
|
|||||||
Reference in New Issue
Block a user