DenoDDeno
Powered by
KayK
Denoβ€’2y agoβ€’
2 replies
Kay

Check if class instance is instance of provided type

I have a function that dynamically loads a folder with ts files, initiates the classes in them and saves them. The function takes in a type for its return type like this
load<T extends BaseInteraction>
load<T extends BaseInteraction>
. But when i use
DynamicClass instanceof T
DynamicClass instanceof T
it says
'T' only refers to a type, but is being used as a value here.
'T' only refers to a type, but is being used as a value here.
. is there a way to compare the class to the provided class?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

extract generic type of generic class
1771771771177177177 / help
4y ago
What does deno lint do, if not type check?
bozdozBbozdoz / help
2y ago
How to check if stdin is a file?
m4rc3l05Mm4rc3l05 / help
2y ago
How do I type check inside of my IDE?
airzaAairza / help
2y ago