Skip to content

Commit

Permalink
Fixed type guard for non-Typed instances (#4087).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jun 7, 2023
1 parent bb8685b commit 20c3d1b
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 20c3d1b

Please sign in to comment.