Fixed type guard for non-Typed instances (#4087).
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user