Cast an object to a type. Check the type at runtime.
item
If the item is not of the correct type, throw an Error with a detailed message.
Error
Check the type of this item.
The expected type. This should be a class.
This will be included in the error message.
Generated using TypeDoc
Cast an object to a type. Check the type at runtime.
Returns
item
Throws
If the item is not of the correct type, throw an
Error
with a detailed message.