Skip to content

Commit

Permalink
fix(devtools): traversePromises should not traverse null values (#5761
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Asuka109 committed May 22, 2024
1 parent 1453d01 commit 460793f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/wise-paws-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@modern-js/devtools-kit': minor
'@modern-js/devtools-client': minor
'@modern-js/plugin-devtools': minor
---

feat(devtools): new tab added for managing storage presets

feat(devtools): 新增标签页提供 storage presets 管理
3 changes: 2 additions & 1 deletion packages/devtools/kit/src/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const traversePromises = (
const promises = new Set<[PromiseLike<unknown>, Path]>();
const memo = new WeakSet();
const traverse = (value: any, currentPath: Path) => {
if (value === null) return;
if (typeof value === 'object') {
if (memo.has(value)) {
return;
Expand All @@ -84,7 +85,7 @@ export const traversePromises = (
}
if (isPromiseLike(value)) {
promises.add([value, currentPath]);
} else if (typeof value === 'object' && value !== null) {
} else if (typeof value === 'object') {
for (const [k, v] of Object.entries(value)) {
traverse(v, [...currentPath, k]);
}
Expand Down

0 comments on commit 460793f

Please sign in to comment.