Skip to content

Commit

Permalink
fix: deref values that are weakRefs
Browse files Browse the repository at this point in the history
  • Loading branch information
drusco committed Mar 9, 2024
1 parent 96bbc09 commit 6dbcd72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/getTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import findProxy from "./findProxy.js";
import map from "./map.js";

const getTarget = (value: unknown, resolveProxy: boolean = false): unknown => {
if (value instanceof WeakRef) {
value = value.deref();
}

const proxy = findProxy(value);

if (!proxy) {
Expand Down

0 comments on commit 6dbcd72

Please sign in to comment.