Fixed type guard for non-Typed instances (#4087).

This commit is contained in:
Richard Moore 2023-06-06 21:24:02 -04:00
parent bb8685b112
commit 20c3d1b109

@ -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);
}
/**