From 36aef5b8c2deba660e515df815f12dc8fed8a439 Mon Sep 17 00:00:00 2001 From: janrywang Date: Sun, 31 Jan 2021 18:29:02 +0800 Subject: [PATCH] fix(devtools): fix serialize function --- packages/devtools/src/extension/backend.ts | 1 + packages/devtools/src/extension/manifest.json | 2 +- packages/json-schema/src/complier.ts | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/devtools/src/extension/backend.ts b/packages/devtools/src/extension/backend.ts index 618bfd5e9a7..86f19711864 100644 --- a/packages/devtools/src/extension/backend.ts +++ b/packages/devtools/src/extension/backend.ts @@ -25,6 +25,7 @@ const serializeObject = (obj: any) => { for (let key in obj) { result[key] = serialize(obj[key]) } + seens.set(obj, false) return result } } diff --git a/packages/devtools/src/extension/manifest.json b/packages/devtools/src/extension/manifest.json index bae3d47898e..fc2e3d574c5 100644 --- a/packages/devtools/src/extension/manifest.json +++ b/packages/devtools/src/extension/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.1.12", + "version": "0.1.13", "name": "Formily DevTools", "short_name": "Formily DevTools", "description": "Formily DevTools for debugging application's state changes.", diff --git a/packages/json-schema/src/complier.ts b/packages/json-schema/src/complier.ts index 044137b955a..b191afdd351 100644 --- a/packages/json-schema/src/complier.ts +++ b/packages/json-schema/src/complier.ts @@ -70,7 +70,7 @@ export const complie = ( return source } seenObjects.set(source, true) - return reduce( + const results = reduce( source, (buf, value, key) => { buf[key] = complie(value) @@ -78,6 +78,8 @@ export const complie = ( }, {} ) + seenObjects.set(source, false) + return results } return source }