Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Feb 1, 2024
1 parent 2c67f09 commit 074e74c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/bridge/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class BridgeRpcCore {
return new Promise<S>((resolve) => {
this.bridge.once(`${eventName}:res`, (payload: string) => {
const res = {
data: [true, false].includes(payload as unknown as boolean) ? payload : parse(payload),
data: parse(payload),
} as S
resolve(res)
})
Expand Down
3 changes: 2 additions & 1 deletion packages/devtools-kit/src/shared/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function stringify<T extends object = Record<string, unknown>>(data: T) {
}

export function parse(data: string, revive = false) {
if (!data)
// eslint-disable-next-line eqeqeq
if (data == undefined)
return {}

return revive
Expand Down

0 comments on commit 074e74c

Please sign in to comment.