Skip to content

Commit

Permalink
Fixed type guard for non-Typed instances (ethers-io#4087).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent bb9ddb9 commit 15e72d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src.ts/abi/typed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,10 @@ export class Typed {
* Returns true only if %%value%% is a [[Typed]] instance.
*/
static isTyped(value: any): value is Typed {
return (value && value._typedSymbol === _typedSymbol);
return (value
&& typeof(value) === "object"
&& "_typedSymbol" in value
&& value._typedSymbol === _typedSymbol);
}

/**
Expand Down

0 comments on commit 15e72d3

Please sign in to comment.